/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array('url_id' => HCMS_Filter_CharConvert::createSEOFilter($data, $options)); // $subData = isset ($data['data'])?$data['data']:array(); // $this->_dataSubform = new Cms_Form_Sub_CategoryData($subData, $options); $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'url_id' => array('presence' => 'required', new Zend_Validate_NotEmpty(), 'messages' => array(0 => 'Please specify URL ID.')), 'set_id' => array('allowEmpty' => false), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Name.')), 'data' => array('allowEmpty' => true), 'description' => array('allowEmpty' => true), 'parent_id' => array('allowEmpty' => true), 'meta' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null, $lang = null) { $filterRules = array('url_id' => HCMS_Filter_CharConvert::createSEOFilter($data, $options)); $validatorRules = array('id' => array('allowEmpty' => true), 'title' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Page title.')), 'code' => array('allowEmpty' => true, 'messages' => array(0 => 'Please specify Page code.')), 'url_id' => array('presence' => 'required', new Zend_Validate_NotEmpty(), new Cms_Form_Validator_UrlId($data, $lang), 'messages' => array(0 => 'Please specify URL ID.', 1 => 'The same URL Id already exists in some other page.')), 'status' => array('presence' => 'required', 'allowEmpty' => false), 'type_id' => array('presence' => 'required', 'allowEmpty' => false), 'format' => array('presence' => 'required', 'allowEmpty' => false), 'teaser' => array('allowEmpty' => true), 'content' => array('allowEmpty' => true), 'meta' => array('allowEmpty' => true), 'data' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
protected function createSeoFilter() { $this->seoFilter = HCMS_Filter_CharConvert::createSEOFilter(); }
/** * Ajax action to obtain url_id from name */ public function urlIdAction() { /* @var $filter Zend_Filter */ $filter = HCMS_Filter_CharConvert::createSEOFilter(array(), array()); $this->_helper->json(array('url_id' => $filter->filter($this->_getParam('name')))); }