From e83edc3f20163ac25e2307f9c854e7bc9384970c Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 4 Sep 2006 18:12:17 +0000 Subject: Finished updating code related with enumerable data types. --- framework/Web/UI/WebControls/TTableHeaderCell.php | 35 ++++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'framework/Web/UI/WebControls/TTableHeaderCell.php') diff --git a/framework/Web/UI/WebControls/TTableHeaderCell.php b/framework/Web/UI/WebControls/TTableHeaderCell.php index 12009de6..497b2088 100644 --- a/framework/Web/UI/WebControls/TTableHeaderCell.php +++ b/framework/Web/UI/WebControls/TTableHeaderCell.php @@ -43,8 +43,8 @@ class TTableHeaderCell extends TTableCell protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); - if(($scope=$this->getScope())!=='NotSet') - $writer->addAttribute('scope',$scope==='Row'?'row':'col'); + if(($scope=$this->getScope())!==TTableHeaderScope::NotSet) + $writer->addAttribute('scope',$scope===TTableHeaderScope::Row?'row':'col'); if(($text=$this->getAbbreviatedText())!=='') $writer->addAttribute('abbr',$text); if(($text=$this->getCategoryText())!=='') @@ -52,20 +52,19 @@ class TTableHeaderCell extends TTableCell } /** - * @return string the scope of the cells that the header cell applies to. Defaults to 'NotSet'. + * @return TTableHeaderScope the scope of the cells that the header cell applies to. Defaults to TTableHeaderScope::NotSet. */ public function getScope() { - return $this->getViewState('Scope','NotSet'); + return $this->getViewState('Scope',TTableHeaderScope::NotSet); } /** - * @param string the scope of the cells that the header cell applies to. - * Valid values include 'NotSet','Row','Column'. + * @param TTableHeaderScope the scope of the cells that the header cell applies to. */ public function setScope($value) { - $this->setViewState('Scope',TPropertyValue::ensureEnum($value,'NotSet','Row','Column'),'NotSet'); + $this->setViewState('Scope',TPropertyValue::ensureEnum($value,'TTableHeaderScope'),TTableHeaderScope::NotSet); } /** @@ -101,4 +100,26 @@ class TTableHeaderCell extends TTableCell } } + +/** + * TTableHeaderScope class. + * TTableHeaderScope defines the enumerable type for the possible table scopes that a table header is associated with. + * + * The following enumerable values are defined: + * - NotSet: the scope is not specified + * - Row: the scope is row-wise + * - Column: the scope is column-wise + * + * @author Qiang Xue + * @version $Revision: $ $Date: $ + * @package System.Web.UI.WebControls + * @since 3.0.4 + */ +class TTableHeaderScope extends TEnumerable +{ + const NotSet='NotSet'; + const Row='Row'; + const Column='Column'; +} + ?> \ No newline at end of file -- cgit v1.2.3