/** * Constructs empty form or populates it with values from Opus_Iprange($id). * @param integer $id */ public function __construct($id = null) { $env = empty($id) ? 'new' : 'edit'; $config = new Zend_Config_Ini(APPLICATION_PATH . '/modules/admin/forms/iprange.ini', $env); parent::__construct($config->form->iprange); if (!empty($id)) { $ipRange = new Opus_Iprange($id); $this->populateFromIpRange($ipRange); } }
/** * Constructs empty form or populates it with values from Opus_Account($id). * @param mixed $id */ public function __construct($id = null) { $env = empty($id) ? 'new' : 'edit'; $this->_mode = $env; $config = new Zend_Config_Ini(APPLICATION_PATH . '/modules/admin/forms/account.ini', $env); parent::__construct($config->form->account); if (!empty($id)) { $account = new Opus_Account($id); $this->populateFromAccount($account); // when editing account password isn't required $this->getElement('password')->setRequired(false); $this->getElement('confirmPassword')->setRequired(false); // force validation on empty field to check identity to password $this->getElement('confirmPassword')->setAllowEmpty(false); } }