diff options
Diffstat (limited to 'framework/Web/UI/WebControls/TRepeater.php')
-rw-r--r-- | framework/Web/UI/WebControls/TRepeater.php | 25 |
1 files changed, 11 insertions, 14 deletions
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);
}
|