Add icons for plugins actions.

git-svn-id: http://piwigo.org/svn/trunk@2631 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
patdenice 2008-10-01 12:31:22 +00:00
parent af4b55f392
commit 7eb7d37527
15 changed files with 86 additions and 62 deletions

View file

@ -89,42 +89,16 @@ foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
$tpl_plugin =
array('NAME' => $display_name,
'VERSION' => $fs_plugin['version'],
'DESCRIPTION' => $desc);
$action_url = $base_url.'&plugin='.$plugin_id;
'DESCRIPTION' => $desc,
'U_ACTION' => $base_url.'&plugin='.$plugin_id);
if (isset($plugins->db_plugins_by_id[$plugin_id]))
{
$tpl_plugin['STATE'] = $plugins->db_plugins_by_id[$plugin_id]['state'];
switch ($plugins->db_plugins_by_id[$plugin_id]['state'])
{
case 'active':
$tpl_plugin['actions'][] =
array('U_ACTION' => $action_url . '&action=deactivate',
'L_ACTION' => l10n('Deactivate'));
break;
case 'inactive':
$tpl_plugin['actions'][] =
array('U_ACTION' => $action_url . '&action=activate',
'L_ACTION' => l10n('Activate'));
$tpl_plugin['actions'][] =
array('U_ACTION' => $action_url . '&action=uninstall',
'L_ACTION' => l10n('Uninstall'),
'CONFIRM' => l10n('Are you sure?'));
break;
}
}
else
{
$tpl_plugin['actions'][] =
array('U_ACTION' => $action_url . '&action=install',
'L_ACTION' => l10n('Install'),
'CONFIRM' => l10n('Are you sure?'));
$tpl_plugin['actions'][] =
array('U_ACTION' => $action_url . '&action=delete',
'L_ACTION' => l10n('plugins_delete'),
'CONFIRM' => l10n('plugins_confirm_delete'));
$tpl_plugin['STATE'] = 'uninstalled';
}
$template->append('plugins', $tpl_plugin);
}
@ -142,12 +116,10 @@ foreach($missing_plugin_ids as $plugin_id)
'NAME' => $plugin_id,
'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'],
'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !",
'actions' => array ( array (
'U_ACTION' => $action_url . '&action=uninstall',
'L_ACTION' => l10n('Uninstall'),
) )
)
);
'U_ACTION' => $base_url.'&plugin='.$plugin_id,
'STATE' => 'missing'
)
);
}
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugins');

View file

