summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TTableHeaderCell.php
diff options
context:
space:
mode:
authorxue <>2006-09-04 19:15:47 +0000
committerxue <>2006-09-04 19:15:47 +0000
commit56fee292c37e162c03fab9eeadd6a8b9ab85c251 (patch)
tree923510b93c707868098ae4e5f404eb3766a59553 /framework/Web/UI/WebControls/TTableHeaderCell.php
parentb107cad91733d4a2a80f42cdbaab41a4f7b41c9d (diff)
merge from 3.0 branch till 1387
Diffstat (limited to 'framework/Web/UI/WebControls/TTableHeaderCell.php')
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderCell.php35
1 files changed, 28 insertions, 7 deletions
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 <qiang.xue@gmail.com>
+ * @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