From 489af703b1c0c7beba790fba5c92e5a38ddb4514 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Mon, 23 May 2011 12:34:08 +0000 Subject: plugin manager : delete ordering by name, fiw some styles git-svn-id: http://piwigo.org/svn/trunk@11010 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/plugins_installed.php | 34 +++++----------- admin/themes/clear/theme.css | 7 ++-- admin/themes/default/template/plugins_list.tpl | 54 +++++++------------------- admin/themes/default/theme.css | 36 ++++++++++++----- admin/themes/roma/theme.css | 7 ++-- 5 files changed, 57 insertions(+), 81 deletions(-) (limited to 'admin') 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, diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index 4967ba94d..995c6ffab 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -257,12 +257,11 @@ display:block; height:85px; left:225px; position:relative; top:-42px; width:313p #pwgHead A:hover, #footer A:hover {color:black; border-color:black;} #footer { background-image: url(images/piwigo_logo_small.png);} -.pluginBox, .pluginMiniBox {background-color:#ddd;color:#353535;border:1px solid #ddd;} +.pluginBox, .pluginMiniBox {background-color:#ddd;color:#353535;border-color:#ddd;} .pluginBoxNameCell, .pluginMiniBoxNameCell {color:#111;} -.pluginBox.active, .pluginMiniBox.active {border-color:#666;background-color:#dadada;} .pluginBox.incompatible, .pluginMiniBox.incompatible {border-color:#a00 !important;} -.pluginBox.missing, .pluginBox.merged, .pluginMiniBox.missing, .pluginMiniBox.merged {background-color:#d99;border:1px solid #a00;} -.plugin-delete {color:#f00;} +.pluginBoxes .merged, .pluginBoxes .missing {background-color:#d99;border:1px solid #a00;} +.deactivate_all {color:#005E89;border-color:#005E89;} .languageBox {background-color:#ddd;} .languageName {color:black;} diff --git a/admin/themes/default/template/plugins_list.tpl b/admin/themes/default/template/plugins_list.tpl index 54f051eac..7efdd822f 100644 --- a/admin/themes/default/template/plugins_list.tpl +++ b/admin/themes/default/template/plugins_list.tpl @@ -21,29 +21,19 @@ jQuery(document).ready(function() { jQuery('a.deactivate_all').click(function() { if (confirm(confirmMsg)) { jQuery('div.active').each(function() { - performPluginAction(jQuery(this).attr('id'), 'deactivate'); + performPluginDeactivate(jQuery(this).attr('id')); }); } }); - jQuery('a.activate_all').click(function() { - if (confirm(confirmMsg)) { - jQuery('div.inactive').each(function() { - performPluginAction(jQuery(this).attr('id'), 'activate'); - }); - } - }); - function performPluginAction(id, action) { + function performPluginDeactivate(id) { queuedManager.add({ type: 'GET', dataType: 'json', url: 'ws.php', - data: { method: 'pwg.plugins.performAction', action: action, plugin: id, pwg_token: pwg_token, format: 'json' }, + data: { method: 'pwg.plugins.performAction', action: 'deactivate', plugin: id, pwg_token: pwg_token, format: 'json' }, success: function(data) { if (data['stat'] == 'ok') { - if (action == 'deactivate') - jQuery("#"+id).removeClass('active').addClass('inactive'); - else - jQuery("#"+id).removeClass('inactive').addClass('active'); + jQuery("#"+id).removeClass('active').addClass('inactive'); } } }); @@ -80,23 +70,13 @@ jQuery(document).ready(function() {
-
+ - {'Sort order'|@translate} : - -   |   {'Display'|@translate} : -   |   - {'Deactivate'|@translate} {'all'|@translate} - {*   |   - {'Activate'|@translate} {'all'|@translate} *}

{'Plugins'|@translate}