@ -40,20 +40,31 @@ TABLE#detailedStats {
}
/* Plugins tables */
TABLE.table2 TR TD.pluginState {
padding-left: 16px;
}
TABLE.plugins a { border: 0; }
TABLE.plugins TR TD { padding: 4px 10px; }
TABLE.plugins TR TD.pluginState { padding: 4px 16px; }
TABLE.table2 TR TD.active {
TABLE.plugins TR TD.active {
background: url(icon/plugin_active.gif) no-repeat center left;
background-color: inherit; /* IE need it */
}
TABLE.table2 TR TD.inactive {
TABLE.plugins TR TD.inactive {
background: url(icon/plugin_inactive.gif) no-repeat center left;
background-color: inherit; /* IE need it */
}
TABLE.plugins ul.pluginsActions {
float: left;
padding: 0;
margin: 0;
width: 60px;
list-style: none;
text-align: center;
}
TABLE.plugins ul.pluginsActions li { display: inline; }
/* categoryOrdering */
SELECT.categoryList {
width: 100%;

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

View file

@ -10,30 +10,70 @@
{if isset($plugins)}
<table class="table2">
<table class="table2 plugins">
<thead>
<tr class="throw">
<td>{'Name'|@translate}</td>
<td>{'Actions'|@translate}</td>
<td>{'Version'|@translate}</td>
<td>{'Description'|@translate}</td>
<td>{'Actions'|@translate}</td>
</tr>
</thead>
{foreach from=$plugins item=plugin name=plugins_loop}
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
<td class="pluginState{if not empty($plugin.STATE)} {$plugin.STATE}{/if}">
{$plugin.NAME}
</td>
<td>{$plugin.VERSION}</td>
<td>{$plugin.DESCRIPTION}</td>
<td>
{foreach from=$plugin.actions item=action}
<a href="{$action.U_ACTION}"
{if isset($action.CONFIRM)} onclick="return confirm('{$action.CONFIRM|@escape:'javascript'}');"{/if}
{$TAG_INPUT_ENABLED}>{$action.L_ACTION}</a>
{/foreach}
</td>
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
<td class="pluginState{if $plugin.STATE != 'uninstalled'} {$plugin.STATE}{/if}">
{$plugin.NAME}
</td>
<td>
<ul class="pluginsActions">
{if $plugin.STATE == 'active'}
<li>
<a href="{$plugin.U_ACTION}&amp;action=deactivate">
<img src="{$themeconf.admin_icon_dir}/plug_deactivate.png" alt="{'Deactivate'|@translate}" title="{'Deactivate'|@translate}" />
</a>
</li>
<li>
<img src="{$themeconf.admin_icon_dir}/plug_uninstall_grey.png" alt="{'Uninstall'|@translate}" title="{'Uninstall'|@translate}" />
</li>
{/if}
{if $plugin.STATE == 'inactive'}
<li>
<a href="{$plugin.U_ACTION}&amp;action=activate">
<img src="{$themeconf.admin_icon_dir}/plug_activate.png" alt="{'Activate'|@translate}" title="{'Activate'|@translate}" />
</a>
</li>
{/if}
{if $plugin.STATE == 'inactive' or $plugin.STATE == 'missing'}
<li>
<a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
<img src="{$themeconf.admin_icon_dir}/plug_uninstall.png" alt="{'Uninstall'|@translate}" title="{'Uninstall'|@translate}" />
</a>
</li>
{/if}
{if $plugin.STATE == 'uninstalled'}
<li>
<img src="{$themeconf.admin_icon_dir}/plug_activate_grey.png" alt="{'Activate'|@translate}" title="{'Activate'|@translate}" />
</li>
<li>
<a href="{$plugin.U_ACTION}&amp;action=install" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
<img src="{$themeconf.admin_icon_dir}/plug_install.png" alt="{'Install'|@translate}" title="{'Install'|@translate}"/>
</a>
</li>
<li>
<a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'plugins_confirm_delete'|@translate|@escape:'javascript'}');">
<img src="{$themeconf.admin_icon_dir}/plug_delete.png" alt="{'plugins_delete'|@translate}" title="{'plugins_delete'|@translate}">
</a>
</li>
{elseif $plugin.STATE != 'missing'}
<li>
<img src="{$themeconf.admin_icon_dir}/plug_delete_grey.png" alt="{'plugins_delete'|@translate}" title="{'plugins_delete'|@translate}" />
</li>
{/if}
</ul>
</td>
<td style="text-align:center;">{$plugin.VERSION}</td>
<td>{$plugin.DESCRIPTION}</td>
</tr>
{/foreach}
</table>

View file

@ -12,17 +12,18 @@ jQuery().ready(function(){ldelim}
</script>
<div class="titrePage">
<h2>{'Plugins'|@translate}</h2>
</div>
<span class="sort">
{'Sort order'|@translate} :
<select onchange="document.location = this.options[this.selectedIndex].value;" style="width:150px">
{html_options options=$order_options selected=$order_selected}
</select>
</span>
<h2>{'Plugins'|@translate}</h2>
</div>
{if isset($plugins)}
<br>
<table class="table2">
<table class="table2 plugins">
<thead>
<tr class="throw">
<td>{'Name'|@translate}</td>

View file

@ -18,7 +18,7 @@ jQuery().ready(function(){ldelim}
{if isset($plugins_not_uptodate)}
<br>
<b>{'plugins_need_update'|@translate}</b>
<table class="table2">
<table class="table2 plugins">
<thead>
<tr class="throw">
<td>{'Name'|@translate}</td>
@ -43,7 +43,7 @@ jQuery().ready(function(){ldelim}
{if isset($plugins_uptodate)}
<br>
<b>{'plugins_dontneed_update'|@translate}</b>
<table class="table2">
<table class="table2 plugins">
<thead>
<tr class="throw">
<td>{'Name'|@translate}</td>
@ -63,7 +63,7 @@ jQuery().ready(function(){ldelim}
{if isset($plugins_cant_check)}
<br>
<b>{'plugins_cant_check'|@translate}</b>
<table class="table2">
<table class="table2 plugins">
<thead>
<tr class="throw">
<td>{'Name'|@translate}</td>