Changeset 60

Show
Ignore:
Timestamp:
01/28/06 19:39:31 (3 years ago)
Author:
laurentj
Message:

surcharge des templates se fait maintenant uniquement dans var/themes, et option de conf usetheme est obsolète

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix-scripts/commands/createapp.cmd.php

    r11 r60  
    4040       $this->createDir(JELIX_APP_LOG_PATH); 
    4141       $this->createDir(JELIX_APP_CONFIG_PATH); 
     42       $this->createDir(JELIX_APP_VAR_PATH.'overloads/'); 
     43       $this->createDir(JELIX_APP_VAR_PATH.'themes/'); 
     44       $this->createDir(JELIX_APP_VAR_PATH.'themes/default/'); 
    4245       $this->createDir(JELIX_APP_PATH.'modules'); 
    4346       $this->createDir(JELIX_APP_PATH.'plugins'); 
  • trunk/lib/jelix-scripts/templates/config.classic.ini.php.tpl

    r53 r60  
    1818dbProfils = dbprofils.ini.php 
    1919 
    20  
    21 useTheme = false 
    2220defaultTheme = default 
    2321 
  • trunk/lib/jelix/core/jDefaultConfig.lib.php

    r53 r60  
    2626  'dbProfils' => 'dbProfils.ini.php', 
    2727 
    28   'useTheme' => '', 
    2928  'defaultTheme' => 'default', 
    3029 
  • trunk/lib/jelix/core/jSelector.class.php

    r51 r60  
    321321 
    322322        // on regarde si il y a un template red�nie pour le theme courant 
    323         if($gJConfig->useTheme){ 
    324            $overloadedPath = JELIX_APP_VAR_PATH.'themes/'.$gJConfig->defaultTheme.'/'.$this->module.'/'.$this->resource.$this->_suffix; 
    325            if (is_readable ($overloadedPath)){ 
    326               $this->_path = $overloadedPath; 
    327               $this->_where = 1; 
    328               return; 
    329            } 
    330         } 
    331  
    332         // on regarde si il y a un template red�nie 
    333         $overloadedPath = JELIX_APP_VAR_PATH.'overloads/'.$this->module.'/'.$this->_dirname.$this->resource.$this->_suffix; 
    334         if (is_readable ($overloadedPath)){ 
    335            $this->_path = $overloadedPath; 
     323         $this->_path = JELIX_APP_VAR_PATH.'themes/'.$gJConfig->defaultTheme.'/'.$this->module.'/'.$this->resource.'.tpl'; 
     324         if (is_readable ($this->_path)){ 
     325            $this->_where = 1; 
     326            return; 
     327         } 
     328 
     329        // on regarde si il y a un template red�nie dans le theme par defaut 
     330        $this->_path = JELIX_APP_VAR_PATH.'themes/default/'.$this->module.'/'.$this->resource.'.tpl'; 
     331        if (is_readable ($this->_path)){ 
    336332           $this->_where = 2; 
    337333           return; 
    338334        } 
     335 
    339336        // et sinon, on regarde si le template existe dans le module en question 
    340         $this->_path = $gJConfig->modulesPathList[$this->module].$this->_dirname.$this->resource.$this->_suffix
     337        $this->_path = $gJConfig->modulesPathList[$this->module].$this->_dirname.$this->resource.'.tpl'
    341338 
    342339        if (!is_readable ($this->_path)){ 
     
    348345 
    349346    protected function _createCachePath(){ 
    350        $d = array('modules/','themes/','overloaded/'); 
    351        if($this->_where == 1) 
    352           $d[2].=$gJConfig->defaultTheme.'/'; 
     347       $d = array('modules/','themes/'.$GLOBALS['gJConfig']->defaultTheme.'/','themes/default/'); 
    353348       // on ne partage pas le m� cache pour tous les emplacements possibles 
    354349       // au cas o�overload �it supprim�       $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/templates/'.$d[$this->_where].$this->module.'~'.$this->resource.$this->_cacheSuffix; 
    355350    } 
    356  
    357351} 
    358352 
  • trunk/lib/jelix/db/jDbPDOConnection.class.php

    r59 r60  
    1818define('JPDO_FETCH_CLASS',8); // PDO::FETCH_CLASS 
    1919define('JPDO_ATTR_STATEMENT_CLASS',13); //PDO::ATTR_STATEMENT_CLASS 
     20define('JPDO_ATTR_AUTOCOMMIT',0); //PDO::ATTR_AUTOCOMMIT 
    2021 
    2122class jDbPDOResultSet extends PDOStatement { 
     
    7677       unset($prof['driver']); 
    7778       parent::__construct($profil['dsn'], $profil['user'], $profil['password'], $prof); 
    78        $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('jDbPDOResultSet')); 
     79       $this->setAttribute(JPDO_ATTR_STATEMENT_CLASS, array('jDbPDOResultSet')); 
    7980    } 
    8081 
     
    9293    } 
    9394 
    94  
    95  
    9695    /** 
    9796    * sets the autocommit state 
     
    9998    */ 
    10099    public function setAutoCommit($state=true){ 
    101         $this->setAttribute(PDO::ATTR_AUTOCOMMIT,$state); 
     100        $this->setAttribute(JPDO_ATTR_AUTOCOMMIT,$state); 
    102101    } 
    103102 
  • trunk/myapp/var/config/config.classic.ini.php.dist

    r53 r60  
    1818dbProfils = dbprofils.ini.php 
    1919 
    20 useTheme = false 
    2120defaultTheme = default 
    2221 
  • trunk/testapp/modules/testapp/templates/main.tpl

    r38 r60  
    11<h1>Hello {$person|upper} !</h1> 
    2 <p>This is a sample html page generated by {@jelix~jelix.framework.name@}</p> 
     2<p>Ceci est une page HTML g�r�par {@jelix~jelix.framework.name@}</p> 
    33{$MAIN} 
  • trunk/testapp/responses/myHtmlResponse.class.php

    r44 r60  
    1717 
    1818 
    19        public $bodyTpl = 'testapp~main'; 
     19   public $bodyTpl = 'testapp~main'; 
    2020    public $bodyErrorTpl = 'testapp~error'; 
    2121 
     
    2525    protected function _commonProcess(){ 
    2626 
    27        $this->title .= ($this->title !=''?' - ':'').' My Sample App !'; 
     27       $this->title .= ($this->title !=''?' - ':'').' My Test App !'; 
    2828    } 
    2929 
  • trunk/testapp/var/config/config.classic.ini.php.dist

    r53 r60  
    1818dbProfils = dbprofils.ini.php 
    1919 
    20 useTheme = false 
    2120defaultTheme = default 
    2221 
     
    2524 
    2625[responses] 
    27  
     26html = myHtmlResponse 
    2827 
    2928[error_handling] 
  • trunk/testapp/var/themes/default/testapp/main.tpl

    r38 r60  
    11<h1>Hello {$person|upper} !</h1> 
    22<p>Ceci est un template surcharg�/p> 
    3 <p>Il s'agit d'un template situ�ans var/overloads/testapp/templates/, et qui 
     3<p>Il s'agit d'un template situ�ans var/themes/testapp/, et qui 
    44redefinit le template main.tpl du module testapp.</p> 
    55 
Download in other formats: Unified Diff Zip Archive