Changeset 5496


Ignore:
Timestamp:
Mar 31, 2010, 3:10:09 PM (11 years ago)
Author:
plg
Message:

feature 1535: apply the plugin/theme managers look&feel to language manager.

Location:
trunk/admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/languages_installed.php

    r5371 r5496  
    5353$default_language = get_default_language();
    5454
     55$tpl_languages = array();
     56
    5557foreach($languages->fs_languages as $language_id => $language_name)
    5658{
    57   $template->append('languages', array(
    58     'ID' => $language_id,
    59     'NAME' => $language_name,
    60     'U_ACTION' => $base_url.'&language='.$language_id,
    61     'STATE' => isset($languages->db_languages[$language_id]) ? 'active' : '',
    62     'IS_DEFAULT' => $language_id == $default_language,
     59  $language = array(
     60    'id' => $language_id,
     61    'name' => $language_name,
     62    'u_action' => $base_url.'&language='.$language_id,
     63    );
     64
     65  if (in_array($language_id, array_keys($languages->db_languages)))
     66  {
     67    $language['state'] = 'active';
     68    $language['deactivable'] = true;
     69   
     70    if (count($languages->db_languages) <= 1)
     71    {
     72      $language['deactivable'] = false;
     73      $language['deactivate_tooltip'] = l10n('Impossible to deactivate this language, you need at least one language.');
     74    }
     75
     76    if ($language_id == $default_language)
     77    {
     78      $language['deactivable'] = false;
     79      $language['deactivate_tooltip'] = l10n('Impossible to deactivate this language, first set another language as default.');
     80    }
     81  }
     82  else
     83  {
     84    $language['state'] = 'inactive';
     85  }
     86 
     87  if ($language_id == $default_language)
     88  {
     89    $language['is_default'] = true;
     90    array_unshift($tpl_languages, $language);
     91  }
     92  else
     93  {
     94    array_push($tpl_languages, $language);
     95  }
     96}
     97
     98$template->assign(
     99  array(
     100    'languages' => $tpl_languages,
    63101    )
    64102  );
    65 }
     103$template->append('language_states', 'active');
     104$template->append('language_states', 'inactive');
    66105
    67106
  • trunk/admin/themes/clear/theme.css

    r5474 r5496  
    237237.pluginBox {background-color:#ddd;color:#333}
    238238.pluginBoxNameCell {font-weight:bold;}
     239
     240.languageBox {background-color:#ddd;}
     241.languageName {color:black;}
     242.languageDefault {background-color:#dbe8f3;}
  • trunk/admin/themes/default/default-layout.css

    r5474 r5496  
    809809.pluginBox td {text-align:left;}
    810810.pluginBoxNameCell {width:150px; vertical-align:top;}
     811
     812.languageBoxes {min-height:0;text-align:left;}
     813.languageBox {display:inline-table; text-align:center; width:200px; height:40px; margin:5px; -moz-border-radius:5px; overflow:hidden; }
     814.languageName {font-size:1.1em; margin:5px 0;}
     815.languageActions {display: table-row; font-size:12px; }
     816.languageActions DIV {display: table-cell; vertical-align: middle; line-height:18px; }
  • trunk/admin/themes/default/template/footer.tpl

    r5493 r5496  
    4646<script type='text/javascript'>
    4747  $(function() {
    48     $('#pwgHead A, #footer A, .themeActions A, .themeActions SPAN').tipTip({
     48    $('#pwgHead A, #footer A, .themeActions A, .themeActions SPAN, .languageActions A, .languageActions SPAN').tipTip({
    4949        'delay' : 0,
    5050        'fadeIn' : 200,
  • trunk/admin/themes/default/template/languages_installed.tpl

    r5371 r5496  
    33</div>
    44
    5 <table class="table2 languages">
    6 <thead>
    7   <tr class="throw">
    8     <td>{'Language'|@translate}</td>
    9     <td>{'Actions'|@translate}</td>
    10   </tr>
    11 </thead>
     5{foreach from=$language_states item=language_state}
     6<fieldset>
     7  <legend>
     8  {if $language_state == 'active'}
     9  {'Active Languages'|@translate}
    1210
    13 {foreach from=$languages item=language name=languages_loop}
    14   <tr class="{if $smarty.foreach.languages_loop.index is odd}row1{else}row2{/if}">
    15     <td class="{$language.STATE}">
    16       {$language.NAME}
    17       {if $language.IS_DEFAULT}<i>({'Default'|@translate})</i>{/if}
    18     </td>
    19     <td style="text-align: center;">
    20     {if !$language.IS_DEFAULT}
    21       {if $language.STATE == 'active' or $language.STATE == 'missing'}
    22         <a href="{$language.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a> |
    23         <a href="{$language.U_ACTION}&amp;action=set_default">{'Default'|@translate}</a>
    24       {else}
    25         <a href="{$language.U_ACTION}&amp;action=activate">{'Activate'|@translate}</a> |
    26         <a href="{$language.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
     11  {elseif $language_state == 'inactive'}
     12  {'Inactive Languages'|@translate}
     13
     14  {/if}
     15  </legend>
     16  <div class="languageBoxes">
     17  {foreach from=$languages item=language}
     18    {if $language.state == $language_state}
     19  <div class="languageBox{if $language.is_default} languageDefault{/if}">
     20    <div class="languageName">{$language.name}{if $language.is_default} <em>({'default'|@translate})</em>{/if}</div>
     21    <div class="languageActions">
     22      <div>
     23      {if $language_state == 'active'}
     24        {if $language.deactivable}
     25      <a href="{$language.u_action}&amp;action=deactivate" title="{'Forbid this language to users'|@translate}">{'Deactivate'|@translate}</a>
     26        {else}
     27      <span title="{$language.deactivate_tooltip}">{'Deactivate'|@translate}</span>
     28        {/if}
     29
     30        {if not $language.is_default}
     31      | <a href="{$language.u_action}&amp;action=set_default" title="{'Set as default language for unregistered and new users'|@translate}">{'Default'|@translate}</a>
     32        {/if}
    2733      {/if}
    28     {else}
    29       ---
     34
     35      {if $language_state == 'inactive'}
     36      <a href="{$language.u_action}&amp;action=activate" title="{'Make this language available to users'|@translate}">{'Activate'|@translate}</a>
     37      | <a href="{$language.u_action}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this language'|@translate}">{'Delete'|@translate}</a>
     38      {/if}
     39      </div>
     40    </div> <!-- languageActions -->
     41  </div> <!-- languageBox -->
    3042    {/if}
    31     </td>
    32   </tr>
     43  {/foreach}
     44  </div> <!-- languageBoxes -->
     45</fieldset>
    3346{/foreach}
    34 </table>
  • trunk/admin/themes/roma/theme.css

    r5474 r5496  
    231231.themeBox {background-color:#333;}
    232232.themeBox IMG {border:1px solid #666;}
    233 .themeName {color:white;}
     233.themeName {color:#ccc;}
    234234.themeActions A {border-bottom:none;}
    235235.themeDefault {background-color:#555;}
     
    243243.pluginBox {background-color:#333;color:#999}
    244244.pluginBoxNameCell {color:#ccc;}
     245
     246.languageBox {background-color:#333;}
     247.languageName {color:#ccc;}
     248.languageDefault {background-color:#555; color:#aaa;}
Note: See TracChangeset for help on using the changeset viewer.