Dotclear

Changeset 1037:20df3c7bdb5c


Ignore:
Timestamp:
11/26/12 13:39:46 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Only main.po (public) locales files are editable by the theme editor plugin, fixes #438 (see also previous revision)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/themeEditor/class.themeEditor.php

    r1036 r1037  
    243243          foreach ($langs as $k => $v) { 
    244244               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       
    251      protected function getFilesInDir($dir,$ext=null,$prefix='') 
     245                    $this->po = array_merge($this->po,$this->getFilesInDir($this->parent_theme.'/locales/'.$v,'po',$v.'/','main.po')); 
     246               } 
     247               $this->po = array_merge($this->po,$this->getFilesInDir($this->user_theme.'/locales/'.$v,'po',$v.'/','main.po')); 
     248          } 
     249     } 
     250      
     251     protected function getFilesInDir($dir,$ext=null,$prefix='',$model=null) 
    252252     { 
    253253          $dir = path::real($dir); 
     
    261261          { 
    262262               if (is_file($dir.'/'.$f) && !preg_match('/^\./',$f) && (!$ext || preg_match('/\.'.preg_quote($ext).'$/i',$f))) { 
    263                     $res[$prefix.$f] = $dir.'/'.$f; 
     263                    if (!$model || preg_match('/^'.preg_quote($model).'$/i', $f)) { 
     264                         $res[$prefix.$f] = $dir.'/'.$f; 
     265                    } 
    264266               } 
    265267          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map