public function indexAction() { $query = new Query(); $this->view->title = 'Инструменты разработчика'; $this->view->header = 'Инструменты разработчика'; $this->view->headers = array(array('title' => 'Менеджер типов', 'href' => '/admin/typesmanager/'), array('title' => 'Инструменты разработчика')); $this->view->formStructure = Gcontroller::loadFormStructure('/forms/add_type/', get_class()); $this->view->types = $query->q('SELECT type_name FROM types ORDER BY type_name'); $this->view->actionType = 'create'; $this->render('devtools'); }
public static function convertToSelectElements($selectArray, $elementName) { $formStructure = Gcontroller::loadFormStructure('/forms/add_type/'); $structure = json_decode($formStructure['form_structure']); $result = array(); for ($i = 0; $i < sizeof($structure); $i++) { if ($structure[$i]->values->name == $elementName) { foreach ((array) $structure[$i]->options as $optionKey => $option) { if (in_array($optionKey, $selectArray)) { $result[] = $option->value; } } } } return $result; }