From 4c9067bf7ae89b446bb0e236ab20c5b4fa3ee3e3 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 15 Nov 2005 15:34:38 +0000 Subject: Added a new template/theme syntax for URL support. --- framework/Web/UI/TControl.php | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'framework/Web/UI/TControl.php') diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index 21c633c7..fbdc81ee 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -69,10 +69,6 @@ class TControl extends TComponent * prefix to an ID automatically generated */ const AUTOMATIC_ID_PREFIX='ctl'; - /** - * default control asset path - */ - const ASSET_PATH='assets'; /** * the stage of lifecycles that the control is currently at @@ -302,26 +298,11 @@ class TControl extends TComponent return Prado::getApplication()->getUser(); } - public function publishFile($file) - { - return $this->getService()->getAssetManager()->publishFile($file); - } - - public function publishDirectory($directory) - { - return $this->getService()->getAssetManager()->publishDirectory($directory); - } - - public function getAsset($assetName) + public function getAsset($assetPath) { $class=new ReflectionClass(get_class($this)); - $assetFile=dirname($class->getFileName()).'/'.self::ASSET_PATH.'/'.$assetName; - if(is_file($assetFile)) - return $this->publishFile($assetFile); - else if(is_dir($assetFile)) - return $this->publishDirectory($assetFile); - else - return ''; + $assetPath=dirname($class->getFileName()).'/'.$assetPath; + return $this->getService()->getAssetManager()->publishFilePath($assetPath); } /** -- cgit v1.2.3