2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/* SVN FILE: $Id$ */
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* A custom view class that is used for themeing
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
|
|
|
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
|
|
|
* @filesource
|
2008-10-30 17:30:26 +00:00
|
|
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs.view
|
|
|
|
* @since CakePHP(tm) v 0.10.0.1076
|
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Theme view class
|
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs.view
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ThemeView extends View {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* System path to themed element: themed . DS . theme . DS . elements . DS
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $themeElement = null;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* System path to themed layout: themed . DS . theme . DS . layouts . DS
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $themeLayout = null;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* System path to themed: themed . DS . theme . DS
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $themePath = null;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @param unknown_type $controller
|
|
|
|
*/
|
2009-07-26 10:46:07 +00:00
|
|
|
function __construct(&$controller) {
|
2008-05-30 11:40:08 +00:00
|
|
|
parent::__construct($controller);
|
2008-06-20 11:57:56 +00:00
|
|
|
$this->theme =& $controller->theme;
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2008-06-20 11:57:56 +00:00
|
|
|
if (!empty($this->theme)) {
|
|
|
|
if (is_dir(WWW_ROOT . 'themed' . DS . $this->theme)) {
|
|
|
|
$this->themeWeb = 'themed/'. $this->theme .'/';
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
/* deprecated: as of 6128 the following properties are no longer needed */
|
2008-06-20 11:57:56 +00:00
|
|
|
$this->themeElement = 'themed'. DS . $this->theme . DS .'elements'. DS;
|
|
|
|
$this->themeLayout = 'themed'. DS . $this->theme . DS .'layouts'. DS;
|
|
|
|
$this->themePath = 'themed'. DS . $this->theme . DS;
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return all possible paths to find view files in order
|
|
|
|
*
|
|
|
|
* @param string $plugin
|
|
|
|
* @return array paths
|
|
|
|
* @access private
|
|
|
|
*/
|
|
|
|
function _paths($plugin = null, $cached = true) {
|
|
|
|
$paths = parent::_paths($plugin, $cached);
|
|
|
|
|
|
|
|
if (!empty($this->theme)) {
|
|
|
|
$count = count($paths);
|
|
|
|
for ($i = 0; $i < $count; $i++) {
|
|
|
|
$themePaths[] = $paths[$i] . 'themed'. DS . $this->theme . DS;
|
|
|
|
}
|
|
|
|
$paths = array_merge($themePaths, $paths);
|
|
|
|
}
|
|
|
|
|
2008-10-23 00:10:44 +00:00
|
|
|
if (empty($this->__paths)) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->__paths = $paths;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $paths;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|