From b26ef59b9ffbc9b8dfa15b6456fd0071474b9608 Mon Sep 17 00:00:00 2001 From: knut <> Date: Mon, 18 Aug 2008 23:00:14 +0000 Subject: fixed #876 --- framework/Web/UI/WebControls/TTabPanel.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php index 6688211e..961d0797 100644 --- a/framework/Web/UI/WebControls/TTabPanel.php +++ b/framework/Web/UI/WebControls/TTabPanel.php @@ -4,7 +4,7 @@ * * @author Tomasz Wolny and Qiang Xue * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.WebControls @@ -175,7 +175,7 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler */ public function getCssUrl() { - return $this->getViewState('CssUrl',''); + return $this->getViewState('CssUrl','default'); } /** @@ -383,9 +383,19 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler */ protected function registerStyleSheet() { - if(($url=$this->getCssUrl())==='') - $url=$this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css'); - $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url); + $url = $this->getCssUrl(); + + if($url === '') { + return; + } + + if($url === 'default') { + $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css'); + } + + if($url !== '') { + $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); + } } /** @@ -684,4 +694,4 @@ class TTabViewCollection extends TControlCollection } } -?> +?> -- cgit v1.2.3