public function save() { $logger = Zupal_Module_Manager::getInstance()->get('people')->logger(); parent::save(); $logger->info('Employee ' . $this->get_domain()->identity() . ' saved'); $cache = Zupal_Bootstrap::$registry->cache; $cache->remove('employee_data'); }
/** * * @param <type> $pModel = NULL * @return <type> */ public function __construct($pModel = NULL) { if (is_null($pModel)) { $pModel = new Zupal_Modules(); } parent::__construct(new Zend_Config_Ini(dirname(__FILE__) . DS . 'Form.ini', 'fields')); $this->set_domain($pModel); }
public function __construct($pAction = NULL) { $ini_path = preg_replace('~php$~', 'ini', __FILE__); $config = new Zend_Config_Ini($ini_path, 'fields'); parent::__construct($config); if ($pAction) { $this->setAction($pAction); } }
public function __construct($pDomain) { $ini_path = preg_replace('~php$~', 'ini', __FILE__); $config = new Zend_Config_Ini($ini_path, 'fields'); parent::__construct($config); if ($pDomain) { $this->set_domain($pDomain); $this->domain_to_form(); } }
/** * * @param string $pParams * @return void */ public function isValid($pParams) { if (array_key_exists('title', $pParams)) { $this->get_domain()->set_title($pParams['title']); } if (array_key_exists('lead', $pParams)) { $this->get_domain()->set_lead($pParams['lead']); } if (array_key_exists('content', $pParams)) { $this->get_domain()->set_content($pParams['content']); } return parent::isValid($pParams); }
/** * * @param array $pFields * @return boolean */ public function isValid($pFields) { if (!parent::isValid($pFields)) { return FALSE; } if ($this->name_first->getValue() || $this->username->getValue() || $this->name_last->getValue() || $this->email->getValue()) { return true; } $this->name_first->addErrorMessage('Must have this OR'); $this->name_last->addErrorMessage('Must have this OR'); $this->username->addErrorMessage('Must have this OR'); $this->email->addErrorMessage('Must have this'); return false; }
public function __construct(Zupal_Node_Abstract $pContent = NULL, $pOptions = NULL) { parent::__construct($pOptions); $elements = array(); foreach ($this->getElements() as $element) { $elements[] = $element->getName(); } $this->set_domain($pContent); $this->removeDecorator('HtmlTag'); $this->addDisplayGroup($elements, 'content', array('legend' => 'Content', 'seperator' => '')); $this->getDisplayGroup('content')->removeDecorator('DtDdWrapper'); $this->addElement('multiCheckbox', 'status', array('label' => 'Status', 'separator' => '')); $this->status->setMultiOptions(Zupal_Nodes::$STATUS_PHRASES); $this->addDisplayGroup(array('status'), 'node', array('legend' => 'Node', 'order' => 10)); $this->getDisplayGroup('node')->removeDecorator('DtDdWrapper'); $this->addElement('submit', 'submit', array('label' => 'Submit')); $this->addDisplayGroup(array('submit'), 'buttons', array('order' => 12)); $this->getDisplayGroup('buttons')->removeDecorator('DtDdWrapper'); $this->setMethod('post'); }
public function __construct($pRole = NULL) { $ini_path = dirname(__FILE__) . DS . 'Form.ini'; $config = new Zend_Config_Ini($ini_path, 'fields'); parent::__construct($config); $root = Zend_Controller_Front::getInstance()->getBaseUrl() . DS . 'admin' . DS . 'acl' . DS; if (is_null($pRole)) { $pRole = new Zupal_Resources(); } elseif (is_string($pRole)) { $pRole = new Zupal_Resources($pRole); } $this->set_domain($pRole); if ($pRole->identity()) { $this->setAction($root . 'resupdatevalidate'); } else { $this->setAction($root . 'resaddvalidate'); $this->submit->setLabel('Create Resource'); } $this->setMethod('post'); }
/** * * @return void */ public function fields_to_domain(array $pFields = NULL) { parent::fields_to_domain($pFields); $this->get_domain()->module = $this->rolemodule->getValue(); }
/** * * @param array $pFields * @return void */ public function domain_to_fields(array $pFields = NULL) { $this->resourcemodule->setValue($this->get_domain()->module); parent::domain_to_fields($pFields); }
/** * * @return void */ public function fields_to_domain(array $pFields = NULL) { parent::fields_to_domain($pFields); $this->domain()->module = $this->menumodule->getValue(); $this->domain()->controller = $this->menucontroller->getValue(); $this->domain()->action = $this->menuaction->getValue(); }