diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-09 19:11:55 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-09 19:11:55 +0000 |
commit | 727ba0b25e7b5737dcffb3061b96dba5f1a7f034 (patch) | |
tree | 1ed3bc248ca1be0d46d249f738301f3ec67d04a3 /views/default/object/plugin/advanced.php | |
parent | 92819a1cd4ac44607c35de069a1edf8ef5bc4048 (diff) | |
download | elgg-727ba0b25e7b5737dcffb3061b96dba5f1a7f034.tar.gz elgg-727ba0b25e7b5737dcffb3061b96dba5f1a7f034.tar.bz2 |
Refs #2871 only showing links for changing priority when all plugins are shown in priority order
git-svn-id: http://code.elgg.org/elgg/trunk@9154 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/object/plugin/advanced.php')
-rw-r--r-- | views/default/object/plugin/advanced.php | 100 |
1 files changed, 54 insertions, 46 deletions
diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 56e680ad5..21c99f619 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -5,11 +5,15 @@ * This file renders a plugin for the admin screen, including active/deactive, * manifest details & display plugin settings. * + * @uses $vars['entity'] + * @uses $vars['display_reordering'] Do we display the priority reordering links? + * * @package Elgg.Core * @subpackage Plugins */ $plugin = $vars['entity']; +$reordering = elgg_extract('display_reordering', $vars, false); $priority = $plugin->getPriority(); $active = $plugin->isActive(); @@ -24,58 +28,60 @@ $token = generate_action_token($ts); // build reordering links $links = ''; -// top and up link only if not at top -if ($priority > 1) { - $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'first', - 'is_action' => true - )); +if ($reordering) { + // top and up link only if not at top + if ($priority > 1) { + $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'first', + 'is_action' => true + )); - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $top_url, - 'text' => elgg_echo('top'), - 'is_action' => true - )) . "</li>"; + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $top_url, + 'text' => elgg_echo('top'), + 'is_action' => true + )) . "</li>"; - $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '-1', - 'is_action' => true - )); + $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '-1', + 'is_action' => true + )); - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $up_url, - 'text' => elgg_echo('up'), - 'is_action' => true - )) . "</li>"; -} + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $up_url, + 'text' => elgg_echo('up'), + 'is_action' => true + )) . "</li>"; + } -// down and bottom links only if not at bottom -if ($priority < $max_priority) { - $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '+1', - 'is_action' => true - )); + // down and bottom links only if not at bottom + if ($priority < $max_priority) { + $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '+1', + 'is_action' => true + )); - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $down_url, - 'text' => elgg_echo('down'), - 'is_action' => true - )) . "</li>"; + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $down_url, + 'text' => elgg_echo('down'), + 'is_action' => true + )) . "</li>"; - $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'last', - 'is_action' => true - )); + $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'last', + 'is_action' => true + )); - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $bottom_url, - 'text' => elgg_echo('bottom'), - 'is_action' => true - )) . "</li>"; + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $bottom_url, + 'text' => elgg_echo('bottom'), + 'is_action' => true + )) . "</li>"; + } } // activate / deactivate links @@ -181,9 +187,11 @@ if ($files) { <div class="elgg-state-draggable elgg-plugin <?php echo $active_class ?>" id="elgg-plugin-<?php echo $plugin->guid; ?>"> <div class="elgg-image-block"> <div class="elgg-image-alt"> + <?php if ($links) : ?> <ul class="elgg-menu elgg-menu-metadata"> - <?php echo "$links"; ?> + <?php echo $links; ?> </ul> + <?php endif; ?> <div class="clearfloat right mtm"> <?php echo $action_button; ?> </div> |