Changeset 5474


Ignore:
Timestamp:
03/30/10 15:27:18 (10 years ago)
Author:
plg
Message:

feature 1557: new design for plugin list management, 1 block = 1 status.
No icon.

Location:
trunk/admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/plugins_list.php

    r5367 r5474  
    5959//---------------------------------------------------------------Order options 
    6060$link = get_root_url().'admin.php?page='.$page['page'].'&order='; 
    61 $template->assign('order_options', 
     61 
     62$template->assign( 
     63  'order_options', 
    6264  array( 
    6365    $link.'name' => l10n('Name'), 
    6466    $link.'status' => l10n('Status'), 
    6567    $link.'author' => l10n('Author'), 
    66     $link.'id' => 'Id')); 
     68    $link.'id' => 'Id') 
     69  ); 
     70 
    6771$template->assign('order_selected', $link.$order); 
    6872 
     
    7074// |                     start template output                             | 
    7175// +-----------------------------------------------------------------------+ 
     76 
    7277$plugins->sort_fs_plugins($order); 
    7378 
    7479foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) 
    7580{ 
    76   $display_name = $fs_plugin['name']; 
    77   if (!empty($fs_plugin['uri'])) 
    78   { 
    79     $display_name = '<a href="' . $fs_plugin['uri'] 
    80                     . '" onclick="window.open(this.href); return false;">' 
    81                     . $display_name . '</a>'; 
    82   } 
    83   $desc = $fs_plugin['description']; 
    84   if (!empty($fs_plugin['author'])) 
    85   { 
    86     $desc .= ' (<em>'; 
    87     if (!empty($fs_plugin['author uri'])) 
    88     { 
    89       $desc .= '<a href="' . $fs_plugin['author uri'] . '">' 
    90                . $fs_plugin['author'] . '</a>'; 
    91     } 
    92     else 
    93     { 
    94       $desc .= $fs_plugin['author']; 
    95     } 
    96     $desc .= '</em>)'; 
    97   } 
    98   $tpl_plugin = 
    99     array('NAME' => $display_name, 
    100           'VERSION' => $fs_plugin['version'], 
    101           'DESCRIPTION' => $desc, 
    102           'U_ACTION' => sprintf($action_url, $plugin_id)); 
     81  $tpl_plugin = array( 
     82    'NAME' => $fs_plugin['name'], 
     83    'VISIT_URL' => $fs_plugin['uri'], 
     84    'VERSION' => $fs_plugin['version'], 
     85    'DESC' => $fs_plugin['description'], 
     86    'AUTHOR' => $fs_plugin['author'], 
     87    'AUTHOR_URL' => $fs_plugin['author uri'], 
     88    'U_ACTION' => sprintf($action_url, $plugin_id) 
     89    ); 
    10390 
    10491  if (isset($plugins->db_plugins_by_id[$plugin_id])) 
     
    11097    $tpl_plugin['STATE'] = 'uninstalled'; 
    11198  } 
     99 
    112100  $template->append('plugins', $tpl_plugin); 
    113101} 
    114102 
    115103$missing_plugin_ids = array_diff( 
    116     array_keys($plugins->db_plugins_by_id), array_keys($plugins->fs_plugins) 
    117     ); 
     104  array_keys($plugins->db_plugins_by_id), 
     105  array_keys($plugins->fs_plugins) 
     106  ); 
    118107 
    119108foreach($missing_plugin_ids as $plugin_id) 
    120109{ 
    121   $template->append( 'plugins', 
    122       array( 
    123         'NAME' => $plugin_id, 
    124         'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], 
    125         'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !", 
    126         'U_ACTION' => sprintf($action_url, $plugin_id), 
    127         'STATE' => 'missing' 
     110  $template->append( 
     111    'plugins', 
     112    array( 
     113      'NAME' => $plugin_id, 
     114      'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], 
     115      'DESC' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !", 
     116      'U_ACTION' => sprintf($action_url, $plugin_id), 
     117      'STATE' => 'missing', 
    128118      ) 
    129119    ); 
    130120} 
    131121 
     122$template->append('plugin_states', 'active'); 
     123$template->append('plugin_states', 'inactive'); 
     124$template->append('plugin_states', 'uninstalled'); 
     125 
     126if (count($missing_plugin_ids) > 0) 
     127{ 
     128  $template->append('plugin_states', 'missing'); 
     129} 
     130   
    132131$template->assign_var_from_handle('ADMIN_CONTENT', 'plugins'); 
    133132?> 
  • trunk/admin/themes/clear/theme.css

    r5463 r5474  
    234234#pwgHead A, #footer A {color:#444;} 
    235235#pwgHead A:hover, #footer A:hover {color:black; border-color:black;} 
     236 
     237.pluginBox {background-color:#ddd;color:#333} 
     238.pluginBoxNameCell {font-weight:bold;} 
  • trunk/admin/themes/default/default-layout.css

    r5446 r5474  
    804804.checkActions {text-align:left;padding:0;margin:0;} 
    805805.comment A:hover {border:none;} 
     806 
     807.pluginBox {margin-bottom:10px;-moz-border-radius:5px;} 
     808.pluginBox table {width:99%} 
     809.pluginBox td {text-align:left;} 
     810.pluginBoxNameCell {width:150px; vertical-align:top;} 
  • trunk/admin/themes/default/template/footer.tpl

    r5284 r5474  
    5252    }); 
    5353  }); 
     54 
     55  $(document).ready(function() { 
     56    $("a.externalLink").click(function() { 
     57      window.open($(this).attr("href")); 
     58      return false; 
     59    }); 
     60  }); 
    5461</script> 
    5562{/literal} 
  • trunk/admin/themes/default/template/plugins_list.tpl

    r5178 r5474  
    99</div> 
    1010 
     11{if isset($plugins)} 
    1112 
    12 {if isset($plugins)} 
    13 <table class="table2 plugins"> 
    14 <thead> 
    15   <tr class="throw"> 
    16     <td>{'Name'|@translate}</td> 
    17     <td>{'Actions'|@translate}</td> 
    18     <td>{'Version'|@translate}</td> 
    19     <td>{'Description'|@translate}</td> 
    20   </tr> 
    21 </thead> 
     13{foreach from=$plugin_states item=plugin_state} 
     14<fieldset> 
     15  <legend> 
     16  {if $plugin_state == 'active'} 
     17  Active Plugins 
    2218 
    23 {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 $plugin.STATE != 'uninstalled'} {$plugin.STATE}{/if}"> 
    26     {$plugin.NAME} 
    27   </td> 
    28   <td> 
    29     <ul class="pluginsActions"> 
     19  {elseif $plugin_state == 'inactive'} 
     20  Inactive Plugins 
     21 
     22  {elseif $plugin_state == 'uninstalled'} 
     23  Uninstalled Plugins 
     24 
     25  {elseif $plugin_state == 'missing'} 
     26  Missing Plugins 
     27 
     28  {/if} 
     29  </legend> 
     30  {foreach from=$plugins item=plugin name=plugins_loop} 
     31    {if $plugin.STATE == $plugin_state} 
     32  <div class="pluginBox"> 
     33    <table> 
     34      <tr> 
     35        <td class="pluginBoxNameCell">{$plugin.NAME}</td> 
     36        <td>{$plugin.DESC}</td> 
     37      </tr> 
     38      <tr> 
     39        <td> 
    3040    {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> 
     41          <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a> 
     42 
     43    {elseif $plugin_state == 'inactive'} 
     44          <a href="{$plugin.U_ACTION}&amp;action=activate">{'Activate'|@translate}</a> 
     45          | <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a> 
     46 
     47    {elseif $plugin_state == 'uninstalled'} 
     48          <a href="{$plugin.U_ACTION}&amp;action=install">{'Install'|@translate}</a> 
     49          | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure you want to delete this plugin?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a> 
     50 
     51    {elseif $plugin_state == 'missing'} 
     52          <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a> 
     53 
    3954    {/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       <li> 
    47         <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');"> 
    48           <img src="{$themeconf.admin_icon_dir}/plug_uninstall.png" alt="{'Uninstall'|@translate}" title="{'Uninstall'|@translate}"> 
    49         </a> 
    50       </li> 
     55        </td> 
     56        <td> 
     57          Version {$plugin.VERSION} 
     58    {if not empty($plugin.AUTHOR)} 
     59          | By  
     60      {if not empty($plugin.AUTHOR_URL)} 
     61          <a href="{$plugin.AUTHOR_URL}">{$plugin.AUTHOR}</a> 
     62      {else} 
     63          {$plugin.AUTHOR} 
     64      {/if} 
    5165    {/if} 
    52     {if $plugin.STATE == 'missing'} 
    53       <li> 
    54           <img src="{$themeconf.admin_icon_dir}/plug_deactivate_grey.png" alt="{'Deactivate'|@translate}" title="{'Deactivate'|@translate}"> 
    55       </li> 
    56       <li> 
    57         <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');"> 
    58           <img src="{$themeconf.admin_icon_dir}/plug_uninstall.png" alt="{'Uninstall'|@translate}" title="{'Uninstall'|@translate}"> 
    59         </a> 
    60       </li> 
     66 
     67    {if not empty($plugin.VISIT_URL)} 
     68          | <a class="externalLink" href="{$plugin.VISIT_URL}">Visit plugin site</a> 
    6169    {/if} 
    62     {if $plugin.STATE == 'uninstalled'} 
    63       <li> 
    64           <img src="{$themeconf.admin_icon_dir}/plug_activate_grey.png" alt="{'Activate'|@translate}" title="{'Activate'|@translate}"> 
    65       </li> 
    66       <li> 
    67         <a href="{$plugin.U_ACTION}&amp;action=install" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');"> 
    68           <img src="{$themeconf.admin_icon_dir}/plug_install.png" alt="{'Install'|@translate}" title="{'Install'|@translate}"> 
    69         </a> 
    70       </li> 
    71       <li> 
    72         <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure you want to delete this plugin?'|@translate|@escape:'javascript'}');"> 
    73           <img src="{$themeconf.admin_icon_dir}/plug_delete.png" alt="{'Delete'|@translate}" title="{'Delete'|@translate}"> 
    74         </a> 
    75       </li> 
    76     {else} 
    77       <li> 
    78         <img src="{$themeconf.admin_icon_dir}/plug_delete_grey.png" alt="{'Delete'|@translate}" title="{'Delete'|@translate}"> 
    79       </li> 
     70        </td> 
     71      </tr> 
     72    </table> 
     73  </div> 
    8074    {/if} 
    81     </ul> 
    82   </td> 
    83   <td style="text-align:center;">{$plugin.VERSION}</td> 
    84   <td>{$plugin.DESCRIPTION}</td> 
    85   </tr> 
     75  {/foreach} 
     76</fieldset> 
    8677{/foreach} 
    87 </table> 
     78 
    8879{/if} 
  • trunk/admin/themes/roma/theme.css

    r5463 r5474  
    240240 
    241241#pwgHead, #footer {background-color:#222;} 
     242 
     243.pluginBox {background-color:#333;color:#999} 
     244.pluginBoxNameCell {color:#ccc;} 
Note: See TracChangeset for help on using the changeset viewer.