Changeset 431

Show
Ignore:
Timestamp:
05/02/07 17:54:37 (2 years ago)
Author:
laurentj
Message:

templates can be language specific: it should be stored in xx_YY subdirectories in templates directory

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix-plugins/auth/auth.plugin.ini.php.dist

    r386 r431  
    3838error_message = "" 
    3939 
    40 ;=========== Exemples de paramètres pour un module 
     40;=========== Paramètres pour le module jauth 
    4141 
    4242; nombre de secondes d'attentes aprés un défaut d'authentification 
    43 ;on_error_sleep = 3 
     43on_error_sleep = 3 
    4444 
    45 ;enable_after_login_override = off 
    46 ;after_login = 
     45enable_after_login_override = off 
     46after_login = "" 
    4747 
    48 ;enable_after_logout_override = off 
    49 ;after_logout = "" 
     48enable_after_logout_override = off 
     49after_logout = "" 
    5050 
    5151;=========== Paramètres pour les drivers 
  • trunk/lib/jelix/core/jSelector.class.php

    r430 r431  
    556556        } 
    557557 
    558         // on regarde si il y a un template redéfinie pour le theme courant 
    559          $this->_path = JELIX_APP_VAR_PATH.'themes/'.$gJConfig->defaultTheme.'/'.$this->module.'/'.$this->resource.'.tpl'; 
    560          if (is_readable ($this->_path)){ 
    561             $this->_where = 1; 
     558        if($gJConfig->defaultTheme != 'default'){ 
     559            // on regarde si il y a un template redéfinie pour le theme courant 
     560            $this->_where = 'themes/'.$gJConfig->defaultTheme.'/'.$this->module.'/'.$gJConfig->defaultLocale.'/'.$this->resource; 
     561            $this->_path = JELIX_APP_VAR_PATH.$this->_where.'.tpl'; 
     562            if (is_readable ($this->_path)){ 
     563                return; 
     564            } 
     565            // on regarde si il y a un template redéfinie pour le theme courant 
     566            $this->_where = 'themes/'.$gJConfig->defaultTheme.'/'.$this->module.'/'.$this->resource; 
     567            $this->_path = JELIX_APP_VAR_PATH.$this->_where.'.tpl'; 
     568            if (is_readable ($this->_path)){ 
     569                return; 
     570            } 
     571        } 
     572 
     573        // on regarde si il y a un template redéfinie dans le theme par defaut 
     574        $this->_where = 'themes/default/'.$this->module.'/'.$gJConfig->defaultLocale.'/'.$this->resource; 
     575        $this->_path = JELIX_APP_VAR_PATH.$this->_where.'.tpl'; 
     576        if (is_readable ($this->_path)){ 
    562577            return; 
    563        
    564  
    565         // on regarde si il y a un template redéfinie dans le theme par defaut 
    566         $this->_path = JELIX_APP_VAR_PATH.'themes/default/'.$this->module.'/'.$this->resource.'.tpl'; 
     578       
     579 
     580        $this->_where = 'themes/default/'.$this->module.'/'.$this->resource; 
     581        $this->_path = JELIX_APP_VAR_PATH.$this->_where.'.tpl'; 
    567582        if (is_readable ($this->_path)){ 
    568            $this->_where = 2; 
    569            return; 
     583            return; 
    570584        } 
    571585 
    572586        // et sinon, on regarde si le template existe dans le module en question 
     587        $this->_path = $gJConfig->_modulesPathList[$this->module].$this->_dirname.$gJConfig->defaultLocale.'/'.$this->resource.'.tpl'; 
     588        if (is_readable ($this->_path)){ 
     589            $this->_where = 'modules/'.$this->module.'/'.$gJConfig->defaultLocale.'/'.$this->resource; 
     590            return; 
     591        } 
     592 
    573593        $this->_path = $gJConfig->_modulesPathList[$this->module].$this->_dirname.$this->resource.'.tpl'; 
    574  
    575         if (!is_readable ($this->_path)){ 
    576             throw new jExceptionSelector('jelix~errors.selector.invalid.target', array($this->toString(), "template")); 
    577         } 
    578         $this->_where = 0; 
     594        if (is_readable ($this->_path)){ 
     595            $this->_where = 'modules/'.$this->module.'/'.$this->resource; 
     596            return; 
     597        } 
     598 
     599        throw new jExceptionSelector('jelix~errors.selector.invalid.target', array($this->toString(), "template")); 
     600 
    579601    } 
    580602 
    581603    protected function _createCachePath(){ 
    582        $d = array('modules/','themes/'.$GLOBALS['gJConfig']->defaultTheme.'/','themes/default/'); 
    583604       // on ne partage pas le même cache pour tous les emplacements possibles 
    584605       // au cas où un overload était supprimé 
    585        $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/templates/'.$d[$this->_where].$this->module.'~'.$this->resource.$this->_cacheSuffix; 
     606       $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/templates/'.$this->_where.$this->_cacheSuffix; 
    586607    } 
    587608} 
Download in other formats: Unified Diff Zip Archive