From e7b3717614621f14695ab6ca6dda6dd17ba3d65c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 28 Jul 2011 20:27:23 +0000 Subject: added new easygiant library --- h-source/Library/Scaffold.php | 50 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'h-source/Library/Scaffold.php') diff --git a/h-source/Library/Scaffold.php b/h-source/Library/Scaffold.php index aa20a4b..b1941dc 100755 --- a/h-source/Library/Scaffold.php +++ b/h-source/Library/Scaffold.php @@ -101,32 +101,38 @@ class Scaffold { $this->_primaryKey = $primaryKey; - $recordListArray = explode(',',$recordList); - foreach ($recordListArray as $record) { - $this->itemList->addItem("simpleText",";$record;"); + if (strcmp($recordList,'') !== 0) + { + $recordListArray = explode(',',$recordList); + foreach ($recordListArray as $record) { + $this->itemList->addItem("simpleText",";$record;"); + } } $themeArray = explode(',',$theme); - foreach ($themeArray as $el) + if (strcmp($theme,'') !== 0) { - switch ($el) + foreach ($themeArray as $el) { - case 'moveup': - $this->itemList->addItem('moveupForm',$this->_controller.'/'.$this->params['mainAction'],$primaryKey); - break; - case 'movedown': - $this->itemList->addItem('movedownForm',$this->_controller.'/'.$this->params['mainAction'],$primaryKey); - break; - case 'link': - $this->itemList->addItem('associateForm',$this->_controller.'/'.$this->params['associateAction'],$primaryKey); - break; - case 'edit': - $this->itemList->addItem('editForm',$this->_controller.'/'.$this->params['modifyAction'],$primaryKey); - break; - case 'del': - $this->itemList->addItem('delForm',$this->_controller.'/'.$this->params['mainAction'],$primaryKey); - break; + switch ($el) + { + case 'moveup': + $this->itemList->addItem('moveupForm',$this->_controller.'/'.$this->params['mainAction'],$primaryKey); + break; + case 'movedown': + $this->itemList->addItem('movedownForm',$this->_controller.'/'.$this->params['mainAction'],$primaryKey); + break; + case 'link': + $this->itemList->addItem('associateForm',$this->_controller.'/'.$this->params['associateAction'],$primaryKey); + break; + case 'edit': + $this->itemList->addItem('editForm',$this->_controller.'/'.$this->params['modifyAction'],$primaryKey); + break; + case 'del': + $this->itemList->addItem('delForm',$this->_controller.'/'.$this->params['mainAction'],$primaryKey); + break; + } } } @@ -204,9 +210,9 @@ class Scaffold } //add an item to the list of items - public function addItem($type, $action = '', $field = '', $name = '') { + public function addItem($type, $action = '', $field = '', $name = '', $value = '', $title = '') { if ($this->_type === 'main') { - $this->itemList->addItem($type, $action, $field, $name); + $this->itemList->addItem($type, $action, $field, $name, $value, $title); } } -- cgit v1.2.3