Skip to content

Commit

Permalink
Update composer
Browse files Browse the repository at this point in the history
  • Loading branch information
raftaar1191 committed Nov 11, 2023
1 parent 7557ba6 commit 3b25990
Show file tree
Hide file tree
Showing 51 changed files with 712 additions and 111 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"plugin"
],
"require": {
"acrosswp/acrosswp-buddyboss-dependency": "dev-main",
"yahnis-elsts/plugin-update-checker": "dev-master",
"acrosswp/acrosswp-plugin-update-checker-github": "dev-main"
},
"minimum-stability": "dev",
"support": {
"issues": "https://github.com/acrosswp/view-analytics/issues"
},
Expand Down
106 changes: 98 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?php
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

class AcrossWP_BuddyBoss_Platform_Dependency extends AcrossWP_Plugins_Dependency {

/**
* Load this function on plugin load hook
* Example: _e('<strong>BuddyBoss Sorting Option In Network Search</strong></a> requires the BuddyBoss Platform plugin to work. Please <a href="https://buddyboss.com/platform/" target="_blank">install BuddyBoss Platform</a> first.', 'sorting-option-in-network-search-for-buddyboss');
*/
function constant_not_define_text(){
printf(
__(
'<strong>%s</strong></a> requires the BuddyBoss Platform plugin to work. Please <a href="https://buddyboss.com/platform/" target="_blank">install BuddyBoss Platform</a> first.',
'acrosswp'
),
$this->get_plugin_name()
);
}

/**
* Load this function on plugin load hook
* Example: printf( __('<strong>BuddyBoss Sorting Option In Network Search</strong></a> requires BuddyBoss Platform plugin version %s or higher to work. Please update BuddyBoss Platform.', 'sorting-option-in-network-search-for-buddyboss'), $this->mini_version() );
*/
function constant_mini_version_text() {
printf(
__(
'<strong>%s</strong></a> requires BuddyBoss Platform plugin version %s or higher to work. Please update BuddyBoss Platform.',
'acrosswp'
),
$this->get_plugin_name(),
$this->mini_version()
);
}

/**
* Load this function on plugin load hook
* Example: printf( __('<strong>BuddyBoss Sorting Option In Network Search</strong></a> requires BuddyBoss Platform plugin version %s or higher to work. Please update BuddyBoss Platform.', 'sorting-option-in-network-search-for-buddyboss'), $this->mini_version() );
*/
function component_required_text() {

$bb_components = bp_core_get_components();
$component_required = $this->component_required();
$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
$component_required_label = array();

foreach( $bb_components as $key => $bb_component ) {
if( in_array( $key, $component_required ) ) {
$component_required_label[] = '<strong>' . $bb_component['title'] . '</strong>';
}
}

if( count( $component_required_label ) > 1 ) {
$last = array_pop( $component_required_label );
$component_required_label = implode( ', ', $component_required_label ) . ' and ' . $last;
} else {
$component_required_label = $component_required_label[0];
}

printf(
__(
'<strong>%s</strong></a> requires BuddyBoss Platform %s Component to work. Please Active the mentions Component.',
'acrosswp'
),
$this->get_plugin_name(),
$component_required_label
);
}

/**
* Load this function on plugin load hook
*/
function constant_name(){
return 'BP_PLATFORM_VERSION';
}

/**
* Load this function on plugin load hook
*/
function mini_version(){
return '2.3.0';
}

/**
* Load this function on plugin load hook
*/
public function component_required() {
return array( 'media' );
}

/**
* Check if the Required Component is Active
*/
public function required_component_is_active() {
$is_active = false;
$component_required = $this->component_required();

// Active components.
$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );

foreach( $component_required as $component_require ) {
if( isset( $active_components[ $component_require ] ) ) {
$is_active = true;
} else {
$is_active = false;
break;
}
}

return $is_active;

}
}
26 changes: 26 additions & 0 deletions vendor/acrosswp/acrosswp-buddyboss-dependency/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "acrosswp/acrosswp-buddyboss-dependency",
"type": "library",
"license": "GPL-2.0-or-later",
"description": "Composer to autoload the AcrossWP Dependency Class",
"homepage": "https://acrosswp.com/",
"keywords": [
"wordpress",
"plugin"
],
"autoload": {
"files": ["acrosswp-buddyboss-dependency.php"]
},
"support": {
"issues": "https://github.com/acrosswp/acrosswp-buddyboss-dependency/issues"
},
"require": {
"acrosswp/acrosswp-dependency": "dev-main"
},
"authors": [
{
"name": "acrosswp",
"email": "[email protected]"
}
]
}
Loading

0 comments on commit 3b25990

Please sign in to comment.