/** * Редактирование профиля пользователя */ public function index() { \helpers\Layout::setTitles($this->fw->get('i18n.user.profile.title')); $model_profile = \models\UserProfile::getInstance(); $model_profile_meta = \models\meta\Meta::getInstance()->getTableMeta('_user_profile'); $profile = $model_profile->getByUserID($this->user_id); if (!is_null($profile)) { $this->fw->set('profile', $profile); } else { $user = $this->user_model->getOne($this->user_id); $title = $user->email; $model_profile->create($this->user_id, ['id' => $this->user_id, 'title' => $title]); } \models\UserProfile::setAjaxFields('_user_profile', $this->user_id); $this->fw->set('PARAMS.id', $this->user_id); $this->fw->set('upload_field_action_url', $this->fw->alias('backend_content_imagefield', 'table=' . $this->table . ',id=' . $this->user_id)); foreach ($model_profile_meta->getPlural() as $k => $v) { $res = $this->model->getPluralSelected($this->node->id, $v); $this->fw->set("ajax_fields.{$v['full_table_name']}.selected", $res); } $this->fw->set('inc', 'user/profile.html'); $this->clear_messages_after = true; }
/** * Устанавливает меню, мета-теги и хлебные крошки */ protected function setLayout() { \helpers\Layout::setMenus($this->fw->get('PATH')); \helpers\Layout::setProperties($this->struct_page); \helpers\Layout::setBreadcrumbsFromNodes($this->struct_pages); }
protected function setLayout() { parent::setLayout(); if ($this->fw->exists('node', $node)) { \helpers\Layout::setPropertiesFromNode($node); \helpers\Layout::setBreadcrumbsFromNode($node, $this->struct_page); } if (!empty($this->tree_nodes)) { \helpers\Layout::setPropertiesFromNode($this->tree_node); \helpers\Layout::setBreadcrumbsTree($this->tree_nodes, $this->struct_pages); } }