summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorGODZilla0480@gmail.com <>2011-08-30 13:58:52 +0000
committerGODZilla0480@gmail.com <>2011-08-30 13:58:52 +0000
commit826209441942e71e9efc658b44b2077ddfd5b379 (patch)
tree8830c939d02b899936f9bb98f7ad38c7c21c0965 /framework
parent1594d8562b7c45ce67a4a39e6090bf59e20d91f1 (diff)
Fixed Issue#362
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/UI/TThemeManager.php38
1 files changed, 31 insertions, 7 deletions
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php
index ba4fa81d..9fb138bb 100644
--- a/framework/Web/UI/TThemeManager.php
+++ b/framework/Web/UI/TThemeManager.php
@@ -44,6 +44,17 @@ class TThemeManager extends TModule
* default themes base path
*/
const DEFAULT_BASEPATH='themes';
+
+ /**
+ * default theme class
+ */
+ const DEFAULT_THEMECLASS = 'TTheme';
+
+ /**
+ * @var string
+ */
+ private $_themeClass=self::DEFAULT_THEMECLASS;
+
/**
* @var boolean whether this module has been initialized
*/
@@ -80,8 +91,21 @@ class TThemeManager extends TModule
{
$themePath=$this->getBasePath().DIRECTORY_SEPARATOR.$name;
$themeUrl=rtrim($this->getBaseUrl(),'/').'/'.$name;
- return new TTheme($themePath,$themeUrl);
+ return Prado::createComponent($this->getThemeClass(), $themePath, $themeUrl);
+ }
+
+ /**
+ * @param string|null $class Theme class name in namespace format
+ */
+ public function setThemeClass($class) {
+ $this->_themeClass = $class===null ? self::DEFAULT_THEMECLASS : (string)$class;
+ }
+ /**
+ * @return string Theme class name in namespace format. Defaults to {@link TThemeManager::DEFAULT_THEMECLASS DEFAULT_THEMECLASS}.
+ */
+ public function getThemeClass() {
+ return $this->_themeClass;
}
/**
@@ -328,7 +352,7 @@ class TTheme extends TApplicationComponent implements ITheme
return $this->_name;
}
- /**
+ /**
* @param string theme name
*/
protected function setName($value)
@@ -344,7 +368,7 @@ class TTheme extends TApplicationComponent implements ITheme
return $this->_themeUrl;
}
- /**
+ /**
* @param string the URL to the theme folder
*/
protected function setBaseUrl($value)
@@ -360,14 +384,14 @@ class TTheme extends TApplicationComponent implements ITheme
return $this->_themePath;
}
- /**
+ /**
* @param string tthe file path to the theme folder
*/
protected function setBasePath($value)
{
$this->_themePath=$value;
}
-
+
/**
* @return array list of skins for the theme
*/
@@ -376,7 +400,7 @@ class TTheme extends TApplicationComponent implements ITheme
return $this->_skins;
}
- /**
+ /**
* @param array list of skins for the theme
*/
protected function setSkins($value)
@@ -465,7 +489,7 @@ class TTheme extends TApplicationComponent implements ITheme
return $this->_cssFiles;
}
- /**
+ /**
* @param array list of CSS files (URL) in the theme
*/
protected function setStyleSheetFiles($value)