]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/framework/Web/UI/WebControls/TTableHeaderCell.php
43b21b45295943d85d6d7564225d140460a8315b
[bacula/bacula] / gui / baculum / framework / Web / UI / WebControls / TTableHeaderCell.php
1 <?php
2 /**
3  * TTableHeaderCell class file
4  *
5  * @author Qiang Xue <qiang.xue@gmail.com>
6  * @link http://www.pradosoft.com/
7  * @copyright Copyright &copy; 2005-2014 PradoSoft
8  * @license http://www.pradosoft.com/license/
9  * @package System.Web.UI.WebControls
10  */
11
12 /**
13  * Includes TTableCell class
14  */
15 Prado::using('System.Web.UI.WebControls.TTableCell');
16
17
18 /**
19  * TTableHeaderCell class.
20  *
21  * TTableHeaderCell displays a table header cell on a Web page.
22  *
23  * @author Qiang Xue <qiang.xue@gmail.com>
24  * @package System.Web.UI.WebControls
25  * @since 3.0
26  */
27 class TTableHeaderCell extends TTableCell
28 {
29         /**
30          * @return string tag name for the table header cell
31          */
32         protected function getTagName()
33         {
34                 return 'th';
35         }
36
37         /**
38          * Adds attributes to renderer.
39          * @param THtmlWriter the renderer
40          */
41         protected function addAttributesToRender($writer)
42         {
43                 parent::addAttributesToRender($writer);
44                 if(($scope=$this->getScope())!==TTableHeaderScope::NotSet)
45                         $writer->addAttribute('scope',$scope===TTableHeaderScope::Row?'row':'col');
46                 if(($text=$this->getAbbreviatedText())!=='')
47                         $writer->addAttribute('abbr',$text);
48                 if(($text=$this->getCategoryText())!=='')
49                         $writer->addAttribute('axis',$text);
50         }
51
52         /**
53          * @return TTableHeaderScope the scope of the cells that the header cell applies to. Defaults to TTableHeaderScope::NotSet.
54          */
55         public function getScope()
56         {
57                 return $this->getViewState('Scope',TTableHeaderScope::NotSet);
58         }
59
60         /**
61          * @param TTableHeaderScope the scope of the cells that the header cell applies to.
62          */
63         public function setScope($value)
64         {
65                 $this->setViewState('Scope',TPropertyValue::ensureEnum($value,'TTableHeaderScope'),TTableHeaderScope::NotSet);
66         }
67
68         /**
69          * @return string  the abbr attribute of the HTML th element
70          */
71         public function getAbbreviatedText()
72         {
73                 return $this->getViewState('AbbreviatedText','');
74         }
75
76         /**
77          * @param string  the abbr attribute of the HTML th element
78          */
79         public function setAbbreviatedText($value)
80         {
81                 $this->setViewState('AbbreviatedText',$value,'');
82         }
83
84         /**
85          * @return string the axis attribute of the HTML th element
86          */
87         public function getCategoryText()
88         {
89                 return $this->getViewState('CategoryText','');
90         }
91
92         /**
93          * @param string the axis attribute of the HTML th element
94          */
95         public function setCategoryText($value)
96         {
97                 $this->setViewState('CategoryText',$value,'');
98         }
99 }
100
101
102 /**
103  * TTableHeaderScope class.
104  * TTableHeaderScope defines the enumerable type for the possible table scopes that a table header is associated with.
105  *
106  * The following enumerable values are defined:
107  * - NotSet: the scope is not specified
108  * - Row: the scope is row-wise
109  * - Column: the scope is column-wise
110  *
111  * @author Qiang Xue <qiang.xue@gmail.com>
112  * @package System.Web.UI.WebControls
113  * @since 3.0.4
114  */
115 class TTableHeaderScope extends TEnumerable
116 {
117         const NotSet='NotSet';
118         const Row='Row';
119         const Column='Column';
120 }
121