@@ -107,9 +87,9 @@ jQuery(document).ready(function() { {assign var='field_name' value='null'} {foreach from=$plugins item=plugin name=plugins_loop} -{if $plugin_order == 'state' AND $field_name != $plugin.STATE} +{if $field_name != $plugin.STATE} {if $field_name != 'null'}{/if} -
+
{if $plugin.STATE == 'active'} {'Active Plugins'|@translate} @@ -122,11 +102,7 @@ jQuery(document).ready(function() { {/if} {assign var='field_name' value=$plugin.STATE} - -{elseif $field_name == 'null'} -
- {assign var='field_name' value='not_null'} - + {if $field_name == 'active'}{'Deactivate'|@translate} {'all'|@translate}{/if} {/if} {if not empty($plugin.AUTHOR)} @@ -147,7 +123,7 @@ jQuery(document).ready(function() { {$plugin.DESC} - + {if $plugin.STATE == 'active'} {'Deactivate'|@translate} @@ -155,13 +131,13 @@ jQuery(document).ready(function() { {elseif $plugin.STATE == 'inactive'} {'Activate'|@translate} - | {'Delete'|@translate} + | {'Delete'|@translate} {elseif $plugin.STATE == 'missing'} - {'Uninstall'|@translate} + {'Uninstall'|@translate} {elseif $plugin.STATE == 'merged'} - {'Delete'|@translate} + {'Delete'|@translate} {/if} @@ -199,13 +175,13 @@ jQuery(document).ready(function() { {elseif $plugin.STATE == 'inactive'} {'Activate'|@translate} - | {'Delete'|@translate} + | {'Delete'|@translate} {elseif $plugin.STATE == 'missing'} - {'Uninstall'|@translate} + {'Uninstall'|@translate} {elseif $plugin.STATE == 'merged'} - {'Delete'|@translate} + {'Delete'|@translate} {/if}
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 20a6b3aad..05c6bac8a 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -884,26 +884,42 @@ h2:lang(en) { text-transform:capitalize; } .checkActions {text-align:left;padding:0;margin:0;} .comment A:hover {border:none;} -.pluginBoxes {text-align:left;} -.author-group {text-align:left;background:url('icon/remove_filter.png') left center no-repeat;padding-left:15px;margin-left:-15px;} +.pluginBoxes { + text-align:left; + position:relative; +} -.pluginBox {margin-bottom:10px;-moz-border-radius:5px;} +.pluginBox { + margin-bottom:10px; + border-width:1px; + border-style:solid; + border-radius:5px; + -moz-border-radius:5px; + } .pluginBox table {width:99%;} .pluginBox td {text-align:left;} .pluginBox td.pluginDesc img {vertical-align:middle;} .pluginBoxNameCell {width:180px; vertical-align:top;} -.pluginBox.inactive, .pluginBox.uninstalled {margin-left:20px;opacity:0.65;filter:alpha(opacity=65);} -.pluginsByState .pluginBox.inactive, .pluginsByState .pluginBox.uninstalled {margin-left:0px;opacity:0.8;filter:alpha(opacity=80);} - -.pluginMiniBox {display:inline-table; text-align:center; width:250px; height:40px; margin:5px; -moz-border-radius:5px; overflow:hidden; } +.pluginBoxes .inactive, .pluginBoxes .uninstalled {opacity:0.8;filter:alpha(opacity=80);} + +.pluginMiniBox { + display:inline-table; + text-align:center; + width:250px; + height:40px; + margin:5px; + border-width:1px; + border-style:solid; + border-radius:5px; + -moz-border-radius:5px; + overflow:hidden; + } .pluginMiniBoxNameCell {font-size:1.05em; margin:5px 0;} .pluginActions {display: table-row; font-size:12px; } .pluginActions DIV {display: table-cell; vertical-align: middle; line-height:18px; } -.pluginMiniBox.inactive, .pluginMiniBox.uninstalled {opacity:0.65;filter:alpha(opacity=65);} -.pluginsByState .pluginMiniBox.inactive, .pluginsByState .pluginMiniBox.uninstalled {opacity:0.8;filter:alpha(opacity=80);} .warning:before {content:url(icon/warning.png);vertical-align:top;} -fieldset.pluginsByName{border:none;} +.deactivate_all {position:absolute;bottom:-10px;right:18px;color:#f36;border-bottom:1px dotted #f36;font-size:0.8em;} .languageBoxes {min-height:0;text-align:left;} .languageBox {display:inline-table; text-align:center; width:200px; height:40px; margin:5px; -moz-border-radius:5px; overflow:hidden; } diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index 1a75134f7..2ff2e65f1 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -234,12 +234,11 @@ display:block; height:85px; left:225px; position:relative; top:-42px; width:313p #pwgHead, #footer {background-color:#222;} #footer {background-image: url(images/piwigo_logo_small.png);} -.pluginBox, .pluginMiniBox {background-color:#333;color:#999;border:1px solid #333;} +.pluginBox, .pluginMiniBox {background-color:#333;color:#999;border-color:#333;} .pluginBoxNameCell, .pluginMiniBoxNameCell {color:#ddd;} -.pluginBox.active, .pluginMiniBox.active {border-color:#666;background-color:#383838;} .pluginBox.incompatible, .pluginMiniBox.incompatible {border-color:#800 !important;} -.pluginBox.missing, .pluginBox.merged, .pluginMiniBox.missing, .pluginMiniBox.merged {background-color:#422;border:1px solid #800;} -.plugin-delete {color:#f00;} +.pluginBoxes .merged, .pluginBoxes .missing {background-color:#422;border:1px solid #800;} +.pluginActions { color:#666; } .languageBox {background-color:#333;} .languageName {color:#ccc;} -- cgit v1.2.3