summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TTableHeaderCell.php
diff options
context:
space:
mode:
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