Changeset 26059


Ignore:
Timestamp:
12/20/13 16:45:57 (6 years ago)
Author:
mistic100
Message:

minor gui improvments + parse get_l10n_args

Location:
extensions/plugin_lang_analysis
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/plugin_lang_analysis/admin.php

    r25677 r26059  
    5454      $file = array( 
    5555        'path' => $file, 
    56         'is_admin' => strpos($file, '/admin') === 0, 
     56        'is_admin' => strpos($file, '/admin') === 0 || strpos($file, 'admin.tpl') !== false, 
    5757        'lang_files' => $default_lang_files 
    5858        ); 
     
    243243    'PLA_COUNTS' => $counts, 
    244244    'U_BACK' => PLA_ADMIN.'&plugin_id='.$_GET['plugin_id'].'&config', 
     245    'U_REFRESH' => PLA_ADMIN.'&plugin_id='.$_GET['plugin_id'].'&analyze', 
    245246    )); 
    246247} 
  • extensions/plugin_lang_analysis/include/functions.inc.php

    r25677 r26059  
    155155      } 
    156156    } 
     157    // l10n_args 
     158    if (preg_match_all('#get_l10n_args\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $line, $matches)) 
     159    { 
     160      for ($j=0; $j<count($matches[1]); ++$j) 
     161      { 
     162        $strings[ stripslashes($matches[1][$j]) ][] = $i+1; 
     163      } 
     164    } 
    157165  } 
    158166   
  • extensions/plugin_lang_analysis/template/analysis.tpl

    r25677 r26059  
    5757<form class="properties"> 
    5858<fieldset> 
    59   <legend>{'Analysis results'|@translate}</legend> 
     59  <legend>{'Analysis results'|translate}</legend> 
    6060   
    6161  <p style="text-align:left;"> 
    62     <a class="open-all">{'Expand all'|@translate}</a> 
    63     / <a class="open-missing">{'Expand missing'|@translate}</a> 
    64     / <a class="close-all">{'Collapse all'|@translate}</a> 
     62    <a class="open-all">{'Expand all'|translate}</a> 
     63    / <a class="open-missing">{'Expand missing'|translate}</a> 
     64    / <a class="close-all">{'Collapse all'|translate}</a> 
    6565  </p> 
    6666   
     
    7070      <th></th> 
    7171      <th class="legend"> 
    72         <span class="missing">{'Missing'|@translate}</span> 
    73         <span class="useless">{'Useless'|@translate}</span> 
     72        <span class="missing">{'Missing'|translate}</span> 
     73        <span class="useless">{'Useless'|translate}</span> 
    7474      </th> 
    75       <th>{'Dependency'|@translate}</th> 
     75      <th>{'Dependency'|translate}</th> 
    7676    {foreach from=$PLA_LANG_FILES item=lang_file} 
    7777      <th>{$lang_file}</th> 
     
    9191        {if isset($data.warnings)}<span class="iconpla-attention-circled tiptip" title="{'<br>'|@implode:$data.warnings}"></span>{/if} 
    9292      </td> 
    93       {if $data.is_admin}<td class="text-admin">{'Admin'|@translate}</td> 
    94       {else}<td class="text-common">{'Common'|@translate}</td>{/if} 
     93      {if $data.is_admin}<td class="text-admin">{'Admin'|translate}</td> 
     94      {else}<td class="text-common">{'Common'|translate}</td>{/if} 
    9595    {foreach from=$PLA_LANG_FILES item=lang_file} 
    96       <td>{if $lang_file|in_array:$data.in_plugin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> 
     96      <td>{if $lang_file|in_array:$data.in_plugin}<b>{'Yes'|translate}</b>{else}{'No'|translate}{/if}</td> 
    9797    {/foreach} 
    98       <td>{if $data.in_common}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> 
    99       <td>{if $data.in_admin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> 
     98      <td>{if $data.in_common}<b>{'Yes'|translate}</b>{else}{'No'|translate}{/if}</td> 
     99      <td>{if $data.in_admin}<b>{'Yes'|translate}</b>{else}{'No'|translate}{/if}</td> 
    100100    </tr> 
    101101    {foreach from=$data.files item=file_data key=file} 
     
    104104        <td></td> 
    105105        <td>{$file} <i>({', '|@implode:$file_data.lines})</i></td> 
    106         {if $file_data.is_admin}<td class="text-admin">{'Admin'|@translate}</td> 
    107         {else}<td class="text-common">{'Common'|@translate}</td>{/if} 
     106        {if $file_data.is_admin}<td class="text-admin">{'Admin'|translate}</td> 
     107        {else}<td class="text-common">{'Common'|translate}</td>{/if} 
    108108      {foreach from=$PLA_LANG_FILES item=lang_file} 
    109         <td>{if $lang_file|in_array:$file_data.lang_files}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> 
     109        <td>{if $lang_file|in_array:$file_data.lang_files}<b>{'Yes'|translate}</b>{else}{'No'|translate}{/if}</td> 
    110110      {/foreach} 
    111111        <td></td> 
     
    115115      <tr class="file string-{$data.stat} useless"> 
    116116        <td></td> 
    117         <td><i>{'Unused'|@translate}</i></td> 
     117        <td><i>{'Unused'|translate}</i></td> 
    118118        {'<td></td>'|str_repeat:(3+$PLA_LANG_FILES|@count)} 
    119119      </tr> 
     
    125125    <tr> 
    126126      <th></th> 
    127       <th>{'%d strings : %d missing and %d useless.'|@translate|sprintf:$PLA_COUNTS.total:$PLA_COUNTS.missing:$PLA_COUNTS.useless}</th> 
     127      <th>{'%d strings : %d missing and %d useless.'|translate|sprintf:$PLA_COUNTS.total:$PLA_COUNTS.missing:$PLA_COUNTS.useless}</th> 
    128128      {'<th></th>'|str_repeat:(3+$PLA_LANG_FILES|@count)} 
    129129    </tr> 
    130130  </tfoot> 
    131131  </table> 
     132   
     133  <p class="formButtons"><a href="{$U_REFRESH}" class="buttonLike">{'Refresh'|translate}</a></p> 
    132134</fieldset> 
    133135</form> 
  • extensions/plugin_lang_analysis/template/config.tpl

    r23472 r26059  
    2626<form method="POST" action="{$F_ACTION}" class="properties"> 
    2727<fieldset> 
    28   <legend>{'Select dependencies'|@translate}</legend> 
     28  <legend>{'Select dependencies'|translate}</legend> 
    2929   
    3030  <table class="files"> 
     
    3232    <tr> 
    3333      <th></th> 
    34       <th>{'Core dependency'|@translate}</th> 
    35       <th>{'Local dependencies'|@translate}</th> 
     34      <th>{'Core dependency'|translate}</th> 
     35      <th>{'Local dependencies'|translate}</th> 
    3636    </tr> 
    3737  </thead> 
     
    4343      <td> 
    4444        <div class="switch-button type"> 
    45           <span class="item common {if not $file.is_admin}active{/if}">{'Common'|@translate}</span> 
    46           <span class="item admin {if $file.is_admin}active{/if}">{'Admin'|@translate}</span> 
     45          <span class="item common {if not $file.is_admin}active{/if}">{'Common'|translate}</span> 
     46          <span class="item admin {if $file.is_admin}active{/if}">{'Admin'|translate}</span> 
    4747          <input type="hidden" name="files[{$file.path}][is_admin]" value="{if $file.is_admin}true{else}false{/if}"> 
    4848        </div> 
     
    6161  </table> 
    6262   
    63   <p class="formButtons"><input type="submit" value="{'Continue'|@translate}"></p> 
     63  <p class="formButtons"><input type="submit" value="{'Continue'|translate}"></p> 
    6464</fieldset> 
    6565</form> 
  • extensions/plugin_lang_analysis/template/main.tpl

    r23472 r26059  
    1212 
    1313{if isset($U_BACK)} 
    14 <p style="text-align:left;margin-left:20px;"><a href="{$U_BACK}" class="buttonLike">{'Back'|@translate}</a></p> 
     14<p style="text-align:left;margin-left:20px;"><a href="{$U_BACK}" class="buttonLike">{'Back'|translate}</a></p> 
    1515{/if} 
  • extensions/plugin_lang_analysis/template/select.tpl

    r25677 r26059  
    1 {footer_script} 
     1{footer_script}{literal} 
    22$('form#pla').submit(function() { 
    33  window.location.href = $(this).attr('action') + '&plugin_id=' + $(this).find('select').val(); 
    44  return false; 
    55}); 
    6 {/footer_script} 
     6{/literal}{/footer_script} 
    77 
    88<form method="GET" action="{$F_ACTION}" class="properties" id="pla"> 
    99<fieldset> 
    10   <legend>{'Select a plugin'|@translate}</legend> 
     10  <legend>{'Select a plugin'|translate}</legend> 
    1111   
    1212  <select name="plugin_id"> 
     
    1616  </select> 
    1717 
    18   <p class="formButtons"><input type="submit" value="{'Continue'|@translate}"></p> 
     18  <p class="formButtons"><input type="submit" value="{'Continue'|translate}"></p> 
    1919</fieldset> 
    2020 
    2121<fieldset> 
    22   <legend>{'How to use?'|@translate}</legend> 
     22  <legend>{'How to use?'|translate}</legend> 
    2323 
    2424  <p> 
     
    6565 
    6666<fieldset> 
    67   <legend>{'Limitations'|@translate}</legend> 
     67  <legend>{'Limitations'|translate}</legend> 
    6868   
    6969  <p> 
Note: See TracChangeset for help on using the changeset viewer.