Changeset 60
- Timestamp:
- 01/28/06 19:39:31 (3 years ago)
- Files:
-
- trunk/lib/jelix-scripts/commands/createapp.cmd.php (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/config.classic.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix/core/jDefaultConfig.lib.php (modified) (1 diff)
- trunk/lib/jelix/core/jSelector.class.php (modified) (2 diffs)
- trunk/lib/jelix/db/jDbPDOConnection.class.php (modified) (4 diffs)
- trunk/myapp/var/config/config.classic.ini.php.dist (modified) (1 diff)
- trunk/myapp/var/overloads/myapp/templates (deleted)
- trunk/testapp/modules/testapp/templates/main.tpl (modified) (1 diff)
- trunk/testapp/responses/myHtmlResponse.class.php (modified) (2 diffs)
- trunk/testapp/var/config/config.classic.ini.php.dist (modified) (2 diffs)
- trunk/testapp/var/overloads/testapp/templates (deleted)
- trunk/testapp/var/themes/default/testapp (added)
- trunk/testapp/var/themes/default/testapp/main.tpl (copied) (copied from trunk/testapp/var/overloads/testapp/templates/main.tpl) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix-scripts/commands/createapp.cmd.php
r11 r60 40 40 $this->createDir(JELIX_APP_LOG_PATH); 41 41 $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/'); 42 45 $this->createDir(JELIX_APP_PATH.'modules'); 43 46 $this->createDir(JELIX_APP_PATH.'plugins'); trunk/lib/jelix-scripts/templates/config.classic.ini.php.tpl
r53 r60 18 18 dbProfils = dbprofils.ini.php 19 19 20 21 useTheme = false22 20 defaultTheme = default 23 21 trunk/lib/jelix/core/jDefaultConfig.lib.php
r53 r60 26 26 'dbProfils' => 'dbProfils.ini.php', 27 27 28 'useTheme' => '',29 28 'defaultTheme' => 'default', 30 29 trunk/lib/jelix/core/jSelector.class.php
r51 r60 321 321 322 322 // 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)){ 336 332 $this->_where = 2; 337 333 return; 338 334 } 335 339 336 // 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'; 341 338 342 339 if (!is_readable ($this->_path)){ … … 348 345 349 346 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/'); 353 348 // on ne partage pas le m� cache pour tous les emplacements possibles 354 349 // au cas o�overload �it supprim� $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/templates/'.$d[$this->_where].$this->module.'~'.$this->resource.$this->_cacheSuffix; 355 350 } 356 357 351 } 358 352 trunk/lib/jelix/db/jDbPDOConnection.class.php
r59 r60 18 18 define('JPDO_FETCH_CLASS',8); // PDO::FETCH_CLASS 19 19 define('JPDO_ATTR_STATEMENT_CLASS',13); //PDO::ATTR_STATEMENT_CLASS 20 define('JPDO_ATTR_AUTOCOMMIT',0); //PDO::ATTR_AUTOCOMMIT 20 21 21 22 class jDbPDOResultSet extends PDOStatement { … … 76 77 unset($prof['driver']); 77 78 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')); 79 80 } 80 81 … … 92 93 } 93 94 94 95 96 95 /** 97 96 * sets the autocommit state … … 99 98 */ 100 99 public function setAutoCommit($state=true){ 101 $this->setAttribute( PDO::ATTR_AUTOCOMMIT,$state);100 $this->setAttribute(JPDO_ATTR_AUTOCOMMIT,$state); 102 101 } 103 102 trunk/myapp/var/config/config.classic.ini.php.dist
r53 r60 18 18 dbProfils = dbprofils.ini.php 19 19 20 useTheme = false21 20 defaultTheme = default 22 21 trunk/testapp/modules/testapp/templates/main.tpl
r38 r60 1 1 <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> 3 3 {$MAIN} trunk/testapp/responses/myHtmlResponse.class.php
r44 r60 17 17 18 18 19 public $bodyTpl = 'testapp~main';19 public $bodyTpl = 'testapp~main'; 20 20 public $bodyErrorTpl = 'testapp~error'; 21 21 … … 25 25 protected function _commonProcess(){ 26 26 27 $this->title .= ($this->title !=''?' - ':'').' My SampleApp !';27 $this->title .= ($this->title !=''?' - ':'').' My Test App !'; 28 28 } 29 29 trunk/testapp/var/config/config.classic.ini.php.dist
r53 r60 18 18 dbProfils = dbprofils.ini.php 19 19 20 useTheme = false21 20 defaultTheme = default 22 21 … … 25 24 26 25 [responses] 27 26 html = myHtmlResponse 28 27 29 28 [error_handling] trunk/testapp/var/themes/default/testapp/main.tpl
r38 r60 1 1 <h1>Hello {$person|upper} !</h1> 2 2 <p>Ceci est un template surcharg�/p> 3 <p>Il s'agit d'un template situ�ans var/ overloads/testapp/templates/, et qui3 <p>Il s'agit d'un template situ�ans var/themes/testapp/, et qui 4 4 redefinit le template main.tpl du module testapp.</p> 5 5
