diff options
| author | Björn Geiger | 2011-03-28 12:56:10 +0200 |
|---|---|---|
| committer | Björn Geiger | 2011-03-28 12:56:10 +0200 |
| commit | 84f8c7b61f61ff68e9568e01c23689d591dc4828 (patch) | |
| tree | 35d6e718bdb2d6413a34d5d1bc5be40db76bb2bd /application/modules/user/forms/GroupEdit.php | |
| parent | updatebutton geadded (diff) | |
| download | pbs2-84f8c7b61f61ff68e9568e01c23689d591dc4828.tar.gz pbs2-84f8c7b61f61ff68e9568e01c23689d591dc4828.tar.xz pbs2-84f8c7b61f61ff68e9568e01c23689d591dc4828.zip | |
Groupcontroller User Module
Diffstat (limited to 'application/modules/user/forms/GroupEdit.php')
| -rw-r--r-- | application/modules/user/forms/GroupEdit.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/application/modules/user/forms/GroupEdit.php b/application/modules/user/forms/GroupEdit.php new file mode 100644 index 0000000..0da0f61 --- /dev/null +++ b/application/modules/user/forms/GroupEdit.php @@ -0,0 +1,68 @@ +<?php + +class user_Form_GroupEdit extends Zend_Form +{ + private $groupID; + + public function setGroupID($groupID){ + $this->groupID = $groupID; + + } + + public function init() + { + $this->setName("GroupEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + 'value' => $_POST['title'], + )); + + $this->addElement('text', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'label' => 'Description:', + 'value' => $_POST['description'], + )); + + $this->addElement('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + if(strpos($_SERVER['HTTP_REFERER'], '/user/group/show')) { + if(strpos($_SERVER['HTTP_REFERER'], '/groupID/')) { + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/user/group/show/groupID/' . $this->groupID . '"', + )); + } else { + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/user/group/show/"', + )); + } + } else { + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/user/group/showall"', + )); + } + } +}
\ No newline at end of file |
