Changeset 1036:4374df1baa97 for plugins/themeEditor/class.themeEditor.php
- Timestamp:
- 11/26/12 13:27:11 (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 {
Note: See TracChangeset
for help on using the changeset viewer.