From 84f8c7b61f61ff68e9568e01c23689d591dc4828 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Mon, 28 Mar 2011 12:56:10 +0200 Subject: Groupcontroller User Module --- application/modules/user/forms/GroupEdit.php | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 application/modules/user/forms/GroupEdit.php (limited to 'application/modules/user/forms/GroupEdit.php') 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 @@ +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 -- cgit v1.2.3-55-g7522