From ca22da21b0cedab985e698f4dedf3ac1158a1487 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 20 Jan 2015 23:42:12 +0100 Subject: one class per file: framework/Web/UI/WebControls --- framework/Web/UI/WebControls/THead.php | 199 +-------------------------------- 1 file changed, 1 insertion(+), 198 deletions(-) (limited to 'framework/Web/UI/WebControls/THead.php') diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php index 707bbfcc..32eb2cfa 100644 --- a/framework/Web/UI/WebControls/THead.php +++ b/framework/Web/UI/WebControls/THead.php @@ -172,201 +172,4 @@ class THead extends TControl parent::render($writer); $writer->write("\n"); } -} - -/** - * TMetaTag class. - * - * TMetaTag represents a meta tag appearing in a page head section. - * You can set its {@link setID ID}, {@link setHttpEquiv HttpEquiv}, - * {@link setName Name}, {@link setContent Content}, {@link setScheme Scheme} - * properties, which correspond to id, http-equiv, name, content, and scheme - * attributes for a meta tag, respectively. - * - * @author Qiang Xue - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TMetaTag extends TComponent -{ - /** - * @var string id of the meta tag - */ - private $_id=''; - /** - * @var string http-equiv attribute of the meta tag - */ - private $_httpEquiv=''; - /** - * @var string name attribute of the meta tag - */ - private $_name=''; - /** - * @var string content attribute of the meta tag - */ - private $_content=''; - /** - * @var string scheme attribute of the meta tag - */ - private $_scheme=''; - - /** - * @return string id of the meta tag - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string id of the meta tag - */ - public function setID($value) - { - $this->_id=$value; - } - - /** - * @return string http-equiv attribute of the meta tag - */ - public function getHttpEquiv() - { - return $this->_httpEquiv; - } - - /** - * @param string http-equiv attribute of the meta tag - */ - public function setHttpEquiv($value) - { - $this->_httpEquiv=$value; - } - - /** - * @return string name attribute of the meta tag - */ - public function getName() - { - return $this->_name; - } - - /** - * @param string name attribute of the meta tag - */ - public function setName($value) - { - $this->_name=$value; - } - - /** - * @return string content attribute of the meta tag - */ - public function getContent() - { - return $this->_content; - } - - /** - * @param string content attribute of the meta tag - */ - public function setContent($value) - { - $this->_content=$value; - } - - /** - * @return string scheme attribute of the meta tag - */ - public function getScheme() - { - return $this->_scheme; - } - - /** - * @param string scheme attribute of the meta tag - */ - public function setScheme($value) - { - $this->_scheme=$value; - } - - /** - * Renders the meta tag. - * @param THtmlWriter writer for the rendering purpose - */ - public function render($writer) - { - if($this->_id!=='') - $writer->addAttribute('id',$this->_id); - if($this->_name!=='') - $writer->addAttribute('name',$this->_name); - if($this->_httpEquiv!=='') - $writer->addAttribute('http-equiv',$this->_httpEquiv); - if($this->_scheme!=='') - $writer->addAttribute('scheme',$this->_scheme); - $writer->addAttribute('content',$this->_content); - $writer->renderBeginTag('meta'); - $writer->renderEndTag(); - } -} - - -/** - * TMetaTagCollection class - * - * TMetaTagCollection represents a collection of meta tags - * contained in a {@link THead} control. - * - * @author Qiang Xue - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TMetaTagCollection extends TList -{ - /** - * Inserts an item at the specified position. - * This overrides the parent implementation by performing type - * check on the item being added. - * @param integer the speicified position. - * @param mixed new item - * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TMetaTag} - */ - public function insertAt($index,$item) - { - if($item instanceof TMetaTag) - parent::insertAt($index,$item); - else - throw new TInvalidDataTypeException('metatagcollection_metatag_invalid'); - } - - /** - * Finds the lowest cardinal index of the meta tag whose id is the one being looked for. - * @param string the ID of the meta tag to be looked for - * @return integer the index of the meta tag found, -1 if not found. - */ - public function findIndexByID($id) - { - $index=0; - foreach($this as $item) - { - if($item->getID()===$id) - return $index; - $index++; - } - return -1; - } - - /** - * Finds the item whose value is the one being looked for. - * @param string the id of the meta tag to be looked for - * @return TMetaTag the meta tag found, null if not found. - */ - public function findMetaTagByID($id) - { - if(($index=$this->findIndexByID($id))>=0) - return $this->itemAt($index); - else - return null; - } -} - +} \ No newline at end of file -- cgit v1.2.3