Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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