Changeset 120875 in spip-zone
- Timestamp:
- Jan 29, 2020, 1:36:31 PM (13 months ago)
- Location:
- _plugins_/trad-lang/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/trad-lang/trunk
- Property subgit:lock:73d892204385f27a451d3794a35f657e0c139dc1 deleted
-
Property
subgit:lock:30c22604142630630a48cc8c38d6ea6b2d96a06e
set to
2020-01-29T18:00:32.297
-
_plugins_/trad-lang/trunk/paquet.xml
r119820 r120875 6 6 compatibilite="[3.2.0;3.3.*]" 7 7 logo="images/spip_lang.png" 8 schema="1. 1.1"8 schema="1.2.0" 9 9 > 10 10 -
_plugins_/trad-lang/trunk/salvatore/lecteur.php
r119878 r120875 94 94 sql_updateq('spip_tradlang_modules', array('lang_mere' => $source['lang']), 'id_tradlang_module=' . intval($id_tradlang_module)); 95 95 salvatore_log("lang_mere mise a jour : " . $row_module['lang_mere'] . " => " . $source['lang']); 96 $row_module['lang_mere'] = $source['lang']; 96 97 $last_update = time(); 97 98 } … … 103 104 salvatore_log("dir_module mis a jour : " . $row_module['dir_module'] . " => " . $source['dir_module']); 104 105 $last_update = time(); 106 $row_module['dir_module'] = $source['dir_module']; 107 } 108 /** 109 * On met le titre a jour si jamais il a change (ou si on a change de facon de le calculer) 110 */ 111 if (($t = calculer_nom_module($source['module'], $source['dir_module'])) !== $row_module['nom_mod']) { 112 sql_updateq('spip_tradlang_modules', array('nom_mod' => $t), 'id_tradlang_module=' . intval($id_tradlang_module)); 113 salvatore_log("nom_mod mis a jour : " . $row_module['nom_mod'] . " => " . $t); 114 $last_update = time(); 115 $row_module['nom_mod'] = $t; 105 116 } 106 117 } … … 124 135 'module' => $source['module'], 125 136 'dir_module' => $source['dir_module'], 126 'nom_mod' => $source['module'],137 'nom_mod' => calculer_nom_module($source['module'],$source['dir_module']), 127 138 'lang_prefix' => $source['module'], 128 139 'lang_mere' => $source['lang'], -
_plugins_/trad-lang/trunk/tradlang_administrations.php
r119820 r120875 127 127 ); 128 128 129 $maj['1.2.0'] = array( 130 array('tradlang_nommer_modules'), 131 ); 132 129 133 include_spip('base/upgrade'); 130 134 maj_plugin($nom_meta_base_version, $version_cible, $maj); 135 } 136 137 138 function tradlang_nommer_modules() { 139 140 $res = sql_select('*', 'spip_tradlang_modules', "nom_mod=module OR nom_mod='' AND dir_module!=''"); 141 $nb = sql_count($res); 142 spip_log("tradlang_nommer_modules: $nb restants", 'maj'); 143 while($row_module = sql_fetch($res)) { 144 145 $id_tradlang_module = $row_module['id_tradlang_module']; 146 147 $set = array( 148 'nom_mod' => calculer_nom_module($row_module['module'], $row_module['dir_module']), 149 ); 150 sql_updateq("spip_tradlang_modules", $set, "id_tradlang_module=".intval($id_tradlang_module)); 151 if (time()>_TIME_OUT) { 152 return; 153 } 154 } 131 155 } 132 156 -
_plugins_/trad-lang/trunk/tradlang_options.php
r97004 r120875 38 38 return tradlang_set($id_tradlang, $c); 39 39 } 40 41 42 function dir_module_to_basename($dir_module) { 43 $s = ''; 44 if ($dir_module) { 45 $s = explode('--', $dir_module, 2); 46 $s = end($s); 47 $s = explode('-', $s); 48 array_pop($s); 49 $s = implode('-', $s); 50 } 51 return $s; 52 } 53 54 function calculer_nom_module($module, $dir_module) { 55 $nom = $module; 56 if (!$s = dir_module_to_basename($dir_module)) { 57 $s = '?'; 58 } 59 $nom .= " [$s]"; 60 return $nom; 61 }
Note: See TracChangeset
for help on using the changeset viewer.