Changeset 2631 for trunk/admin


Ignore:
Timestamp:
Oct 1, 2008, 2:31:22 PM (16 years ago)
Author:
patdenice
Message:

Add icons for plugins actions.

Location:
trunk/admin
Files:
10 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/plugins_list.php

    r2530 r2631  
    9090    array('NAME' => $display_name,
    9191          'VERSION' => $fs_plugin['version'],
    92           'DESCRIPTION' => $desc);
    93 
    94   $action_url = $base_url.'&plugin='.$plugin_id;
     92          'DESCRIPTION' => $desc,
     93          'U_ACTION' => $base_url.'&plugin='.$plugin_id);
    9594
    9695  if (isset($plugins->db_plugins_by_id[$plugin_id]))
    9796  {
    9897    $tpl_plugin['STATE'] = $plugins->db_plugins_by_id[$plugin_id]['state'];
    99     switch ($plugins->db_plugins_by_id[$plugin_id]['state'])
    100     {
    101       case 'active':
    102         $tpl_plugin['actions'][] =
    103             array('U_ACTION' => $action_url . '&action=deactivate',
    104                   'L_ACTION' => l10n('Deactivate'));
    105         break;
    106 
    107       case 'inactive':
    108         $tpl_plugin['actions'][] =
    109             array('U_ACTION' => $action_url . '&action=activate',
    110                   'L_ACTION' => l10n('Activate'));
    111         $tpl_plugin['actions'][] =
    112             array('U_ACTION' => $action_url . '&action=uninstall',
    113                   'L_ACTION' => l10n('Uninstall'),
    114                   'CONFIRM' => l10n('Are you sure?'));
    115         break;
    116     }
    11798  }
    11899  else
    119100  {
    120     $tpl_plugin['actions'][] =
    121         array('U_ACTION' => $action_url . '&action=install',
    122               'L_ACTION' => l10n('Install'),
    123               'CONFIRM' => l10n('Are you sure?'));
    124     $tpl_plugin['actions'][] =
    125         array('U_ACTION' => $action_url . '&action=delete',
    126               'L_ACTION' => l10n('plugins_delete'),
    127               'CONFIRM' => l10n('plugins_confirm_delete'));
     101    $tpl_plugin['STATE'] = 'uninstalled';
    128102  }
    129103  $template->append('plugins', $tpl_plugin);
     
    143117        'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'],
    144118        'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !",
    145         'actions' => array ( array (
    146               'U_ACTION' => $action_url . '&action=uninstall',
    147               'L_ACTION' => l10n('Uninstall'),
    148           ) )
    149         )
    150      );
     119        'U_ACTION' => $base_url.'&plugin='.$plugin_id,
     120        'STATE' => 'missing'
     121      )
     122    );
    151123}
    152124
  • trunk/admin/template/goto/default-layout.css

    r2619 r2631  
    4141
    4242/* Plugins tables */
    43 TABLE.table2 TR TD.pluginState {
    44   padding-left: 16px;
    45 }
    46 
    47 TABLE.table2 TR TD.active {
     43TABLE.plugins a { border: 0; }
     44TABLE.plugins TR TD { padding: 4px 10px; }
     45TABLE.plugins TR TD.pluginState { padding: 4px 16px; }
     46
     47TABLE.plugins TR TD.active {
    4848  background: url(icon/plugin_active.gif) no-repeat center left;
    4949  background-color: inherit; /* IE need it */
    5050}
    5151
    52 TABLE.table2 TR TD.inactive {
     52TABLE.plugins TR TD.inactive {
    5353  background: url(icon/plugin_inactive.gif) no-repeat center left;
    5454  background-color: inherit; /* IE need it */
    5555}
     56
     57TABLE.plugins ul.pluginsActions {
     58  float: left;
     59  padding: 0;
     60  margin: 0;
     61  width: 60px;
     62  list-style: none;
     63  text-align: center;
     64}
     65
     66TABLE.plugins ul.pluginsActions li { display: inline; }
    5667
    5768/* categoryOrdering */
  • trunk/admin/template/goto/plugins_list.tpl

    r2619 r2631  
    1111
    1212{if isset($plugins)}
    13 <table class="table2">
     13<table class="table2 plugins">
    1414<thead>
    1515  <tr class="throw">
    1616    <td>{'Name'|@translate}</td>
     17    <td>{'Actions'|@translate}</td>
    1718    <td>{'Version'|@translate}</td>
    1819    <td>{'Description'|@translate}</td>
    19     <td>{'Actions'|@translate}</td>
    2020  </tr>
    2121</thead>
    2222
    2323{foreach from=$plugins item=plugin name=plugins_loop}
    24         <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
    25         <td class="pluginState{if not empty($plugin.STATE)} {$plugin.STATE}{/if}">
    26                 {$plugin.NAME}
    27         </td>
    28         <td>{$plugin.VERSION}</td>
    29         <td>{$plugin.DESCRIPTION}</td>
    30         <td>
    31         {foreach from=$plugin.actions item=action}
    32                 <a href="{$action.U_ACTION}"
    33                 {if isset($action.CONFIRM)} onclick="return confirm('{$action.CONFIRM|@escape:'javascript'}');"{/if}
    34                 {$TAG_INPUT_ENABLED}>{$action.L_ACTION}</a>
    35         {/foreach}
    36         </td>
     24  <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
     25  <td class="pluginState{if $plugin.STATE != 'uninstalled'} {$plugin.STATE}{/if}">
     26    {$plugin.NAME}
     27  </td>
     28  <td>
     29    <ul class="pluginsActions">
     30    {if $plugin.STATE == 'active'}
     31      <li>
     32        <a href="{$plugin.U_ACTION}&amp;action=deactivate">
     33          <img src="{$themeconf.admin_icon_dir}/plug_deactivate.png" alt="{'Deactivate'|@translate}" title="{'Deactivate'|@translate}" />
     34        </a>
     35      </li>
     36      <li>
     37          <img src="{$themeconf.admin_icon_dir}/plug_uninstall_grey.png" alt="{'Uninstall'|@translate}" title="{'Uninstall'|@translate}" />
     38      </li>
     39    {/if}
     40    {if $plugin.STATE == 'inactive'}
     41      <li>
     42        <a href="{$plugin.U_ACTION}&amp;action=activate">
     43          <img src="{$themeconf.admin_icon_dir}/plug_activate.png" alt="{'Activate'|@translate}" title="{'Activate'|@translate}" />
     44        </a>
     45      </li>
     46    {/if}
     47    {if $plugin.STATE == 'inactive' or $plugin.STATE == 'missing'}
     48      <li>
     49        <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
     50          <img src="{$themeconf.admin_icon_dir}/plug_uninstall.png" alt="{'Uninstall'|@translate}" title="{'Uninstall'|@translate}" />
     51        </a>
     52      </li>
     53    {/if}
     54    {if $plugin.STATE == 'uninstalled'}
     55      <li>
     56          <img src="{$themeconf.admin_icon_dir}/plug_activate_grey.png" alt="{'Activate'|@translate}" title="{'Activate'|@translate}" />
     57      </li>
     58      <li>
     59        <a href="{$plugin.U_ACTION}&amp;action=install" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
     60          <img src="{$themeconf.admin_icon_dir}/plug_install.png" alt="{'Install'|@translate}" title="{'Install'|@translate}"/>
     61        </a>
     62      </li>
     63      <li>
     64        <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'plugins_confirm_delete'|@translate|@escape:'javascript'}');">
     65          <img src="{$themeconf.admin_icon_dir}/plug_delete.png" alt="{'plugins_delete'|@translate}" title="{'plugins_delete'|@translate}">
     66        </a>
     67      </li>
     68    {elseif $plugin.STATE != 'missing'}
     69      <li>
     70        <img src="{$themeconf.admin_icon_dir}/plug_delete_grey.png" alt="{'plugins_delete'|@translate}" title="{'plugins_delete'|@translate}" />
     71      </li>
     72    {/if}
     73    </ul>
     74  </td>
     75  <td style="text-align:center;">{$plugin.VERSION}</td>
     76  <td>{$plugin.DESCRIPTION}</td>
    3777  </tr>
    3878{/foreach}
  • trunk/admin/template/goto/plugins_new.tpl

    r2591 r2631  
    1313
    1414<div class="titrePage">
    15   <h2>{'Plugins'|@translate}</h2>
    16 </div>
    17 
     15<span class="sort">
    1816{'Sort order'|@translate} :
    1917  <select onchange="document.location = this.options[this.selectedIndex].value;" style="width:150px">
    2018        {html_options options=$order_options selected=$order_selected}
    2119  </select>
     20</span>
     21  <h2>{'Plugins'|@translate}</h2>
     22</div>
    2223
    2324{if isset($plugins)}
    2425<br>
    25 <table class="table2">
     26<table class="table2 plugins">
    2627<thead>
    2728  <tr class="throw">
  • trunk/admin/template/goto/plugins_update.tpl

    r2591 r2631  
    1919<br>
    2020<b>{'plugins_need_update'|@translate}</b>
    21 <table class="table2">
     21<table class="table2 plugins">
    2222<thead>
    2323  <tr class="throw">
     
    4444<br>
    4545<b>{'plugins_dontneed_update'|@translate}</b>
    46 <table class="table2">
     46<table class="table2 plugins">
    4747<thead>
    4848  <tr class="throw">
     
    6464<br>
    6565<b>{'plugins_cant_check'|@translate}</b>
    66 <table class="table2">
     66<table class="table2 plugins">
    6767<thead>
    6868  <tr class="throw">
Note: See TracChangeset for help on using the changeset viewer.