Changeset 577

Show
Ignore:
Timestamp:
05/01/08 14:08:32 (2 years ago)
Author:
bermiferrer
Message:

Allowing layout switching on modules. Making layout setting a little more tolerant. Now you can include the .tpl extension and Akelos will not complain.

Reported at http://forum.akelos.org/discussion/383/layout-setting/

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActionController.php

    r570 r577  
    14501450        } 
    14511451        if(!empty($layout)){ 
     1452 
    14521453            $layout = strstr($layout,'/') || strstr($layout,DS) ? $layout : 'layouts'.DS.$layout; 
     1454            $layout = preg_replace('/\.tpl$/', '', $layout); 
     1455 
    14531456            $layout = substr($layout,0,7) === 'layouts' ? 
    1454             (empty($this->_module_path) ? AK_VIEWS_DIR.DS.$layout.'.tpl' : AK_VIEWS_DIR.DS.'layouts'.DS.trim($this->_module_path, DS).'.tpl') : 
     1457            (empty($this->_module_path) || !empty($this->layout) ? AK_VIEWS_DIR.DS.$layout.'.tpl' : AK_VIEWS_DIR.DS.'layouts'.DS.trim($this->_module_path, DS).'.tpl') : 
    14551458            $layout.'.tpl'; 
     1459 
    14561460            if (file_exists($layout)) { 
    14571461                return $layout;