Changeset 11227


Ignore:
Timestamp:
Jun 4, 2011, 11:34:59 AM (10 years ago)
Author:
mistic100
Message:

'Deactivate all' link now visible if all plugins are active

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/plugins_installed.php

    r11048 r11227  
    8787$merged_plugins = false;
    8888$tpl_plugins = array();
     89$active_plugins = 0;
    8990
    9091foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
     
    123124    $tpl_plugin['DESC'] = l10n('THIS PLUGIN IS NOW PART OF PIWIGO CORE! DELETE IT NOW.');
    124125    $merged_plugins = true;
     126  }
     127 
     128  if ($tpl_plugin['STATE'] == 'active')
     129  {
     130    $active_plugins++;
    125131  }
    126132
     
    174180  'plugin_display' => $plugin_display,
    175181  'plugins' => $tpl_plugins,
     182  'active_plugins' => $active_plugins,
    176183  'PWG_TOKEN' => $pwg_token,
    177184));
  • trunk/admin/themes/default/template/plugins_installed.tpl

    r11209 r11227  
    103103{if isset($plugins)}
    104104
    105 {assign var='field_name' value='null'}
     105{assign var='field_name' value='null'} {* <!-- 'counter' for fieldset management --> *}
     106{counter start=0 assign=i} {* <!-- counter for 'deactivate all' link --> *}
    106107{foreach from=$plugins item=plugin name=plugins_loop}
    107108   
    108109{if $field_name != $plugin.STATE}
    109110  {if $field_name != 'null'}
    110     {if $field_name == 'active'}<div class="deactivate_all"><a>{'Deactivate all'|@translate}</a></div>{/if}
    111111  </fieldset>
    112112  {/if}
     
    126126  {assign var='field_name' value=$plugin.STATE}
    127127{/if}
     128 
     129  {if $plugin.STATE == 'active'}{counter}{/if}
    128130
    129131  {if not empty($plugin.AUTHOR)}
     
    148150          {if $plugin.STATE == 'active'}
    149151            <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
    150             | <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>
     152            | <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>
    151153
    152154          {elseif $plugin.STATE == 'inactive'}
    153155            <a href="{$plugin.U_ACTION}&amp;action=activate" class="activate">{'Activate'|@translate}</a>
    154             | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
     156            | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm(confirmMsg);">{'Delete'|@translate}</a>
    155157
    156158          {elseif $plugin.STATE == 'missing'}
    157             <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
     159            <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm(confirmMsg);">{'Uninstall'|@translate}</a>
    158160
    159161          {elseif $plugin.STATE == 'merged'}
     
    179181    {if not empty($plugin.VISIT_URL)}
    180182      {assign var='version' value="<a class='externalLink' href='"|cat:$plugin.VISIT_URL|cat:"'>"|cat:$plugin.VERSION|cat:"</a>"}
    181     {else
     183    {else}
    182184      {assign var='version' value=$plugin.VERSION}
    183185    {/if}
     
    192194        {if $plugin.STATE == 'active'}
    193195          <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
    194           | <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>
     196          | <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>
    195197
    196198        {elseif $plugin.STATE == 'inactive'}
    197199          <a href="{$plugin.U_ACTION}&amp;action=activate" class="activate">{'Activate'|@translate}</a>
    198           | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
     200          | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm(confirmMsg);">{'Delete'|@translate}</a>
    199201
    200202        {elseif $plugin.STATE == 'missing'}
    201           <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
     203          <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm(confirmMsg);">{'Uninstall'|@translate}</a>
    202204
    203205        {elseif $plugin.STATE == 'merged'}
     
    210212  {/if}
    211213 
     214  {if $active_plugins == $i}
     215    <div class="deactivate_all"><a>{'Deactivate all'|@translate}</a></div>
     216    {counter}
     217  {/if}
     218 
    212219{/foreach}
    213220  </fieldset>
Note: See TracChangeset for help on using the changeset viewer.