/** * Setup the edit action form * * @param Admin_Model_DbRow_Action $action * @param Admin_Model_DbRow_Controller $controller */ public function __construct(Admin_Model_DbRow_Controller $controller, Admin_Model_DbRow_Action $action) { parent::__construct($controller); $this->addElement(new Zend_Form_Element_Hidden('id', array('required' => true, 'value' => $action->get('id'), 'order' => 11))); $this->getElement('action')->setValue($action->get('actionName')); $this->getElement('description')->setValue($action->get('description')); }
/** * Generate the Delete form * * @param Admin_Model_DbRow_Controller $controller * @param Admin_Model_DbRow_Action $action */ public function __construct(Admin_Model_DbRow_Controller $controller, Admin_Model_DbRow_Action $action) { parent::__construct($controller); $this->addElements(array(new Zend_Form_Element_Hidden('id', array('required' => true, 'value' => $action->get('id'), 'order' => 11)), new Zend_Form_Element_Checkbox('chkdelete', array('required' => true, 'label' => 'Really Delete?', 'checked' => false, 'order' => 6)))); $this->getElement('action')->setValue($action->get('actionName')); $this->getElement('description')->setValue($action->get('description'))->setAttrib('readonly', 'true'); }
/** * create the form to change permission * * in this form we can set the acl roles, which are allowed or denied * for this action * * @param Admin_Model_DbRow_Controller $controller * @param Admin_Model_DbRow_Action $action * @param array $roles array of Admin_Model_DbTable_Acl_Role Objects * @param array $rulesAllow * @param array $rulesDeny */ public function __construct(Admin_Model_DbRow_Controller $controller, Admin_Model_DbRow_Action $action, array $roles, array $rulesAllow, array $rulesDeny) { parent::__construct($controller); $rolesAllow = new Zend_Form_Element_MultiCheckbox('rolesallow', array('label' => 'Allow access', 'order' => 7)); $rolesDeny = new Zend_Form_Element_MultiCheckbox('rolesdeny', array('label' => 'Explicit Deny Access', 'order' => 8)); foreach ($roles as $role) { $rolesAllow->addMultiOption($role->get('id'), $role->get('name')); $rolesDeny->addMultiOption($role->get('id'), $role->get('name')); } $rolesAllow->setValue($rulesAllow); $rolesDeny->setValue($rulesDeny); $this->addElements(array($rolesAllow, $rolesDeny, new Zend_Form_Element_Hidden('id', array('required' => true, 'value' => $action->get('id'), 'order' => 11)))); // remove description element (from base form) $this->removeElement('description'); $this->getElement('action')->setValue($action->get('actionName')); }
/** * Create the add form * * @param Admin_Model_DbRow_Controller $controller * @param String $actionName */ public function __construct(Admin_Model_DbRow_Controller $controller, $actionName) { parent::__construct($controller); $this->getElement('actionname')->setValue($actionName); }