diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/admin/plugins.php | 7 | ||||
-rw-r--r-- | views/default/admin/plugins_opt/plugin.php | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 449c86d11..cc96b40f8 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -21,13 +21,18 @@ // Get the installed plugins $installed_plugins = $vars['installed_plugins']; $count = count($installed_plugins); +
+ $plugin_list = get_plugin_list();
+ $max = 0;
+ foreach($plugin_list as $key => $foo)
+ if ($key > $max) $max = $key;
// Display list of plugins $n = 0; foreach ($installed_plugins as $plugin => $data) { //if (($n>=$offset) && ($n < $offset+$limit)) - echo elgg_view("admin/plugins_opt/plugin", array('plugin' => $plugin, 'details' => $data)); + echo elgg_view("admin/plugins_opt/plugin", array('plugin' => $plugin, 'details' => $data, 'maxorder' => $max, 'order' => array_search($plugin, $plugin_list))); $n++; } diff --git a/views/default/admin/plugins_opt/plugin.php b/views/default/admin/plugins_opt/plugin.php index 21032b33d..b74d9bc25 100644 --- a/views/default/admin/plugins_opt/plugin.php +++ b/views/default/admin/plugins_opt/plugin.php @@ -23,7 +23,25 @@ $ts = time(); $token = generate_action_token($ts); ?> -<div class="plugin_details <?php if ($active) echo "active"; else echo "not-active" ?>"> +<div class="plugin_details <?php if ($active) echo "active"; else echo "not-active" ?>">
+ <div class="admin_plugin_reorder">
+ <?php
+ if ($vars['order'] > 10) {
+?>
+ <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=1&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("top"); ?></a>
+ <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=<?php echo $vars['order'] - 11; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("up"); ?></a>
+<?php
+ }
+ ?>
+ <?php
+ if ($vars['order'] < $vars['maxorder']) {
+?>
+ <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=<?php echo $vars['order'] + 11; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("down"); ?></a>
+ <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=<?php echo $vars['maxorder'] + 11; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("bottom"); ?></a>
+<?php
+ }
+ ?>
+ </div> <div class="admin_plugin_enable_disable"> <?php if ($active) { ?> <a href="<?php echo $vars['url']; ?>actions/admin/plugins/disable?plugin=<?php echo $plugin; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("disable"); ?></a> |