diff options
-rw-r--r-- | .gitattributes | 3 | ||||
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTabPanel.php | 22 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket876.page | 17 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket876.php | 11 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/tests/Ticket876TestCase.php | 23 |
6 files changed, 71 insertions, 6 deletions
diff --git a/.gitattributes b/.gitattributes index 01b4064e..ba36f9df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3085,6 +3085,8 @@ tests/FunctionalTests/tickets/protected/pages/Ticket769.page -text tests/FunctionalTests/tickets/protected/pages/Ticket785.page -text tests/FunctionalTests/tickets/protected/pages/Ticket828.page -text tests/FunctionalTests/tickets/protected/pages/Ticket849.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket876.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket876.php -text tests/FunctionalTests/tickets/protected/pages/Ticket886.page -text tests/FunctionalTests/tickets/protected/pages/Ticket886.php -text tests/FunctionalTests/tickets/protected/pages/Ticket897.page -text @@ -3152,6 +3154,7 @@ tests/FunctionalTests/tickets/tests/Ticket703TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket708TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket72TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket769TestCase.php -text +tests/FunctionalTests/tickets/tests/Ticket876TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket886TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket897TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket93TestCase.php -text @@ -19,6 +19,7 @@ BUG: Ticket#904 - TDbConnection: Add emulate prepares workaround for boolean com BUG: Ticket#908 - TDbCache::init / Exception (Knut) ENH: Added Prado.Validation.validateControl(id) on client side to validate a specific control (Michael) ENH: Added MessageSource_Database to I18N (uses TDbConnection) (Michael) +ENH: Ticket#876 - Assign empty string to CssUrl on TTabPanel to avoid loading extra css (GoDZilla, Knut) ENH: Ticket#890 - Minor optimization: Use $var===null over is_null($var) (Knut) ENH: Ticket#893 - Added page parameter to queryForPagedList() to specify the initial page to load (Michael) ENH: Ticket#896 - TTheme - enhance for subclassing (Knut) 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 <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
* @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 }
}
-?> +?>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket876.page b/tests/FunctionalTests/tickets/protected/pages/Ticket876.page new file mode 100644 index 00000000..af673461 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket876.page @@ -0,0 +1,17 @@ +<com:TContent ID="Content"> + + <com:TButton ID="Button" Text="Set empty CssUrl" OnClick="onSetEmptyCssUrl"/> + + <com:TTabPanel ID="TabPanel"> + <com:TTabView Caption="View 1"> + content for view 1 + </com:TTabView> + <com:TTabView Caption="View 2"> + content for view 2 + </com:TTabView> + <com:TTabView Caption="View 3"> + content for view 3 + </com:TTabView> + </com:TTabPanel> + +</com:TContent> diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket876.php b/tests/FunctionalTests/tickets/protected/pages/Ticket876.php new file mode 100644 index 00000000..e95a677c --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket876.php @@ -0,0 +1,11 @@ +<?php + +class Ticket876 extends TPage { + + public function onSetEmptyCssUrl($sender, $param) { + $this->TabPanel->CssUrl = ""; + } + +} + +?> diff --git a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php new file mode 100644 index 00000000..0ad9ebfa --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php @@ -0,0 +1,23 @@ +<?php + +class Ticket876TestCase extends SeleniumTestCase { + + public function test() { + $this->open('tickets/index.php?page=Ticket876'); + $this->assertTitle("Verifying Ticket 876"); + $base = 'ctl0_Content_'; + + $this->assertElementPresent('xpath=//link[@rel="stylesheet"]'); + $this->clickAndWait($base.'Button'); + $this->assertElementNotPresent('xpath=//link[@rel="stylesheet"]'); + + /*$this->select($base.'Date_month', 10); + $this->select($base.'Date_day', 22); + + $this->clickAndWait($base.'SendButton'); + $this->assertTextPresent('2008-10-22');*/ + } + +} + +?> |