Changeset 1036:4374df1baa97
- Timestamp:
- 11/26/12 13:27:11 (13 years ago)
- Branch:
- default
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
locales/fr/plugins.po
r1011 r1036 1621 1621 msgstr "Fichiers JavaScript" 1622 1622 1623 msgid "Locales files" 1624 msgstr "Fichiers de traduction" 1625 1623 1626 msgid "user:preferences" 1624 1627 msgstr "user:preferences" -
plugins/themeEditor/class.themeEditor.php
r270 r1036 24 24 public $css = array(); 25 25 public $js = array(); 26 public $po = array(); 26 27 27 28 public function __construct($core) … … 39 40 $this->findStyles(); 40 41 $this->findScripts(); 42 $this->findLocales(); 41 43 } 42 44 … … 106 108 } 107 109 110 if ($type == 'po' && !is_dir(dirname($dest))) { 111 files::makeDir(dirname($dest)); 112 } 113 108 114 $fp = @fopen($dest,'wb'); 109 115 if (!$fp) { … … 130 136 if ($type == 'tpl') { 131 137 $dest = $this->user_theme.'/tpl/'.$f; 138 } elseif ($type == 'po') { 139 $dest = $this->user_theme.'/locales/'.$f; 132 140 } else { 133 141 $dest = $this->user_theme.'/'.$f; … … 143 151 } 144 152 } 145 153 154 if ($type == 'po' && !is_dir(dirname($dest))) { 155 if (is_writable($this->user_theme)) { 156 return $dest; 157 } 158 } 159 146 160 if (is_writable(dirname($dest))) { 147 161 return $dest; … … 161 175 case 'js': 162 176 return $this->js; 177 case 'po': 178 return $this->po; 163 179 default: 164 180 return array(); … … 178 194 case 'js': 179 195 $list =& $this->js; 196 break; 197 case 'po': 198 $list =& $this->po; 180 199 break; 181 200 default: … … 219 238 } 220 239 240 protected function findLocales() 241 { 242 $langs = l10n::getISOcodes(1,1); 243 foreach ($langs as $k => $v) { 244 if ($this->parent_theme) { 245 $this->po = array_merge($this->po,$this->getFilesInDir($this->parent_theme.'/locales/'.$v,'po',$v.'/')); 246 } 247 $this->po = array_merge($this->po,$this->getFilesInDir($this->user_theme.'/locales/'.$v,'po',$v.'/')); 248 } 249 } 250 221 251 protected function getFilesInDir($dir,$ext=null,$prefix='') 222 252 { -
plugins/themeEditor/index.php
r997 r1036 36 36 } elseif (!empty($_REQUEST['js'])) { 37 37 $file = $o->getFileContent('js',$_REQUEST['js']); 38 } elseif (!empty($_REQUEST['po'])) { 39 $file = $o->getFileContent('po',$_REQUEST['po']); 38 40 } 39 41 } … … 126 128 127 129 if ($user_ui_colorsyntax) { 128 $editorMode = (!empty($_REQUEST['css']) ? "css" : (!empty($_REQUEST['js']) ? "javascript" : "text/html")); 130 $editorMode = 131 (!empty($_REQUEST['css']) ? "css" : 132 (!empty($_REQUEST['js']) ? "javascript" : 133 (!empty($_REQUEST['po']) ? "text/plain" : "text/html"))); 129 134 echo 130 135 '<script> … … 166 171 <h3><?php echo __('JavaScript files'); ?></h3> 167 172 <?php echo $o->filesList('js','<a href="'.$p_url.'&js=%2$s" class="js-link">%1$s</a>'); ?> 173 174 <h3><?php echo __('Locales files'); ?></h3> 175 <?php echo $o->filesList('po','<a href="'.$p_url.'&po=%2$s" class="po-link">%1$s</a>'); ?> 168 176 </div> 169 177
Note: See TracChangeset
for help on using the changeset viewer.