From bce854019ec98edc77b541af3d971a1d95da13af Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 5 Nov 2006 00:50:01 +0000 Subject: Fixed #446. --- HISTORY | 1 + framework/Web/UI/WebControls/THead.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/HISTORY b/HISTORY index c9eab97d..ce3e991b 100644 --- a/HISTORY +++ b/HISTORY @@ -2,6 +2,7 @@ Version 3.0.6 December 4, 2006 ============================== BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) BUG: TTableCell should render   only when Text is not set and there's no child (Qiang) +ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) CHG: constructUrl() now encodes & into & by default (Qiang) CHG: TRepeater does not render anymore for empty item template (Qiang) diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php index 93858da0..746d33ac 100644 --- a/framework/Web/UI/WebControls/THead.php +++ b/framework/Web/UI/WebControls/THead.php @@ -342,6 +342,36 @@ class TMetaTagCollection extends TList 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