Changeset 9273


Ignore:
Timestamp:
02/18/11 14:59:37 (9 years ago)
Author:
patdenice
Message:

Add missing language key.
Javascript selector for menu's language.

Location:
extensions/AdditionalPages
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/admin/add_page.inc.php

    r9272 r9273  
    3636    if (!empty($ids)) 
    3737    { 
    38       array_push($page['errors'], sprintf(l10n('Permalink %s is already used by additional page %s'), $permalink, $ids[0])); 
     38      array_push($page['errors'], sprintf(l10n('ap_permalink_already_used'), $permalink, $ids[0])); 
    3939    } 
    4040    $permalink = '"'.$permalink.'"'; 
  • extensions/AdditionalPages/admin/config.inc.php

    r9272 r9273  
    3939 
    4040// Gestion des langues pour le bloc menu 
    41 $template->assign('LANG_DEFAULT_VALUE', @$conf['additional_pages']['languages']['default']); 
     41$template->append('language', array( 
     42  'LANGUAGE_NAME' => l10n('Default'), 
     43  'LANGUAGE_CODE' => 'default', 
     44  'VALUE' => @$conf['additional_pages']['languages']['default'], 
     45  ) 
     46); 
    4247foreach (get_languages() as $language_code => $language_name) 
    4348{ 
  • extensions/AdditionalPages/admin/template/add_page.tpl

    r9270 r9273  
    2222        <table> 
    2323                <tr> 
    24                         <td align="right">{'ap_page_name'|@translate} &nbsp;&nbsp;</td> 
    25                         <td><input type="text" size="60" maxlength="255" value="{if isset($NAME)}{$NAME}{/if}" name="title"/></td> 
     24                        <td align="right"><label for="title">{'ap_page_name'|@translate}</label> &nbsp;&nbsp;</td> 
     25                        <td><input type="text" size="60" maxlength="255" value="{if isset($NAME)}{$NAME}{/if}" name="title" id="title"/></td> 
    2626                </tr> 
    2727                <tr> 
    28                         <td align="right">{'Permalink'|@translate} &nbsp;&nbsp;</td> 
    29                         <td><input type="text" size="60" value="{if isset($PERMALINK)}{$PERMALINK}{/if}" name="permalink"/></td> 
     28                        <td align="right"><label for="permalink">{'Permalink'|@translate}</label> &nbsp;&nbsp;</td> 
     29                        <td><input type="text" size="60" value="{if isset($PERMALINK)}{$PERMALINK}{/if}" name="permalink" id="permalink"/></td> 
    3030                </tr> 
    3131                <tr> 
    32                         <td align="right">{'ap_page_lang'|@translate} &nbsp;&nbsp;</td> 
     32                        <td align="right"><label for="lang">{'ap_page_lang'|@translate}</label> &nbsp;&nbsp;</td> 
    3333                        <td> 
    34         {html_options name=lang options=$lang.OPTIONS selected=$lang.SELECTED} 
     34        {html_options name=lang id=lang options=$lang.OPTIONS selected=$lang.SELECTED} 
    3535                        </td> 
    3636                </tr> 
    3737    <tr><td>&nbsp;</td></tr> 
    3838                <tr> 
    39                         <td align="right">{'ap_set_as_homepage'|@translate} &nbsp;&nbsp;</td> 
    40                         <td><input type="checkbox" name="homepage" {if isset($HOMEPAGE) and $HOMEPAGE}checked="checked"{/if}"/> 
     39                        <td align="right"><label for="homepage">{'ap_set_as_homepage'|@translate}</label> &nbsp;&nbsp;</td> 
     40                        <td><input type="checkbox" name="homepage" id="homepage" {if isset($HOMEPAGE) and $HOMEPAGE}checked="checked"{/if}"/> 
    4141      &nbsp; <i>{'ap_homepage_tip'|@translate}</i></td> 
    4242                </tr> 
    4343                <tr> 
    44                         <td align="right">{'ap_standalone_page'|@translate} &nbsp;&nbsp;</td> 
    45                         <td><input type="checkbox" name="standalone" {if isset($STANDALONE) and $STANDALONE}checked="checked"{/if}"/> 
     44                        <td align="right"><label for="standalone">{'ap_standalone_page'|@translate}</label> &nbsp;&nbsp;</td> 
     45                        <td><input type="checkbox" name="standalone" id="standalone" {if isset($STANDALONE) and $STANDALONE}checked="checked"{/if}"/> 
    4646      &nbsp; <i>{'ap_standalone_tip'|@translate}</i></td> 
    4747                </tr> 
  • extensions/AdditionalPages/admin/template/config.tpl

    r9272 r9273  
    44 
    55<form name="apform" method="post" action="" class="properties"  ENCTYPE="multipart/form-data"> 
    6 <fieldset> 
    7         <legend>{'ap_config'|@translate}</legend> 
    8         <table> 
    9                 <tr> 
    10                         <td colspan="3">{'ap_perm'|@translate}</td> 
    11                 </tr> 
    12                 <tr> 
    13                         <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="user_perm" value="on" {if $ap_conf.user_perm}checked="checked"{/if}/> <i>{'ap_user_perm'|@translate}</i></td> 
    14                 </tr> 
    15                 <tr> 
    16                         <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="group_perm" value="on" {if $ap_conf.group_perm}checked="checked"{/if}/> <i>{'ap_group_perm'|@translate}</i></td> 
    17                 </tr> 
    18     <tr> 
    19                         <td colspan="3"><br><hr><br></td> 
    20                 </tr> 
    21     <tr> 
    22                         <td colspan="3"><input type="checkbox" name="show_home" value="on" {if $ap_conf.show_home}checked="checked"{/if}/> {'ap_show_home'|@translate}</td> 
    23                 </tr> 
    24     <tr> 
    25                         <td colspan="3"><input type="checkbox" name="show_menu" value="on" {if isset($SHOW_MENU)}checked="checked"{/if}/> {'ap_show_menu'|@translate}</td> 
    26                 </tr> 
    27                 <tr class="menu_languages"> 
    28                         <td><br>{'ap_menu_name'|@translate} : &nbsp;&nbsp;</td> 
    29                         <td><br>{'Default'|@translate}&nbsp;&nbsp;</td> 
    30                         <td><br><input type="text" size="50" maxlength="255" value="{$LANG_DEFAULT_VALUE}" name="menu_lang[default]"/></td> 
    31                 </tr> 
    32                 {foreach from=$language item=lang} 
    33                 <tr class="menu_languages"> 
    34                         <td></td> 
    35                         <td>{$lang.LANGUAGE_NAME}&nbsp;&nbsp;</td> 
    36                         <td><input type="text" size="50" maxlength="255" value="{$lang.VALUE}" name="menu_lang[{$lang.LANGUAGE_CODE}]"/></td> 
    37                 </tr> 
    38                 {/foreach} 
    39         </table> 
     6<fieldset id="indexDisplayConf"> 
     7  <legend>{'ap_perm'|@translate}</legend> 
     8  <ul> 
     9    <li> 
     10      <label> 
     11        <span class="property">{'ap_user_perm'|@translate}</span> 
     12        <input type="checkbox" name="user_perm" id="user_perm" value="on" {if $ap_conf.user_perm}checked="checked"{/if}/> 
     13      </label> 
     14    </li> 
    4015 
    41 <br> 
     16    <li> 
     17      <label> 
     18        <span class="property">{'ap_group_perm'|@translate}</span> 
     19        <input type="checkbox" name="group_perm" id="group_perm" value="on" {if $ap_conf.group_perm}checked="checked"{/if}/> 
     20      </label> 
     21    </li> 
     22  </ul> 
     23</fieldset> 
     24 
     25<fieldset id="indexDisplayConf"> 
     26  <legend>{'Display'|@translate}</legend> 
     27  <ul> 
     28    <li> 
     29      <label> 
     30        <span class="property">{'ap_show_home'|@translate}</span> 
     31        <input type="checkbox" name="show_home" id="show_home" value="on" {if $ap_conf.show_home}checked="checked"{/if}/> 
     32      </label> 
     33    </li> 
     34 
     35    <li> 
     36      <label> 
     37        <span class="property">{'ap_show_menu'|@translate}</span> 
     38        <input type="checkbox" name="show_menu" id="show_menu" value="on" {if isset($SHOW_MENU)}checked="checked"{/if}/> 
     39      </label> 
     40    </li> 
     41 
     42    <li id="menu_name" style="display:none;"> 
     43      <span class="property">{'ap_menu_name'|@translate} : 
     44        <select name="lang_desc_select" style="margin-left:30px;"> 
     45          {foreach from=$language item=lang} 
     46            <option value="{$lang.LANGUAGE_CODE}" id="opt_{$lang.LANGUAGE_CODE}">{if empty($lang.VALUE)}&#x2718;{else}&#x2714;{/if} &nbsp;{$lang.LANGUAGE_NAME}</option> 
     47          {/foreach} 
     48        </select> 
     49        {foreach from=$language item=lang} 
     50          <input type="text" size="50" name="menu_lang[{$lang.LANGUAGE_CODE}]" id="menu_lang_{$lang.LANGUAGE_CODE}" value="{$lang.VALUE}" style="display:none; margin-left:10px;"> 
     51        {/foreach} 
     52      </span> 
     53    </li> 
     54  </ul> 
    4255</fieldset> 
    4356        <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"/></p> 
    4457</form> 
    4558 
    46 {if isset($convert_bbcode)} 
    47         <p><a href="{$convert_bbcode.PATH}">{'ap_parse_bbcode'|@translate}</a></p> 
    48 {/if} 
     59<script type="text/javascript"> 
     60var languages = new Array(); 
     61var filled = new Array; 
     62{foreach from=$language item=lang} 
     63languages["{$lang.LANGUAGE_CODE}"] = "{$lang.LANGUAGE_NAME}"; 
     64if ($('input[id=menu_lang_{$lang.LANGUAGE_CODE}]').val() != '') 
     65  filled.push("{$lang.LANGUAGE_CODE}"); 
     66{/foreach} 
    4967 
    50 <script type="text/javascript"> 
    5168jQuery().ready( function () {ldelim} 
    52   jQuery("input[name='show_menu']").click( function() {ldelim} 
    53     if (this.checked) 
    54       jQuery('.menu_languages').show(); 
    55     else 
    56       jQuery('.menu_languages').hide(); 
     69  jQuery("#show_menu").click( function() {ldelim} 
     70    if (this.checked) {ldelim} 
     71      jQuery('#menu_name').show(); 
     72    } 
     73    else {ldelim} 
     74      jQuery('#menu_name').hide(); 
     75    } 
     76  }); 
     77  $('select[name="lang_desc_select"]').change(function () {ldelim} 
     78    $('[id^="menu_lang"]').hide(); 
     79    $("#menu_lang_"+this.options[this.selectedIndex].value).show(); 
     80  }); 
     81  $('[id^="menu_lang_"]').keyup(function () {ldelim} 
     82    arr = $(this).attr("id").split("menu_lang_"); 
     83    id = arr[1]; 
     84    opt = $('select[name="lang_desc_select"] option[id="opt_'+id+'"]'); 
     85    if (this.value != '') {ldelim} 
     86      opt.html(opt.html().replace("\u2718", "\u2714")); 
     87      add = true; 
     88      for (i in filled) {ldelim} 
     89        if (filled[i] == id) add = false; 
     90      } 
     91      if (add) {ldelim} 
     92        filled.push(id); 
     93      } 
     94    } 
     95    else {ldelim} 
     96      for (i in filled) {ldelim} 
     97        if (filled[i] == id) filled.splice(i, 1); 
     98      } 
     99      opt.html(opt.html().replace("\u2714", "\u2718")); 
     100    } 
    57101  }); 
    58102}); 
    59 if (!jQuery("input[name='show_menu']").attr('checked')) 
    60   jQuery('.menu_languages').hide(); 
     103 
     104jQuery('#menu_lang_default').show(); 
     105if (jQuery("input[name='show_menu']").attr('checked')) {ldelim} 
     106  jQuery('#menu_name').show(); 
     107} 
    61108</script> 
  • extensions/AdditionalPages/language/cs_CZ/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/de_DE/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/en_UK/plugin.lang.php

    r9270 r9273  
    4444$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/es_ES/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/fr_FR/plugin.lang.php

    r9270 r9273  
    4444$lang['ap_homepage_tip'] = 'Remplace la page d\'accueil de votre galerie'; 
    4545$lang['ap_standalone_tip'] = 'La page requiert une structure HTML complète'; 
     46$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     47$lang['ap_permalink_already_used'] = 'Le lien permanent %s est déja utilisé par la page %s'; 
    4648 
    4749?> 
  • extensions/AdditionalPages/language/hu_HU/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/it_IT/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/lv_LV/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/pl_PL/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/ru_RU/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
  • extensions/AdditionalPages/language/sk_SK/plugin.lang.php

    r9270 r9273  
    4444/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
    4545/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
     46/*TODO*/$lang['ap_permalink_already_used'] = 'Permalink %s is already used by page %s'; 
    4647 
    4748?> 
Note: See TracChangeset for help on using the changeset viewer.