<?php
/*
* Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
* This program is free software distributed under the GPL version 2.
* See http://gpl.openslx.org/
*
* If you have any feedback please consult http://feedback.openslx.org/ and
* send your suggestions, praise, or complaints to feedback@openslx.org
*
* General information about OpenSLX can be found at http://openslx.org/
*/
class user_Form_Filter extends Zend_Form
{
private $bootmenus;
public function init()
{
$this->setName("Add Filter");
$this->setMethod('post');
if(Pbs_Acl::checkRight('fefp') || Pbs_Acl::checkRight('fa')){
$edit = 'true';
}
else{
$edit = null;
}
$this->addElement('text', 'title', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
),
'required' => true,
'readOnly' => $edit,
'label' => 'Title:',
));
$this->addElement('textarea', 'description', array(
'filters' => array('StringTrim'),
'required' => false,
'readOnly' => $edit,
'label' => 'Description:',
));
$bootmenufield = $this->createElement('select','bootmenuID');
$bootmenufield->setLabel('Bootmenu:');
$bootmenufield->setAttrib('readOnly', $edit);
if(count($this->bootmenus)>0){
foreach($this->bootmenus as $g){
$bootmenufield->addMultiOption($g->getID(), $g->getTitle());
}
}
$bootmenufield->setRegisterInArrayValidator(false);
$this->addElement($bootmenufield);
$this->addElement('text', 'priority', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
),
'required' => true,
'label' => 'Priority:',
));
$this->addElement('submit', 'add', array(
'required' => false,
'ignore' => true,
'label' => $this->buttontext,
));
$this->addElement('button', 'Cancel', array(
'onclick' => 'self.location="/user/filter/index/page/'.$this->page.'"'
));
$this->addElement('hidden', 'created', array(
'required' => false,
'ignore' => true
));
}
function setBootmenus($val){
$this->bootmenus = $val;
return;
}
private $buttontext = 'Save';
function setButtontext($v){
$this->buttontext = $v;
}
}