/**
  * Вывод списка полей в конкретном типе публикаций
  *
  */
 public function fieldsAction()
 {
     if (!$this->_rubric) {
         throw new Exception('rubric_id не определён');
     }
     $this->view->fields = $this->_modelFields->getFieldsByRubric($this->_rubric->rubric_id);
 }
示例#2
0
 protected function _addElements()
 {
     if (!$this->_rubric) {
         throw new Exception('rubric_id не определён');
     }
     $fields = $this->_modelFields->getFieldsByRubric($this->_rubric->rubric_id);
     $arrayFields = array();
     foreach ($fields as $i => $field) {
         if (ZETTA_FRONT && $field->hidden_front) {
             continue;
         }
         $arrayFields[$i] = $field->toArray();
         $arrayFields[$i]['options'] = $field->toArray();
         if ($field['validator']) {
             $arrayFields[$i]['options']['validators'] = array('custom' => new Publications_Framework_Validator_CustomRegexp($field));
             $arrayFields[$i]['options']['required'] = 1;
         }
     }
     $this->_fields = $arrayFields;
     $this->setElements($this->_fields);
 }