Changeset 28876


Ignore:
Timestamp:
06/30/14 21:02:54 (5 years ago)
Author:
mistic100
Message:

improve display of files list

Location:
extensions/plugin_lang_analysis
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • extensions/plugin_lang_analysis/admin.php

    r26607 r28876  
    2525  $files = list_plugin_files($_GET['plugin_id']); 
    2626  $language_files = list_plugin_languages_files($_GET['plugin_id']); 
    27    
    2827  $default_lang_files = get_loaded_in_main($_GET['plugin_id']); 
     28   
    2929  if (empty($default_lang_files)) 
    3030  { 
     
    4343  } 
    4444   
    45   foreach ($files as &$file) 
    46   { 
    47     if (isset($saved_files[ $file ])) 
    48     { 
    49       $file = $saved_files[ $file ]; 
    50       $file['lang_files'] = array_intersect($file['lang_files'], array_keys($language_files)); 
    51     } 
    52     else 
    53     { 
    54       $file = array( 
    55         'path' => $file, 
    56         'is_admin' => strpos($file, '/admin') === 0 || strpos($file, 'admin.tpl') !== false, 
    57         'ignore' => false, 
    58         'lang_files' => $default_lang_files, 
    59         ); 
    60     } 
    61   } 
    62   unset($file); 
    63    
     45  global $language_files, $default_lang_files; 
     46  populate_plugin_files($files, $saved_files); 
     47 
    6448  $template->assign(array( 
    6549    'PLA_STEP' => 'config', 
     
    7862  if (isset($_POST['files'])) 
    7963  { 
    80     $files = array(); 
    81     foreach ($_POST['files'] as $file => $data) 
    82     { 
    83       $files[ $file ] = array( 
    84         'path' => $file, 
    85         'is_admin' => $data['is_admin']=='true', 
    86         'ignore' => $data['ignore']=='true', 
    87         'lang_files' => array(), 
    88         ); 
    89       if (!empty($data['lang_files'])) 
    90       { 
    91         $files[ $file ]['lang_files'] = array_keys(array_filter($data['lang_files'], create_function('$f', 'return $f=="true";'))); 
    92       } 
    93     } 
     64    $files = $_POST['files']; 
     65    clean_files_from_config($files); 
    9466     
    9567    $content = "<?php\nreturn "; 
    9668    $content.= var_export($files, true); 
    97     $content.= ";\n?>"; 
     69    $content.= ";\n"; 
    9870     
    9971    @mkdir(PLA_DATA, true, 0755); 
     
    10577  } 
    10678   
    107   $strings = array(); 
    10879  $counts = array('ok'=>0,'missing'=>0,'useless'=>0); 
    10980   
    11081  // get strings list 
    111   foreach ($files as $file => $file_data) 
    112   { 
    113     if ($file_data['ignore']) continue; 
    114  
    115     $file_strings = analyze_file($_GET['plugin_id'].$file); 
    116      
    117     foreach ($file_strings as $string => $lines) 
    118     { 
    119       $strings[ $string ]['files'][ $file ] = $file_data + array('lines' => $lines); 
    120     } 
    121   } 
     82  $strings = analyze_files($_GET['plugin_id'], $files); 
    12283   
    12384  // load language files 
     
    260221$template->set_filename('pla_content', realpath(PLA_PATH.'template/main.tpl')); 
    261222$template->assign_var_from_handle('ADMIN_CONTENT', 'pla_content'); 
    262  
    263 ?> 
  • extensions/plugin_lang_analysis/include/functions.inc.php

    r28862 r28876  
    33 
    44/** 
    5  * list files of a plugin 
    6  * @param: string $id, plugin id 
    7  * @return: array of paths relative to plugin root 
     5 * List files of a plugin 
     6 * @param string $id, plugin id 
     7 * @return nested array of paths relative to plugin root 
     8 *    Keys are numeric for files or directory name 
     9 *    Values are file name or array of more entries 
    810 */ 
    911function list_plugin_files($id, $path=null) 
     
    1618  if ($path == '/language/') 
    1719  { 
    18     return array(); 
     20    return null; 
    1921  } 
    2022   
    2123  if (strlen($path)-strrpos($path, '_data/') == 6) 
    2224  { 
    23     return array(); 
     25    return null; 
    2426  } 
    2527   
    2628  if (($handle = @opendir(PHPWG_PLUGINS_PATH.$id.$path)) === false) 
    2729  { 
    28     return array(); 
     30    return null; 
    2931  } 
    3032   
     
    3739    if (is_dir(PHPWG_PLUGINS_PATH.$id.$path.$entry)) 
    3840    { 
    39       $data = array_merge($data, list_plugin_files($id, $path.$entry.'/')); 
     41      $data[$entry.'/'] = list_plugin_files($id, $path.$entry.'/'); 
    4042    } 
    4143    else 
     
    4446      if (in_array($ext, array('php', 'tpl'))) 
    4547      { 
    46         $data[] = $path.$entry; 
     48        $data[] = $entry; 
    4749      } 
    4850    } 
     
    5153  closedir($handle); 
    5254   
    53   return $data; 
     55  uksort($data, 'custom_folder_sort'); 
     56   
     57  return array_filter($data); 
     58} 
     59 
     60/** 
     61 * Merges the result of *list_plugin_files* and data from cache 
     62 * Needs the result of *list_plugin_languages_files* and *get_loaded_in_main* in global scope 
     63 *  
     64 * @param array &$files 
     65 * @param array $saved_files 
     66 * @return nested array of files with metadata 
     67 *    Keys are numeric for files or directory name 
     68 *    Values are file metadata (filename, is_admin, ignore, lang_files) or array of more entries 
     69 */ 
     70function populate_plugin_files(&$files, $saved_files, $root='/', $is_admin=false) 
     71{ 
     72  global $language_files, $default_lang_files; 
     73   
     74  foreach ($files as $id => &$file) 
     75  { 
     76    if (is_array($file)) 
     77    { 
     78      populate_plugin_files($file, 
     79        isset($saved_files[$id]) ? $saved_files[$id] : array(), 
     80        $root.$id, 
     81        strpos($id, 'admin') !== false || $is_admin 
     82        ); 
     83    } 
     84    else if (isset($saved_files[ $file ])) 
     85    { 
     86      $id = $file; 
     87      $file = $saved_files[ $id ]; 
     88      $file['filename'] = $id; 
     89      $file['lang_files'] = array_intersect($file['lang_files'], array_keys($language_files)); 
     90    } 
     91    else 
     92    { 
     93      $id = $file; 
     94      $file = array( 
     95        'filename' => $id, 
     96        'is_admin' => strpos($id, 'admin') !== false || $is_admin, 
     97        'ignore' => false, 
     98        'lang_files' => $default_lang_files, 
     99        ); 
     100    } 
     101  } 
     102  unset($file); 
     103} 
     104 
     105/** 
     106 * Sanitize the result of config form for direct usage and cache 
     107 * @param array &$files 
     108 * @return nested array of files with metadata 
     109 *    Keys are file name or directory name 
     110 *    Values are file metadata (is_admin, ignore, lang_files) or array of more entries  
     111 */ 
     112function clean_files_from_config(&$files) 
     113{ 
     114  foreach ($files as $id => &$file) 
     115  { 
     116    if (!isset($file['ignore'])) 
     117    { 
     118      clean_files_from_config($file); 
     119    } 
     120    // security against max_input_vars overflow 
     121    else if (isset($file['is_admin']) && isset($file['ignore']) && isset($file['lang_files'])) 
     122    { 
     123      $file['is_admin'] = get_boolean($file['is_admin']); 
     124      $file['ignore'] = get_boolean($file['ignore']); 
     125      $file['lang_files'] = array_keys(array_filter($file['lang_files'], 'get_boolean')); 
     126    } 
     127  } 
     128  unset($file); 
     129} 
     130 
     131/** 
     132 * Custom sort callback for files and directories 
     133 * Alphabetic order with files before directories 
     134 */ 
     135function custom_folder_sort($a, $b) 
     136{ 
     137  if (is_int($a) && is_int($b)) 
     138  { 
     139    return $a-$b; 
     140  } 
     141  else if (is_string($a) && is_string($b)) 
     142  { 
     143    return strnatcasecmp($a, $b); 
     144  } 
     145  else if (is_string($a) && is_int($b)) 
     146  { 
     147    return 1; 
     148  } 
     149  else 
     150  { 
     151    return -1; 
     152  } 
    54153} 
    55154 
     
    76175    if (!is_dir(PHPWG_PLUGINS_PATH.$id.$path.$entry)) 
    77176    { 
    78       $ext = strtolower(get_extension($entry)); 
    79       if ($ext == 'php') 
     177      if (get_extension($entry) == 'php') 
    80178      { 
    81179        $data[ basename($entry, '.php') ] = $path.$entry; 
     
    87185   
    88186  return $data; 
     187} 
     188 
     189/** 
     190 * Construct the list of all used strings in the plugin files 
     191 * @param string $plugin 
     192 * @param array $files 
     193 * @return array multidimensional 
     194 */ 
     195function analyze_files($plugin, $files, &$strings = array(), $path='') 
     196{ 
     197  foreach ($files as $id => $file) 
     198  { 
     199    if (!isset($file['ignore'])) 
     200    { 
     201      analyze_files($plugin, $file, $strings, $path.$id); 
     202    } 
     203    else 
     204    { 
     205      if ($file['ignore']) continue; 
     206 
     207      $file_strings = analyze_file($plugin.'/'.$path.$id); 
     208       
     209      foreach ($file_strings as $string => $lines) 
     210      { 
     211        $strings[ $string ]['files'][ $path.$id ] = $file + array('lines' => $lines); 
     212      } 
     213    } 
     214  } 
     215   
     216  return $strings; 
    89217} 
    90218 
     
    111239    } 
    112240    // translate 
    113     if (preg_match_all('#\\{\\\\{0,1}["\']{1}(.*?)\\\\{0,1}["\']{1}\\|@?translate#', $line, $matches)) 
     241    if (preg_match_all('#\\{\\\\?["\']{1}(.*?)\\\\?["\']{1}\\|@?translate#', $line, $matches)) 
    114242    { 
    115243      for ($j=0; $j<count($matches[1]); ++$j) 
     
    119247    } 
    120248    // translate_dec 
    121     if (preg_match_all('#translate_dec:\\\\{0,1}["\']{1}(.*?)\\\\{0,1}["\']{1}:\\\\{0,1}["\']{1}(.*?)\\\\{0,1}["\']{1}}#', $line, $matches)) 
     249    if (preg_match_all('#translate_dec:\\\\?["\']{1}(.*?)\\\\?["\']{1}:\\\\?["\']{1}(.*?)\\\\?["\']{1}}#', $line, $matches)) 
    122250    { 
    123251      for ($j=0; $j<count($matches[1]); ++$j) 
     
    179307  $files = array(); 
    180308   
    181   if (preg_match_all('#load_language\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $content, $matches)) 
     309  if (preg_match_all('#load_language\\(\s*["\']{1}(.*?)["\']{1}#', $content, $matches)) 
    182310  { 
    183311    $files = $matches[1]; 
     
    196324  return $lang; 
    197325} 
    198  
    199 ?> 
  • extensions/plugin_lang_analysis/template/analysis.tpl

    r26059 r28876  
    11{footer_script}{literal} 
    22$('.strings tr.string td.toggler').click(function() { 
    3   if ($(this).hasClass('iconpla-plus-circled')) { 
    4     $(this).removeClass('iconpla-plus-circled').addClass('iconpla-minus-circled'); 
     3  if ($(this).hasClass('icon-plus-circled')) { 
     4    $(this).removeClass('icon-plus-circled').addClass('iconpla-minus-circled'); 
    55    $(this).parent().nextUntil('tr.string').show(); 
    66  } 
    77  else { 
    8     $(this).removeClass('iconpla-minus-circled').addClass('iconpla-plus-circled'); 
     8    $(this).removeClass('iconpla-minus-circled').addClass('icon-plus-circled'); 
    99    $(this).parent().nextUntil('tr.string').hide(); 
    1010  } 
     
    2929 
    3030$('.open-all').click(function() { 
    31   $('.strings tr.string td.toggler').removeClass('iconpla-plus-circled').addClass('iconpla-minus-circled'); 
     31  $('.strings tr.string td.toggler').removeClass('icon-plus-circled').addClass('iconpla-minus-circled'); 
    3232  $('.strings tr.file').show(); 
    3333}); 
    3434$('.open-missing').click(function() { 
    35   $('.strings tr.string.missing td.toggler').removeClass('iconpla-plus-circled').addClass('iconpla-minus-circled'); 
     35  $('.close-all').click(); 
     36  $('.strings tr.string.missing td.toggler').removeClass('icon-plus-circled').addClass('iconpla-minus-circled'); 
    3637  $('.strings tr.file.string-missing').show(); 
    3738}); 
    3839$('.close-all').click(function() { 
    39   $('.strings tr.string td.toggler').removeClass('iconpla-minus-circled').addClass('iconpla-plus-circled'); 
     40  $('.strings tr.string td.toggler').removeClass('iconpla-minus-circled').addClass('icon-plus-circled'); 
    4041  $('.strings tr.file').hide(); 
    4142}); 
     
    8687    <!-- begin string --> 
    8788    <tr class="string {$data.stat}"> 
    88       <td class="toggler iconpla-plus-circled"></td> 
     89      <td class="toggler icon-plus-circled"></td> 
    8990      <td> 
    9091        {$string|htmlspecialchars} 
  • extensions/plugin_lang_analysis/template/config.tpl

    r26607 r28876  
    1 {footer_script}{literal} 
     1{footer_script} 
    22$('.switch-button.type span').click(function() { 
    33  $(this).siblings('span').removeClass('active'); 
     
    3333  } 
    3434}); 
    35 {/literal}{/footer_script} 
     35 
     36$('.folder > td > .switch-button span').click(function() { 
     37  $(this).removeClass('active') 
     38    .closest('.folder').next('.nested') 
     39    .find('tr:not(.folder) > td > .switch-button span[data-val="'+ $(this).data('val') +'"]') 
     40    .trigger('click'); 
     41}); 
     42{/footer_script} 
    3643 
    3744<form method="POST" action="{$F_ACTION}" class="properties"> 
     
    3946  <legend>{'Select dependencies'|translate}</legend> 
    4047   
    41   <table class="files"> 
    42   <thead> 
    43     <tr> 
    44       <th></th> 
    45       <th>{'Core dependency'|translate}</th> 
    46       <th>{'Local dependencies'|translate}</th> 
    47       <th>{'Ignore'|translate}</th> 
    48     </tr> 
    49   </thead> 
    50    
    51   <tbody> 
    52   {foreach from=$PLA_FILES item=file} 
    53     <tr> 
    54       <td>{$file.path}</td> 
    55       <td> 
    56         <div class="switch-button type"> 
    57           <span class="item common {if not $file.is_admin}active{/if}">{'Common'|translate}</span> 
    58           <span class="item admin {if $file.is_admin}active{/if}">{'Admin'|translate}</span> 
    59           <input type="hidden" name="files[{$file.path}][is_admin]" value="{if $file.is_admin}true{else}false{/if}"> 
    60         </div> 
    61       </td> 
    62       <td> 
    63         <div class="switch-button other"> 
    64         {foreach from=$PLA_LANG_FILES item=lang_file} 
    65           <span class="item other {if $lang_file|in_array:$file.lang_files}active{/if}">{$lang_file}</span> 
    66           <input type="hidden" name="files[{$file.path}][lang_files][{$lang_file}]" value="{if $lang_file|in_array:$file.lang_files}true{else}false{/if}"> 
    67         {/foreach} 
    68         </div> 
    69       </td> 
    70       <td> 
    71         <div class="switch-button ignore"> 
    72           <span class="item ignore {if $file.ignore}active{/if}">&times;</span> 
    73           <input type="hidden" name="files[{$file.path}][ignore]" value="{if $file.ignore}true{else}false{/if}"> 
    74         </div> 
    75       </td> 
    76     </tr> 
    77   {/foreach} 
    78   </tbody> 
    79   </table> 
     48  {include file=$PLA_ABS_PATH|cat:'template/config_list.inc.tpl' files=$PLA_FILES level=0 path=""} 
    8049   
    8150  <p class="formButtons"><input type="submit" value="{'Continue'|translate}"></p> 
  • extensions/plugin_lang_analysis/template/fontello/config.json

    r23467 r28876  
    33  "css_prefix_text": "iconpla-", 
    44  "css_use_suffix": false, 
     5  "hinting": true, 
     6  "units_per_em": 1000, 
     7  "ascent": 850, 
    58  "glyphs": [ 
    69    { 
     
    811      "css": "ok-squared", 
    912      "code": 59394, 
    10       "src": "fontawesome" 
    11     }, 
    12     { 
    13       "uid": "4ba33d2607902cf690dd45df09774cb0", 
    14       "css": "plus-circled", 
    15       "code": 59393, 
    1613      "src": "fontawesome" 
    1714    }, 
     
    3330      "code": 59397, 
    3431      "src": "fontawesome" 
     32    }, 
     33    { 
     34      "uid": "c08a1cde48d96cba21d8c05fa7d7feb1", 
     35      "css": "doc-text-inv", 
     36      "code": 59393, 
     37      "src": "fontawesome" 
    3538    } 
    3639  ] 
  • extensions/plugin_lang_analysis/template/fontello/css/fontello_pla.css

    r23467 r28876  
    11@font-face { 
    22  font-family: 'fontello_pla'; 
    3   src: url('../font/fontello_pla.eot?43900030'); 
    4   src: url('../font/fontello_pla.eot?43900030#iefix') format('embedded-opentype'), 
    5        url('../font/fontello_pla.woff?43900030') format('woff'), 
    6        url('../font/fontello_pla.ttf?43900030') format('truetype'), 
    7        url('../font/fontello_pla.svg?43900030#fontello_pla') format('svg'); 
     3  src: url('../font/fontello_pla.eot?64724823'); 
     4  src: url('../font/fontello_pla.eot?64724823#iefix') format('embedded-opentype'), 
     5       url('../font/fontello_pla.woff?64724823') format('woff'), 
     6       url('../font/fontello_pla.ttf?64724823') format('truetype'), 
     7       url('../font/fontello_pla.svg?64724823#fontello_pla') format('svg'); 
    88  font-weight: normal; 
    99  font-style: normal; 
     
    1515  @font-face { 
    1616    font-family: 'fontello_pla'; 
    17     src: url('../font/fontello_pla.svg?43900030#fontello_pla') format('svg'); 
     17    src: url('../font/fontello_pla.svg?64724823#fontello_pla') format('svg'); 
    1818  } 
    1919} 
     
    5151} 
    5252  
     53.iconpla-minus-circled:before { content: '\e800'; } /* '' */ 
     54.iconpla-doc-text-inv:before { content: '\e801'; } /* '' */ 
     55.iconpla-ok-squared:before { content: '\e802'; } /* '' */ 
    5356.iconpla-attention:before { content: '\e804'; } /* '' */ 
    5457.iconpla-attention-circled:before { content: '\e805'; } /* '' */ 
    55 .iconpla-plus-circled:before { content: '\e801'; } /* '' */ 
    56 .iconpla-minus-circled:before { content: '\e800'; } /* '' */ 
    57 .iconpla-ok-squared:before { content: '\e802'; } /* '' */ 
  • extensions/plugin_lang_analysis/template/fontello/demo.html

    r23467 r28876  
    11<!DOCTYPE html> 
    22<html> 
    3   <head><!--[if lt IE 9]> 
    4     <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> 
    5     <meta charset="UTF-8"><style type="text/css">/* 
     3  <head><!--[if lt IE 9]><script language="javascript" type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> 
     4    <meta charset="UTF-8"><style>/* 
    65 * Bootstrap v2.2.1 
    76 * 
     
    231230</style> 
    232231    <link rel="stylesheet" href="css/fontello_pla.css"> 
    233     <link rel="stylesheet" href="css/animation.css"><!--[if IE 7]> 
    234     <link rel="stylesheet" href="css/fontello_pla-ie7.css"><![endif]--> 
     232    <link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/fontello_pla-ie7.css"><![endif]--> 
    235233    <script> 
    236234      function toggleCodes(on) { 
     
    258256    <div id="icons" class="container"> 
    259257      <div class="row"> 
     258        <div title="Code: 0xe800" class="the-icons span3"><i class="iconpla-minus-circled"></i> <span class="i-name">iconpla-minus-circled</span><span class="i-code">0xe800</span></div> 
     259        <div title="Code: 0xe801" class="the-icons span3"><i class="iconpla-doc-text-inv"></i> <span class="i-name">iconpla-doc-text-inv</span><span class="i-code">0xe801</span></div> 
     260        <div title="Code: 0xe802" class="the-icons span3"><i class="iconpla-ok-squared"></i> <span class="i-name">iconpla-ok-squared</span><span class="i-code">0xe802</span></div> 
    260261        <div title="Code: 0xe804" class="the-icons span3"><i class="iconpla-attention"></i> <span class="i-name">iconpla-attention</span><span class="i-code">0xe804</span></div> 
    261         <div title="Code: 0xe805" class="the-icons span3"><i class="iconpla-attention-circled"></i> <span class="i-name">iconpla-attention-circled</span><span class="i-code">0xe805</span></div> 
    262         <div title="Code: 0xe801" class="the-icons span3"><i class="iconpla-plus-circled"></i> <span class="i-name">iconpla-plus-circled</span><span class="i-code">0xe801</span></div> 
    263         <div title="Code: 0xe800" class="the-icons span3"><i class="iconpla-minus-circled"></i> <span class="i-name">iconpla-minus-circled</span><span class="i-code">0xe800</span></div> 
    264262      </div> 
    265263      <div class="row"> 
    266         <div title="Code: 0xe802" class="the-icons span3"><i class="iconpla-ok-squared"></i> <span class="i-name">iconpla-ok-squared</span><span class="i-code">0xe802</span></div> 
     264        <div title="Code: 0xe805" class="the-icons span3"><i class="iconpla-attention-circled"></i> <span class="i-name">iconpla-attention-circled</span><span class="i-code">0xe805</span></div> 
    267265      </div> 
    268266    </div> 
  • extensions/plugin_lang_analysis/template/fontello/font/fontello_pla.svg

    r23467 r28876  
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> 
    33<svg xmlns="http://www.w3.org/2000/svg"> 
    4 <metadata>Copyright (C) 2012 by original authors @ fontello.com</metadata> 
     4<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata> 
    55<defs> 
    66<font id="fontello_pla" horiz-adv-x="1000" > 
    77<font-face font-family="fontello_pla" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" /> 
    88<missing-glyph horiz-adv-x="1000" /> 
    9 <glyph glyph-name="attention" unicode="&#xe804;" d="M571 83l0 106q0 8-5 13t-13 5l-107 0q-7 0-13-5t-5-13l0-106q0-8 5-13t13-5l107 0q7 0 13 5t5 13z m-1 209l10 256q0 7-6 11-7 6-13 6l-123 0q-6 0-13-6-6-4-6-12l9-255q0-6 6-9t13-4l103 0q8 0 13 4t6 9z m-8 521l429-786q20-35-1-70-9-16-26-26t-35-9l-857 0q-19 0-35 9t-26 26q-21 35-1 70l429 786q9 17 26 27t36 10 36-10 26-27z" horiz-adv-x="1000" /> 
    10 <glyph glyph-name="attention-circled" unicode="&#xe805;" d="M429 779q117 0 215-57t156-156 57-215-57-215-156-156-215-57-215 57-156 156-57 215 57 215 156 156 215 57z m71-696l0 106q0 8-5 13t-12 5l-107 0q-7 0-13-6t-6-13l0-106q0-7 6-13t13-6l107 0q7 0 12 5t5 13z m-1 192l10 347q0 7-6 10-6 4-13 4l-123 0q-8 0-13-4-6-3-6-10l9-347q0-6 6-10t13-4l103 0q8 0 13 4t6 10z" horiz-adv-x="857.143" /> 
    11 <glyph glyph-name="plus-circled" unicode="&#xe801;" d="M679 314l0 71q0 15-11 25t-25 11l-143 0 0 143q0 15-11 25t-25 11l-71 0q-15 0-25-11t-11-25l0-143-143 0q-15 0-25-11t-11-25l0-71q0-15 11-25t25-11l143 0 0-143q0-15 11-25t25-11l71 0q15 0 25 11t11 25l0 143 143 0q15 0 25 11t11 25z m179 36q0-117-57-215t-156-156-215-57-215 57-156 156-57 215 57 215 156 156 215 57 215-57 156-156 57-215z" horiz-adv-x="857.143" /> 
    12 <glyph glyph-name="minus-circled" unicode="&#xe800;" d="M679 314l0 71q0 15-11 25t-25 11l-429 0q-15 0-25-11t-11-25l0-71q0-15 11-25t25-11l429 0q15 0 25 11t11 25z m179 36q0-117-57-215t-156-156-215-57-215 57-156 156-57 215 57 215 156 156 215 57 215-57 156-156 57-215z" horiz-adv-x="857.143" /> 
    13 <glyph glyph-name="ok-squared" unicode="&#xe802;" d="M382 125l343 343q11 11 11 25t-11 25l-57 57q-11 11-25 11t-25-11l-261-261-118 118q-11 11-25 11t-25-11l-57-57q-11-11-11-25t11-25l200-200q11-11 25-11t25 11z m475 493l0-536q0-66-47-114t-114-47l-536 0q-66 0-114 47t-47 114l0 536q0 66 47 114t114 47l536 0q66 0 114-47t47-114z" horiz-adv-x="857.143" /> 
     9<glyph glyph-name="minus-circled" unicode="&#xe800;" d="m0 350q0 117 58 215t155 156 216 58 215-58 156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215z m179-36q0-14 10-25t25-10h429q14 0 25 10t11 25v72q0 14-11 25t-25 10h-429q-14 0-25-10t-10-25v-72z" horiz-adv-x="857.1" /> 
     10<glyph glyph-name="doc-text-inv" unicode="&#xe801;" d="m0-96v892q0 23 16 38t38 16h446v-304q0-22 16-38t38-15h303v-589q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38z m214 178q0-8 5-13t13-5h393q8 0 13 5t5 13v36q0 8-5 13t-13 5h-393q-8 0-13-5t-5-13v-36z m0 143q0-8 5-13t13-5h393q8 0 13 5t5 13v36q0 8-5 13t-13 5h-393q-8 0-13-5t-5-13v-36z m0 143q0-8 5-13t13-5h393q8 0 13 5t5 13v36q0 7-5 12t-13 5h-393q-8 0-13-5t-5-12v-36z m357 196v264q13-8 21-16l227-228q8-7 16-20h-264z" horiz-adv-x="857.1" /> 
     11<glyph glyph-name="ok-squared" unicode="&#xe802;" d="m0 82v536q0 66 47 113t114 48h535q67 0 114-48t47-113v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113z m122 268q0-14 10-25l200-200q11-10 25-10t25 10l343 343q10 10 10 25t-10 25l-57 57q-11 10-25 10t-25-10l-261-261-118 118q-10 11-25 11t-25-11l-57-57q-10-11-10-25z" horiz-adv-x="857.1" /> 
     12<glyph glyph-name="attention" unicode="&#xe804;" d="m9 27l429 786q9 17 26 27t36 10 36-10 27-27l428-786q20-35-1-70-10-17-26-26t-35-10h-858q-18 0-35 10t-26 26q-21 35-1 70z m411 519l9-255q0-5 6-9t13-3h103q8 0 13 3t6 9l10 257q0 6-5 10-7 6-14 6h-122q-7 0-14-6-5-4-5-12z m9-463q0-8 5-13t12-6h108q7 0 12 6t5 13v106q0 8-5 13t-12 5h-108q-7 0-12-5t-5-13v-106z" horiz-adv-x="1000" /> 
     13<glyph glyph-name="attention-circled" unicode="&#xe805;" d="m0 350q0 117 58 215t155 156 216 58 215-58 156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215z m348 271l10-346q0-6 5-10t14-4h103q8 0 13 4t6 10l10 346q0 7-6 10-5 5-13 5h-123q-8 0-13-5-6-3-6-10z m9-538q0-8 6-13t13-6h107q7 0 12 6t5 13v106q0 8-5 13t-12 5h-107q-8 0-13-5t-6-13v-106z" horiz-adv-x="857.1" /> 
    1414</font> 
    1515</defs> 
  • extensions/plugin_lang_analysis/template/select.tpl

    r26059 r28876  
    1 {footer_script}{literal} 
    2 $('form#pla').submit(function() { 
    3   window.location.href = $(this).attr('action') + '&plugin_id=' + $(this).find('select').val(); 
    4   return false; 
     1{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'} 
     2{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} 
     3{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"} 
     4 
     5{footer_script} 
     6$('[name=plugin_id]').selectize({ 
     7  sortField: 'text' 
    58}); 
    6 {/literal}{/footer_script} 
     9 
     10$('form#pla').submit(function(e) { 
     11  e.preventDefault(); 
     12  var id = $('[name=plugin_id]').val(); 
     13   
     14  if (id) { 
     15    window.location.href = $(this).attr('action') + '&plugin_id=' + id; 
     16  } 
     17}); 
     18{/footer_script} 
    719 
    820<form method="GET" action="{$F_ACTION}" class="properties" id="pla"> 
     
    1123   
    1224  <select name="plugin_id"> 
     25    <option value=""></option> 
    1326  {foreach from=$PLA_PLUGINS item=plugin key=plugin_id} 
    1427    <option value="{$plugin_id}">{$plugin.name} ({$plugin.version})</option> 
     
    2336 
    2437  <p> 
    25     This tool analyses each file of the selected plugin, searching for <b>l10n</b>, <b>l10n_dec</b> and <b>translate</b> functions.<br> 
     38    This tool analyses each file of the selected plugin, searching for <b>l10n</b>, <b>l10n_dec</b>, <b>get_l10n_args</b>, <b>translate</b> and <b>translate_dec</b> functions.<br> 
    2639    Then it compares the matched strings to the content of the plugin's language files and the common and admin core language files.<br> 
    2740    Each file of the plugin can be configured as <b>Common</b> (public) or <b>Admin</b> and can be attached to one or more plugin's language files.<br> 
     
    6275    You can click the <span class="iconpla-plus-circled"></span> icon on the left of each string to see in which files it is used. Additionally you can see if the string is missing in only one or all files (corresponding to a problem in the loaded language files. 
    6376  </p> 
     77   
     78  <div class="warnings"> 
     79    <ul> 
     80      <li>If you have many files (above 500) you will overflow PHP <code>max_input_vars</code> limit.<br> 
     81        Bypass this limit by setting <code>max_input_vars = 3000</code> in your <i>php.ini</i> file</li> 
     82    </ul> 
     83  </div> 
    6484</fieldset> 
    6585 
  • extensions/plugin_lang_analysis/template/style.css

    r26607 r28876  
     1[name=plugin_id] + .selectize-control{ 
     2  max-width:300px; 
     3} 
     4 
    15.text-common { 
    26  color:#5E9100 !important; 
     
    4448    } 
    4549 
    46 .files { 
    47   border-collapse:separate; 
    48   border-spacing:10px 0; 
    49   text-align:left !important; 
     50.files, .files * { 
    5051  margin:0; 
    51 } 
     52  padding:0; 
     53  -moz-box-sizing:border-box; 
     54  box-sizing:border-box; 
     55} 
     56.files.level-0 { 
     57  width:80%; 
     58  overflow:hidden; 
     59} 
     60  .files table { 
     61    border-collapse:collapse; 
     62    border-spacing:0; 
     63    text-align:left !important; 
     64    width:100%; 
     65  } 
     66  .files th, .files td { 
     67    padding:0 5px; 
     68    height:30px; 
     69    line-height:10px; 
     70  } 
     71   
     72  .files tbody > tr:nth-child(2n) { 
     73    background:#f5f5f5; 
     74  } 
     75  .files tbody > tr:nth-child(2n+1) { 
     76    background:#efefef; 
     77  } 
     78   
     79  .files tr.folder > td.filename { 
     80    font-weight:bold; 
     81  } 
     82  .files tr.folder > td { 
     83    background:#888; 
     84    color:#fff; 
     85  } 
     86  .files tr.nested > td { 
     87    padding:0; 
     88    background:#ddd; 
     89  } 
     90    .files tr.nested .files { 
     91      margin-left:30px; 
     92      width:calc(100% - 30px); 
     93      position:relative; 
     94    } 
     95      /* the before is used to display marks */ 
     96      .files tr.nested .files:before { 
     97        content:""; 
     98        position:absolute; 
     99        width:15px; 
     100        height:calc(100% - 14px); 
     101        top:0; left:-44px; 
     102        border-left:29px solid #ddd; 
     103        background-image:linear-gradient(to bottom, white 1px, transparent 1px), linear-gradient(to right, white 1px, transparent 1px); 
     104        background-position:0px 15px; 
     105        background-size:15px 30px; 
     106      } 
     107      /* the after is used to hide useless marks of the parent */ 
     108      .files tr.nested tr.nested:last-child  > td > .files:after { 
     109        content:""; 
     110        position:absolute; 
     111        background:#ddd; 
     112        top:-14px; left:-50px; 
     113        width:15px; 
     114        height:calc(100% + 14px); 
     115      } 
     116     
     117  .files th.ignore, .files td.ignore { 
     118    width:70px; 
     119  } 
     120  .files th.type, .files td.type { 
     121    width:140px; 
     122  } 
     123  .files th.other, .files td.other { 
     124    width:240px; 
     125  } 
     126   
     127   
    52128 
    53129.strings { 
Note: See TracChangeset for help on using the changeset viewer.