From f16aa6762984e4d555a1cf93692db0a69fa2ab38 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 14 Jan 2006 00:19:18 +0000 Subject: Added TBaseDataList control. Updated class tree. Modified TTextBox about SafeHtml support. Modified TTextBox demo accordingly. --- framework/Web/UI/WebControls/TRepeater.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'framework/Web/UI/WebControls/TRepeater.php') diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index c9ecd255..d0d513b0 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -370,22 +370,19 @@ class TRepeater extends TDataBoundControl implements INamingContainer $items=$this->getItems(); $items->clear(); $itemIndex=0; - if($data!==null) + $hasSeparator=$this->_separatorTemplate!==''; + foreach($data as $dataItem) { - $hasSeparator=$this->_separatorTemplate!==''; - foreach($data as $dataItem) - { - if($itemIndex===0 && $this->_headerTemplate!=='') - $this->_header=$this->createItemInternal(-1,'Header',true,null); - if($hasSeparator && $itemIndex>0) - $this->createItemInternal($itemIndex-1,'Separator',true,null); - $itemType=$itemIndex%2==0?'Item':'AlternatingItem'; - $items->add($this->createItemInternal($itemIndex,$itemType,true,$dataItem)); - $itemIndex++; - } - if($itemIndex>0 && $this->_footerTemplate!=='') - $this->_footer=$this->createItemInternal(-1,'Footer',true,null); + if($itemIndex===0 && $this->_headerTemplate!=='') + $this->_header=$this->createItemInternal(-1,'Header',true,null); + if($hasSeparator && $itemIndex>0) + $this->createItemInternal($itemIndex-1,'Separator',true,null); + $itemType=$itemIndex%2==0?'Item':'AlternatingItem'; + $items->add($this->createItemInternal($itemIndex,$itemType,true,$dataItem)); + $itemIndex++; } + if($itemIndex>0 && $this->_footerTemplate!=='') + $this->_footer=$this->createItemInternal(-1,'Footer',true,null); $this->setViewState('ItemCount',$itemIndex,0); } -- cgit v1.2.3