diff options
author | mistic100 <mistic@piwigo.org> | 2011-05-23 12:34:08 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2011-05-23 12:34:08 +0000 |
commit | 489af703b1c0c7beba790fba5c92e5a38ddb4514 (patch) | |
tree | 54c15d1e3d2a81f0829f69b6ee6cb136652c1bca /admin/plugins_installed.php | |
parent | 937aed04e68b5053e34a9364b4925b5f3cde08e7 (diff) |
plugin manager : delete ordering by name, fiw some styles
git-svn-id: http://piwigo.org/svn/trunk@11010 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/plugins_installed.php | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/admin/plugins_installed.php b/admin/plugins_installed.php index fd76f69b8..4cefe45e4 100644 --- a/admin/plugins_installed.php +++ b/admin/plugins_installed.php @@ -30,10 +30,8 @@ include_once(PHPWG_ROOT_PATH.'admin/include/plugins.class.php'); $template->set_filenames(array('plugins' => 'plugins_list.tpl')); -// order and display mode -$plugin_order = isset($_GET['plugin_order']) ? $_GET['plugin_order'] : (pwg_get_session_var('plugin_order') != null ? pwg_get_session_var('plugin_order') : 'state'); +// display mode $plugin_display = isset($_GET['plugin_display']) ? $_GET['plugin_display'] : (pwg_get_session_var('plugin_display') != null ? pwg_get_session_var('plugin_display') : 'compact'); -pwg_set_session_var('plugin_order', $plugin_order); pwg_set_session_var('plugin_display', $plugin_display); $base_url = get_root_url().'admin.php?page='.$page['page']; @@ -148,31 +146,19 @@ if (count($missing_plugin_ids) > 0) $template->append('plugin_states', 'missing'); } -// sort plugins : state or name -if ($plugin_order == 'name') -{ - function cmp($a, $b) - { +// sort plugins by state then by name +function cmp($a, $b) +{ + $s = array('merged' => 0, 'missing' => 1, 'active' => 2, 'inactive' => 3); + + if($a['STATE'] == $b['STATE']) return strcasecmp($a['NAME'], $b['NAME']); - } -} -else -{ - function cmp($a, $b) - { - $s = array('merged' => 0, 'missing' => 1, 'active' => 2, 'inactive' => 3); - - if($a['STATE'] == $b['STATE']) - return strcasecmp($a['NAME'], $b['NAME']); - else - return $s[$a['STATE']] >= $s[$b['STATE']]; - } - $plugin_order = 'state'; + else + return $s[$a['STATE']] >= $s[$b['STATE']]; } - usort($tpl_plugins, 'cmp'); + $template->assign(array( - 'plugin_order' => $plugin_order, 'plugin_display' => $plugin_display, 'plugins' => $tpl_plugins, 'PWG_TOKEN' => $pwg_token, |