aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-06-04 09:34:59 +0000
committermistic100 <mistic@piwigo.org>2011-06-04 09:34:59 +0000
commiteffb4d9de0dff2f68e65e9fabe4c9d4e18b68fe6 (patch)
treeb6010556c7ce3656bf22fec14529d717927a7c86
parentd2fa16a7f5a0f334d72080eb12b78aea549e8d8b (diff)
'Deactivate all' link now visible if all plugins are active
git-svn-id: http://piwigo.org/svn/trunk@11227 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/plugins_installed.php7
-rw-r--r--admin/themes/default/template/plugins_installed.tpl25
2 files changed, 23 insertions, 9 deletions
diff --git a/admin/plugins_installed.php b/admin/plugins_installed.php
index a16dbaaef..758c1b11d 100644
--- a/admin/plugins_installed.php
+++ b/admin/plugins_installed.php
@@ -86,6 +86,7 @@ $plugins->sort_fs_plugins('name');
$merged_extensions = $plugins->get_merged_extensions();
$merged_plugins = false;
$tpl_plugins = array();
+$active_plugins = 0;
foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
{
@@ -123,6 +124,11 @@ foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
$tpl_plugin['DESC'] = l10n('THIS PLUGIN IS NOW PART OF PIWIGO CORE! DELETE IT NOW.');
$merged_plugins = true;
}
+
+ if ($tpl_plugin['STATE'] == 'active')
+ {
+ $active_plugins++;
+ }
array_push($tpl_plugins, $tpl_plugin);
}
@@ -173,6 +179,7 @@ usort($tpl_plugins, 'cmp');
$template->assign(array(
'plugin_display' => $plugin_display,
'plugins' => $tpl_plugins,
+ 'active_plugins' => $active_plugins,
'PWG_TOKEN' => $pwg_token,
));
diff --git a/admin/themes/default/template/plugins_installed.tpl b/admin/themes/default/template/plugins_installed.tpl
index 036a568ef..5e3b451db 100644
--- a/admin/themes/default/template/plugins_installed.tpl
+++ b/admin/themes/default/template/plugins_installed.tpl
@@ -102,12 +102,12 @@ jQuery(document).ready(function() {
{if isset($plugins)}
-{assign var='field_name' value='null'}
+{assign var='field_name' value='null'} {* <!-- 'counter' for fieldset management --> *}
+{counter start=0 assign=i} {* <!-- counter for 'deactivate all' link --> *}
{foreach from=$plugins item=plugin name=plugins_loop}
{if $field_name != $plugin.STATE}
{if $field_name != 'null'}
- {if $field_name == 'active'}<div class="deactivate_all"><a>{'Deactivate all'|@translate}</a></div>{/if}
</fieldset>
{/if}
@@ -125,6 +125,8 @@ jQuery(document).ready(function() {
</legend>
{assign var='field_name' value=$plugin.STATE}
{/if}
+
+ {if $plugin.STATE == 'active'}{counter}{/if}
{if not empty($plugin.AUTHOR)}
{if not empty($plugin.AUTHOR_URL)}
@@ -147,14 +149,14 @@ jQuery(document).ready(function() {
<td>
{if $plugin.STATE == 'active'}
<a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
- | <a href="{$plugin.U_ACTION}&amp;action=restore" class="plugin-restore" title="{'Restore default configuration. You will lost your plugin settings!'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Restore'|@translate}</a>
+ | <a href="{$plugin.U_ACTION}&amp;action=restore" class="plugin-restore" title="{'Restore default configuration. You will lost your plugin settings!'|@translate}" onclick="return confirm(confirmMsg);">{'Restore'|@translate}</a>
{elseif $plugin.STATE == 'inactive'}
<a href="{$plugin.U_ACTION}&amp;action=activate" class="activate">{'Activate'|@translate}</a>
- | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
+ | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm(confirmMsg);">{'Delete'|@translate}</a>
{elseif $plugin.STATE == 'missing'}
- <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
+ <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm(confirmMsg);">{'Uninstall'|@translate}</a>
{elseif $plugin.STATE == 'merged'}
<a href="{$plugin.U_ACTION}&amp;action=delete">{'Delete'|@translate}</a>
@@ -178,7 +180,7 @@ jQuery(document).ready(function() {
{elseif $plugin_display == 'compact'}
{if not empty($plugin.VISIT_URL)}
{assign var='version' value="<a class='externalLink' href='"|cat:$plugin.VISIT_URL|cat:"'>"|cat:$plugin.VERSION|cat:"</a>"}
- {else
+ {else}
{assign var='version' value=$plugin.VERSION}
{/if}
@@ -191,14 +193,14 @@ jQuery(document).ready(function() {
<div>
{if $plugin.STATE == 'active'}
<a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
- | <a href="{$plugin.U_ACTION}&amp;action=restore" class="plugin-restore" title="{'Restore default configuration. You will lost all your settings !'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Restore'|@translate}</a>
+ | <a href="{$plugin.U_ACTION}&amp;action=restore" class="plugin-restore" title="{'Restore default configuration. You will lost all your settings !'|@translate}" onclick="return confirm(confirmMsg);">{'Restore'|@translate}</a>
{elseif $plugin.STATE == 'inactive'}
<a href="{$plugin.U_ACTION}&amp;action=activate" class="activate">{'Activate'|@translate}</a>
- | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
+ | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm(confirmMsg);">{'Delete'|@translate}</a>
{elseif $plugin.STATE == 'missing'}
- <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
+ <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm(confirmMsg);">{'Uninstall'|@translate}</a>
{elseif $plugin.STATE == 'merged'}
<a href="{$plugin.U_ACTION}&amp;action=delete">{'Delete'|@translate}</a>
@@ -209,6 +211,11 @@ jQuery(document).ready(function() {
{/if}
+ {if $active_plugins == $i}
+ <div class="deactivate_all"><a>{'Deactivate all'|@translate}</a></div>
+ {counter}
+ {/if}
+
{/foreach}
</fieldset>