summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-06-02 09:56:29 +0000
committerctrlaltca@gmail.com <>2011-06-02 09:56:29 +0000
commitb9f9a16d7eefc48ac489c8cb2b87749459bb3d38 (patch)
tree2cec49f90dd8cd2071bd86efa9c2a6e8a6dfcbe4 /demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php
parent67666aaccb4b4743a084b214722e1173e827e9d1 (diff)
merged documentation changes from branch/3.1 to trunk/
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php')
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php84
1 files changed, 0 insertions, 84 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php
deleted file mode 100644
index 4cb5fafd..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-
-class Sample3 extends TPage
-{
- protected function getProducts()
- {
- return array(
- array('id'=>'ITN001','name'=>'Motherboard','category'=>'CAT004','price'=>100.00,'imported'=>true),
- array('id'=>'ITN002','name'=>'CPU','category'=>'CAT004','price'=>150.00,'imported'=>true),
- array('id'=>'ITN003','name'=>'Harddrive','category'=>'CAT003','price'=>80.00,'imported'=>true),
- array('id'=>'ITN006','name'=>'Keyboard','category'=>'CAT002','price'=>20.00,'imported'=>false),
- array('id'=>'ITN008','name'=>'CDRW drive','category'=>'CAT003','price'=>40.00,'imported'=>true),
- array('id'=>'ITN009','name'=>'Cooling fan','category'=>'CAT001','price'=>10.00,'imported'=>false),
- array('id'=>'ITN012','name'=>'Floppy drive','category'=>'CAT003','price'=>12.00,'imported'=>false),
- array('id'=>'ITN013','name'=>'CD drive','category'=>'CAT003','price'=>20.00,'imported'=>true),
- array('id'=>'ITN014','name'=>'DVD drive','category'=>'CAT003','price'=>80.00,'imported'=>true),
- array('id'=>'ITN015','name'=>'Mouse pad','category'=>'CAT001','price'=>5.00,'imported'=>false),
- );
- }
-
- protected function getCategories()
- {
- return array(
- array('id'=>'CAT001','name'=>'Accessories'),
- array('id'=>'CAT002','name'=>'Input Devices'),
- array('id'=>'CAT003','name'=>'Drives'),
- array('id'=>'CAT004','name'=>'Barebone'),
- );
- }
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack && ! $this->IsCallBack)
- {
- $this->Repeater->DataSource=$this->Products;
- $this->Repeater->dataBind();
- }
- }
-
- public function repeaterDataBound($sender,$param)
- {
- $item=$param->Item;
- if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
- {
- $item->ProductCategory->DataSource=$this->Categories;
- $item->ProductCategory->DataTextField='name';
- $item->ProductCategory->DataValueField='id';
- $item->ProductCategory->dataBind();
- $item->ProductCategory->SelectedValue=$item->DataItem['category'];
- }
- }
-
- public function saveInput($sender,$param)
- {
- if($this->IsValid)
- {
- $index=0;
- $products=$this->Products;
- $data=array();
- foreach($this->Repeater->Items as $item)
- {
- $item=array(
- 'id'=>$products[$index]['id'],
- 'name'=>$item->ProductName->Text,
- 'category'=>$item->ProductCategory->SelectedItem->Text,
- 'price'=>TPropertyValue::ensureFloat($item->ProductPrice->Text),
- 'imported'=>$item->ProductImported->Checked,
- );
- $data[]=$item;
- $index++;
- }
- $this->Repeater2->DataSource=$data;
- $this->Repeater2->dataBind();
- }
- }
-
- public function renderRepeater2 ($sender, $param)
- {
- $this->Repeater2->render($param->getNewWriter());
- }
-}
-
-?> \ No newline at end of file