summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms/GroupEdit.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-28 12:56:10 +0200
committerBjörn Geiger2011-03-28 12:56:10 +0200
commit84f8c7b61f61ff68e9568e01c23689d591dc4828 (patch)
tree35d6e718bdb2d6413a34d5d1bc5be40db76bb2bd /application/modules/user/forms/GroupEdit.php
parentupdatebutton geadded (diff)
downloadpbs2-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.php68
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