From 0154f867118ce33b2cfaa51677436e00502e223f Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 9 Feb 2011 01:02:00 +0000 Subject: Refs #2874: Using elgg_get_plugins() instead of get_installed_plugins(). git-svn-id: http://code.elgg.org/elgg/trunk@8084 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggPluginPackage.php | 4 ++-- engine/lib/admin.php | 2 +- mod/diagnostics/start.php | 2 +- pages/settings/tools.php | 2 +- views/default/core/settings/tools.php | 10 ++++++---- views/default/core/settings/tools/plugin.php | 25 +++++++++---------------- views/default/object/plugin.php | 6 ++++-- 7 files changed, 24 insertions(+), 27 deletions(-) diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index 7b033a9d8..e1b3427cc 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -415,7 +415,7 @@ class ElggPluginPackage { * Checks if $plugins meets the requirement by $dep. * * @param array $dep An Elgg manifest.xml deps array - * @param array $plugins A list of plugins as returned by get_installed_plugins(); + * @param array $plugins A list of plugins as returned by elgg_get_plugins(); * @param bool $inverse Inverse the results to use as a conflicts. * @return bool */ @@ -433,7 +433,7 @@ class ElggPluginPackage { * Checks if $plugins meets the requirement by $dep. * * @param array $dep An Elgg manifest.xml deps array - * @param array $plugins A list of plugins as returned by get_installed_plugins(); + * @param array $plugins A list of plugins as returned by elgg_get_plugins(); * @param bool $inverse Inverse the results to use as a conflicts. * @return bool */ diff --git a/engine/lib/admin.php b/engine/lib/admin.php index cab6fe4e5..d076bbd3d 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -18,7 +18,7 @@ function elgg_admin_add_plugin_settings_menu() { global $CONFIG; - if (!$installed_plugins = get_installed_plugins()) { + if (!$installed_plugins = elgg_get_plugins()) { // nothing added because no items return FALSE; } diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php index a756c8168..78e01d0ad 100644 --- a/mod/diagnostics/start.php +++ b/mod/diagnostics/start.php @@ -45,7 +45,7 @@ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params) { * @return tring */ function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params) { - $returnvalue .= elgg_echo('diagnostics:report:plugins', array(print_r(get_installed_plugins(), true))); + $returnvalue .= elgg_echo('diagnostics:report:plugins', array(print_r(elgg_get_plugins(), true))); return $returnvalue; } diff --git a/pages/settings/tools.php b/pages/settings/tools.php index dcb026677..ea7c904e5 100644 --- a/pages/settings/tools.php +++ b/pages/settings/tools.php @@ -17,7 +17,7 @@ if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit() $title = elgg_echo("usersettings:plugins"); $content = elgg_view("core/settings/tools", - array('installed_plugins' => get_installed_plugins())); + array('installed_plugins' => elgg_get_plugins())); $params = array( 'content' => $content, diff --git a/views/default/core/settings/tools.php b/views/default/core/settings/tools.php index 42b2227ff..e280e0d8e 100644 --- a/views/default/core/settings/tools.php +++ b/views/default/core/settings/tools.php @@ -7,7 +7,9 @@ */ // Description of what's going on -echo "
".elgg_view('output/longtext', array('value' => elgg_echo("usersettings:plugins:description")))."
"; +echo "
" + . elgg_view('output/longtext', array('value' => elgg_echo("usersettings:plugins:description"))) + . "
"; $limit = get_input('limit', 10); $offset = get_input('offset', 0); @@ -18,8 +20,8 @@ $count = count($installed_plugins); // Display list of plugins $n = 0; -foreach ($installed_plugins as $plugin => $data) { - if (elgg_is_active_plugin($plugin)) { - echo elgg_view("core/settings/tools/plugin", array('plugin' => $plugin, 'details' => $data)); +foreach ($installed_plugins as $plugin) { + if ($plugin->isActive()) { + echo elgg_view("core/settings/tools/plugin", array('plugin' => $plugin)); } } \ No newline at end of file diff --git a/views/default/core/settings/tools/plugin.php b/views/default/core/settings/tools/plugin.php index d89e93c2f..ab25e7fb8 100644 --- a/views/default/core/settings/tools/plugin.php +++ b/views/default/core/settings/tools/plugin.php @@ -1,42 +1,35 @@ getID(); $user_guid = $details['user_guid']; -if ($user_guid) { +if (!$user_guid) { $user_guid = elgg_get_logged_in_user_guid(); } -if (elgg_view("usersettings/{$plugin}/edit")) { +if (elgg_view("usersettings/$plugin_id/edit")) { ?>
-

+

manifest->getName(); ?>

$plugin, - 'entity' => find_plugin_usersettings($plugin, $user_guid), + 'entity' => find_plugin_usersettings($plugin_id, $user_guid), 'prefix' => 'user' )); ?>
-
+ getID(); $prefix = $vars['prefix']; // Do we want to show admin settings (default) or user settings -$form_body = elgg_view("{$prefix}settings/{$plugin}/edit", $vars); -$form_body .= "

" . elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin)) . elgg_view('input/submit', array('value' => elgg_echo('save'))) . "

"; +$form_body = elgg_view("{$prefix}settings/{$plugin_id}/edit", $vars) + . "

" . elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin_id)) + . elgg_view('input/submit', array('value' => elgg_echo('save'))) . "

"; ?>
-- cgit v1.2.3