diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-05-19 23:42:41 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-05-19 23:42:41 +0000 |
commit | 7ee9c7cacbe5da9ecc8c5bb8d3ba51be3ce1d30a (patch) | |
tree | c2edb606412996b5ef1a0222ea6039014bc1c8c8 | |
parent | 81d6884ecad771f4b4f2d8be7572d1a89deaab10 (diff) | |
download | elgg-7ee9c7cacbe5da9ecc8c5bb8d3ba51be3ce1d30a.tar.gz elgg-7ee9c7cacbe5da9ecc8c5bb8d3ba51be3ce1d30a.tar.bz2 |
Fixes #3163 plugin/<plugin id>/settings.php is now the preferred way to add settings plugins
git-svn-id: http://code.elgg.org/elgg/trunk@9101 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/admin.php | 8 | ||||
-rw-r--r-- | views/default/object/plugin/advanced.php | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 5528a29cc..8016a2fd6 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -325,7 +325,9 @@ function elgg_admin_add_plugin_settings_menu() { foreach ($active_plugins as $plugin) { $plugin_id = $plugin->getID(); - if (elgg_view_exists("settings/$plugin_id/edit")) { + $settings_view_old = 'settings/' . $plugin_id . '/edit'; + $settings_view_new = 'plugins/' . $plugin_id . '/settings'; + if (elgg_view_exists($settings_view_new) || elgg_view_exists($settings_view_old)) { elgg_register_menu_item('page', array( 'name' => $plugin_id, 'href' => "admin/plugin_settings/$plugin_id", @@ -413,8 +415,8 @@ function admin_settings_page_handler($page) { $vars = array('page' => $page); // special page for plugin settings since we create the form for them - if ($page[0] == 'plugin_settings' && isset($page[1]) - && elgg_view_exists("settings/{$page[1]}/edit")) { + if ($page[0] == 'plugin_settings' && isset($page[1]) && + (elgg_view_exists("settings/{$page[1]}/edit") || elgg_view_exists("plugins/{$page[1]}/settings"))) { $view = 'admin/plugin_settings'; $plugin = elgg_get_plugin_from_id($page[1]); diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 4c8bc8c17..9aed4163c 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -182,8 +182,9 @@ if ($files) { </div> <div class="elgg-body"> <?php -$settings_view = 'settings/' . $plugin->getID() . '/edit'; -if (elgg_view_exists($settings_view)) { +$settings_view_old = 'settings/' . $plugin->getID() . '/edit'; +$settings_view_new = 'plugins/' . $plugin->getID() . '/settings'; +if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)) { $link = elgg_get_site_url() . "admin/plugin_settings/" . $plugin->getID(); $settings_link = "<a class='plugin_settings small link' href='$link'>[" . elgg_echo('settings') . "]</a>"; } |