summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2005-11-20 16:51:20 +0000
committerxue <>2005-11-20 16:51:20 +0000
commit3ddbcb8e4bf8667998d368b07dd2dac017122610 (patch)
tree047a5c7331bf5ccb8058394f27536f588a47f1a3 /framework/Web
parentfd8382b03df7243195b38562c8dac7eb45796657 (diff)
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/TTemplateManager.php19
-rw-r--r--framework/Web/UI/TThemeManager.php29
2 files changed, 35 insertions, 13 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 81fb7704..6b9ccfc0 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -15,17 +15,12 @@
*
* TTemplateManager manages the loading and parsing of control templates.
*
- * By default, TTemplateManager is registered with {@link TPageService} as the
- * template manager module that can be accessed via {@link TPageService::getTemplateManager()}.
- *
* Given a class name, TTemplateManager tries to locate the corresponding template
* file under the directory containing the class file. The name of the template file
* is the class name with the extension '.tpl'.
- * where {@link getCacheExpire CacheExpire}, {@link getCacheControl CacheControl}
- * and {@link getBufferOutput BufferOutput} are configurable properties of THttpResponse.
*
- * If cache is enabled for the application, TTemplateManager will try to make
- * of the cache to save the parsing time.
+ * By default, TTemplateManager is registered with {@link TPageService} as the
+ * template manager module that can be accessed via {@link TPageService::getTemplateManager()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
@@ -186,6 +181,8 @@ class TTemplate extends TComponent implements ITemplate
* Constructor.
* The template will be parsed after construction.
* @param string the template string
+ * @param string the template context directory
+ * @param string the template file, null if no file
*/
public function __construct($template,$contextPath,$tplFile=null)
{
@@ -202,7 +199,10 @@ class TTemplate extends TComponent implements ITemplate
return $this->_directive;
}
- public function getItems()
+ /**
+ * @return array the parsed template
+ */
+ public function &getItems()
{
return $this->_tpl;
}
@@ -389,10 +389,9 @@ class TTemplate extends TComponent implements ITemplate
* If an object has no container, its container index is -1.
*
* @param string the template string
- * @return array the parsed result
* @throws TTemplateParsingException if a parsing error is encountered
*/
- protected function &parse($input)
+ protected function parse($input)
{
$tpl=&$this->_tpl;
$n=preg_match_all(self::REGEX_RULES,$input,$matches,PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php
index 47c32a2e..b2b205ed 100644
--- a/framework/Web/UI/TThemeManager.php
+++ b/framework/Web/UI/TThemeManager.php
@@ -1,6 +1,29 @@
<?php
-
-
+/**
+ * TThemeManager class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI
+ */
+
+/**
+ * TThemeManager class
+ *
+ * TThemeManager manages the themes used in a Prado application.
+ *
+ * Themes are stored in under {@link setBasePath BasePath} that can be accessed
+ * via URL {@link setBaseUrl BaseUrl}. Each theme is defined by a subdirectory
+ * and all the files under that directory.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI
+ * @since 3.0
+ */
class TThemeManager extends TComponent implements IModule
{
const THEME_CACHE_PREFIX='prado:theme:';
@@ -71,7 +94,7 @@ class TThemeManager extends TComponent implements IModule
$themeUrl=$appUrl.'/'.strtr(substr($themePath,strlen($appPath)),'\\','/');
}
else
- $themeUrl=$baseUrl.'/'.basename($themePath);
+ $themeUrl=$this->_baseUrl.'/'.basename($themePath);
return new TTheme($this->_application,$themePath,$themeUrl);
}