_init('admin/variable'); } /** * @return array|bool * @throws Exception * @throws Zend_Validate_Exception */ public function validate() { $errors = array(); if (!Zend_Validate::is($this->getVariableName(), 'NotEmpty')) { $errors[] = Mage::helper('adminhtml')->__('Variable Name is required field.'); } if (!Zend_Validate::is($this->getVariableName(), 'Regex', array('/^[-_a-zA-Z0-9\/]*$/'))) { $errors[] = Mage::helper('adminhtml')->__('Variable Name is incorrect.'); } if (!in_array($this->getIsAllowed(), array('0', '1'))) { $errors[] = Mage::helper('adminhtml')->__('Is Allowed is required field.'); } if (empty($errors)) { return true; } return $errors; } /** * Check is config directive with given path can be parsed via configDirective method * * @param string $path * @return bool */ public function isPathAllowed($path) { return Mage::helper('admin/variable')->isPathAllowed($path); } }