]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2871 only showing links for changing priority when all plugins are shown in...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 9 Jun 2011 19:11:55 +0000 (19:11 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 9 Jun 2011 19:11:55 +0000 (19:11 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@9154 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/admin/plugins/advanced.php
views/default/object/plugin/advanced.php
views/default/object/plugin/elements/dependencies.php

index deae9dcddfc5ccd39dd0d363a90e5cef7c36b7e4..9f426fae2299f197b02e6b5cb6746ffa5f26183c 100644 (file)
@@ -156,7 +156,16 @@ $buttons .= $category_form . $sort_form;
 <div id="elgg-plugin-list">
 <?php
 
-echo elgg_view_entity_list($plugin_list, 0, 0, 0, true, false, false);
+$options = array(
+       'limit' => 0,
+       'full_view' => true,
+       'list_type_toggle' => false,
+       'pagination' => false,
+);
+if ($show_category == 'all' && $sort == 'priority') {
+       $options['display_reordering'] = true;
+}
+echo elgg_view_entity_list($plugin_list, $options);
 
 ?>
 </div>
\ No newline at end of file
index 56e680ad50aec5ba4691ed2ba25a00d0d23d3904..21c99f61940fbfb40b54ce6bc0e68c2395a58e9a 100644 (file)
@@ -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>
index f4d1ccc5a77d1704a56b41df3eaddbefbde994f1..5f4aa4392271be6a13359a31a19d709660d82bbd 100644 (file)
@@ -20,7 +20,7 @@ foreach ($columns as $column) {
        echo "<th class=\"pas\">$column</th>";
 }
 
-echo '<tr/>';
+echo '</tr>';
 
 $row = 'odd';
 foreach ($deps as $dep) {