Index: /trunk/admin/plugins_installed.php
===================================================================
--- /trunk/admin/plugins_installed.php	(revision 11226)
+++ /trunk/admin/plugins_installed.php	(revision 11227)
@@ -87,4 +87,5 @@
 $merged_plugins = false;
 $tpl_plugins = array();
+$active_plugins = 0;
 
 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
@@ -123,4 +124,9 @@
     $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++;
   }
 
@@ -174,4 +180,5 @@
   'plugin_display' => $plugin_display,
   'plugins' => $tpl_plugins,
+  'active_plugins' => $active_plugins,
   'PWG_TOKEN' => $pwg_token,
 ));
Index: /trunk/admin/themes/default/template/plugins_installed.tpl
===================================================================
--- /trunk/admin/themes/default/template/plugins_installed.tpl	(revision 11226)
+++ /trunk/admin/themes/default/template/plugins_installed.tpl	(revision 11227)
@@ -103,10 +103,10 @@
 {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}
@@ -126,4 +126,6 @@
   {assign var='field_name' value=$plugin.STATE}
 {/if}
+  
+  {if $plugin.STATE == 'active'}{counter}{/if}
 
   {if not empty($plugin.AUTHOR)}
@@ -148,12 +150,12 @@
           {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'}
@@ -179,5 +181,5 @@
     {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}
@@ -192,12 +194,12 @@
         {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'}
@@ -210,4 +212,9 @@
   {/if}
   
+  {if $active_plugins == $i}
+    <div class="deactivate_all"><a>{'Deactivate all'|@translate}</a></div>
+    {counter}
+  {/if}
+  
 {/foreach}
   </fieldset>
