aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-04 03:12:48 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-04 03:12:48 +0000
commit780723dfae9d9c910dfdb6a9e244fce738942e3b (patch)
treec305a6bcdc777183847993814b7d5e511cfcf81d
parent77c4fd10bc965499d6ad58c49ea17dab9414bb44 (diff)
downloadelgg-780723dfae9d9c910dfdb6a9e244fce738942e3b.tar.gz
elgg-780723dfae9d9c910dfdb6a9e244fce738942e3b.tar.bz2
Fixes #2820, Fixes #2823. Using elgg_get_plugins() in elgg_get_plugins_provides(). Fixed plugin conflicts system. Removed cruft from ElggPluginPackage. Fixed deprecated get_installed_plugins() to honor the type requested.
git-svn-id: http://code.elgg.org/elgg/trunk@8010 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggPluginPackage.php22
-rw-r--r--engine/lib/deprecated-1.8.php26
-rw-r--r--engine/lib/plugins.php13
3 files changed, 24 insertions, 37 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index d7392132c..01437a4e4 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -490,28 +490,6 @@ class ElggPluginPackage {
}
/**
- * Activate the plugin.
- *
- * @note This method is activate() to avoid clashing with ElggEntity::enable()
- *
- * @return bool
- */
- public function activate() {
- return enable_plugin($this->getID());
- }
-
- /**
- * Deactivate the plugin.
- *
- * @note This method is deactivate() to avoid clashing with ElggEntity::disable()
- *
- * @return bool
- */
- public function deactivate() {
- return disable_plugin($this->getID());
- }
-
- /**
* Returns the Plugin ID
*
* @return string
diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php
index dbe53c115..3db32c522 100644
--- a/engine/lib/deprecated-1.8.php
+++ b/engine/lib/deprecated-1.8.php
@@ -49,7 +49,7 @@ function register_action($action, $public = false, $filename = "", $admin_only =
* @param int $priority Optional priority to govern the appearance in the list.
*
* @deprecated 1.8 Extend admin views manually
- *
+ *
* @return void
*/
function extend_elgg_admin_page($new_admin_view, $view = 'admin/main', $priority = 500) {
@@ -1162,7 +1162,7 @@ function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type
* @param bool $pagination Display pagination? Default: true
*
* @return string List of ElggEntities suitable for display
- *
+ *
* @deprecated 1.8 Use elgg_list_entities_from_metadata() instead
*/
function list_entities_from_metadata_multi($meta_array, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
@@ -1610,10 +1610,20 @@ function get_installed_plugins($status = 'all') {
continue;
}
- $installed_plugins[$plugin->getID()] = array(
- 'active' => $plugin->isActive(),
- 'manifest' => $plugin->manifest->getManifest()
- );
+ $include = true;
+
+ if ($status == 'enabled' && !$plugin->isActive()) {
+ $include = false;
+ } elseif ($status == 'disabled' && $plugin->isActive()) {
+ $include = true;
+ }
+
+ if ($include) {
+ $installed_plugins[$plugin->getID()] = array(
+ 'active' => $plugin->isActive(),
+ 'manifest' => $plugin->manifest->getManifest()
+ );
+ }
}
return $installed_plugins;
@@ -2396,7 +2406,7 @@ $owner_guid = "", $owner_relationship = "") {
* @param string $password The password, optionally (for standard logins)
*
* @return ElggUser|false The authenticated user object, or false on failure.
- *
+ *
* @deprecated 1.8 Use elgg_authenticate
*/
function authenticate($username, $password) {
@@ -2468,7 +2478,7 @@ function list_site_members($site_guid, $limit = 10, $fullview = true) {
* @param int $collection_guid Collection GUID
*
* @return mixed
- * @deprecated 1.8
+ * @deprecated 1.8
*/
function add_site_collection($site_guid, $collection_guid) {
elgg_deprecated_notice("add_site_collection has been deprecated", 1.8);
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 783827d27..2174814bd 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -551,16 +551,13 @@ function elgg_get_calling_plugin_id($mainfilename = false) {
*/
function elgg_get_plugins_provides($type = null, $name = null) {
static $provides = null;
- $active_plugins = get_installed_plugins('enabled');
+ $active_plugins = elgg_get_plugins('active');
if (!isset($provides)) {
$provides = array();
- foreach ($active_plugins as $plugin_id => $plugin_info) {
- // @todo remove this when fully converted to ElggPluginPackage.
- $package = new ElggPluginPackage($plugin_id);
-
- if ($plugin_provides = $package->getManifest()->getProvides()) {
+ foreach ($active_plugins as $plugin) {
+ if ($plugin_provides = $plugin->manifest->getProvides()) {
foreach ($plugin_provides as $provided) {
$provides[$provided['type']][$provided['name']] = array(
'version' => $provided['version'],
@@ -621,7 +618,7 @@ function elgg_check_plugins_provides($type, $name, $version = null, $comparison
}
return array(
- 'status' => $r,
+ 'status' => $status,
'value' => $version
);
}
@@ -716,6 +713,8 @@ function elgg_get_plugin_dependency_strings($dep) {
if ($dep['status']) {
$strings['comment'] = elgg_echo('ok');
+ } else {
+ $strings['comment'] = elgg_echo('error');
}
return $strings;