diff options
Diffstat (limited to 'application/modules/user/forms/RoleEdit.php')
| -rw-r--r-- | application/modules/user/forms/RoleEdit.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/application/modules/user/forms/RoleEdit.php b/application/modules/user/forms/RoleEdit.php new file mode 100644 index 0000000..170a2f9 --- /dev/null +++ b/application/modules/user/forms/RoleEdit.php @@ -0,0 +1,65 @@ +<?php + +class user_Form_RoleEdit extends Zend_Form +{ + private $roleID; + + public function setRoleID($roleID){ + $this->roleID = $roleID; + } + + public function init() + { + $this->setName("RoleEdit"); + $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('hidden', 'groupID', array( + 'value' => $_POST['groupID'], + )); + + $this->addElement('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + if(strpos($_SERVER['HTTP_REFERER'], '/user/role/show/roleID')) { + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/user/role/show/roleID/' . $this->roleID . '"', + )); + } else { + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/user/role/"', + )); + } + } + + +} + |
