From 1988e9cd45fce05d26f0682f6d1cbdfb72cd2370 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 28 Jun 2006 20:29:33 +0000 Subject: Enhanced some error description. --- framework/Web/UI/TThemeManager.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/TThemeManager.php') diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 66bfa8be..245f8049 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -10,6 +10,8 @@ * @package System.Web.UI */ +Prado::using('System.Web.Services.TPageService'); + /** * TThemeManager class * @@ -63,7 +65,11 @@ class TThemeManager extends TModule public function init($config) { $this->_initialized=true; - $this->getService()->setThemeManager($this); + $service=$this->getService(); + if($service instanceof TPageService) + $service->setThemeManager($this); + else + throw new TConfigurationException('thememanager_service_unavailable'); } /** @@ -105,7 +111,7 @@ class TThemeManager extends TModule { $this->_basePath=dirname($this->getRequest()->getApplicationFilePath()).'/'.self::DEFAULT_BASEPATH; if(($basePath=realpath($this->_basePath))===false || !is_dir($basePath)) - throw new TConfigurationException('thememanager_basepath_invalid',$this->_basePath); + throw new TConfigurationException('thememanager_basepath_invalid2',$this->_basePath); $this->_basePath=$basePath; } return $this->_basePath; -- cgit v1.2.3