возвращает или  устанавливает кастомный id активного  узла
498863
public function selectedNodeId($id=null){
        
        if(is_integer($id)){
          $this->selectedid =$id;    
          $this->selectednodeid =$id;    
        }
        return $this->selectedid;
        
    }
1089302
function() {
        var builder = this.builder;

        builder.register( 'View', new ViewBuilder() );
        builder.register( 'InlineView', new InlineViewBuilder() );
        builder.register( 'AutoView', new MetadataViewBuilder() );

        builder.register( 'StackPanel', new StackPanelBuilder() );
        builder.register( 'GridPanel', new GridPanelBuilder() );
        builder.register( 'ScrollPanel', new ScrollPanelBuilder() );
        builder.register( 'Panel', new PanelBuilder() );
        builder.register( 'ScrollPanel', new ScrollPanelBuilder() );
        builder.register( 'ViewPanel', new ViewPanelBuilder() );
        builder.register( 'TabPanel', new TabPanelBuilder() );
        builder.register( 'TabPage', new TabPageBuilder() );

        builder.register( 'TablePanel', new TablePanelBuilder() );
        builder.register( 'Cell', new CellBuilder() );
        builder.register( 'Row', new RowBuilder() );

        builder.register( 'MenuBar', new MenuBarBuilder() );

        builder.register( 'DataGrid', new DataGridBuilder() );
        // служебный элемент, в документировании не нуждается
        builder.register( 'DataGridRow', new DataGridRowBuilder() );

        builder.register( 'DataGridColumn', new DataGridColumnBuilder() );
        builder.register( 'ListBox', new ListBoxBuilder() );

        builder.register( 'TextBox', new TextBoxBuilder() );
        builder.register( 'PasswordBox', new PasswordBoxBuilder() );
        builder.register( 'CheckBox', new CheckBoxBuilder() );
        builder.register( 'IndeterminateCheckBox', new IndeterminateCheckBoxBuilder() );
        builder.register( 'ImageBox', new ImageBoxBuilder() );
        builder.register( 'FileBox', new FileBoxBuilder() );
        builder.register( 'Label', new LabelBuilder() );
        builder.register( 'Link', new LinkBuilder() );
        builder.register( 'Form', new FormBuilder() );
        builder.register( 'Icon', new IconBuilder() );
        builder.register( 'DateTimePicker', new DateTimePickerBuilder() );
        builder.register( 'DatePicker', new DatePickerBuilder() );
        builder.register( 'TimePicker', new TimePickerBuilder() );
        builder.register( 'ToggleButton', new ToggleButtonBuilder() );
        builder.register( 'NumericBox', new NumericBoxBuilder() );
        builder.register( 'Button', new ButtonBuilder() );
        builder.register( 'ToolBar', new ToolBarBuilder() );
        builder.register( 'ToolBarButton', new ButtonBuilder() );
        builder.register( 'ComboBox', new ComboBoxBuilder() );
        builder.register( 'RadioGroup', new RadioGroupBuilder() );
        builder.register( 'ExtensionPanel', new ExtensionPanelBuilder() );
        builder.register( 'PopupButton', new PopupButtonBuilder() );
        builder.register( 'DataNavigation', new DataNavigationBuilder() );
        builder.register( 'TreeView', new TreeViewBuilder() );
        builder.register( 'Frame', new FrameBuilder() );
        builder.register( 'ButtonEdit', new ButtonEditBuilder() );

        builder.register( 'RestDataSource', new RestDataSourceBuilder() );
        builder.register( 'DocumentDataSource', new DocumentDataSourceBuilder() );
        builder.register( 'PropertyBinding', new DataBindingBuilder() );
        builder.register( 'ObjectDataSource', new ObjectDataSourceBuilder() );
        builder.register( 'Parameter', new ParameterBuilder() );

        builder.register( 'AcceptAction', new AcceptActionBuilder() );
        builder.register( 'AddAction', new AddActionBuilder() );
        builder.register( 'CreateItemAction', new CreateItemActionBuilder() );
        builder.register( 'CancelAction', new CancelActionBuilder() );
        builder.register( 'DeleteAction', new DeleteActionBuilder() );
        builder.register( 'EditAction', new EditActionBuilder() );
        builder.register( 'OpenAction', new OpenActionBuilder() );
        builder.register( 'SaveAction', new SaveActionBuilder() );
        builder.register( 'SelectAction', new SelectActionBuilder() );
        builder.register( 'UpdateAction', new UpdateActionBuilder() );
        builder.register( 'ServerAction', new ServerActionBuilder() );

        builder.register( 'RouteToAction', new RouteToActionBuilder() );

        builder.register( 'BooleanFormat', new BooleanFormatBuilder() );
        builder.register( 'DateTimeFormat', new DateTimeFormatBuilder() );
        builder.register( 'NumberFormat', new NumberFormatBuilder() );
        builder.register( 'ObjectFormat', new ObjectFormatBuilder() );

        builder.register( 'Script', new ScriptBuilder() );

        builder.register( 'Divider', new DividerBuilder() );
        builder.register( 'ContextMenu', new ContextMenuBuilder() );

        // служебный элемент, в документировании не нуждается
        builder.register( 'ToolTip', new InfinniUI.TooltipBuilder() );

        var registerQueue = ApplicationBuilder.registerQueue;

        for( var i = 0, ii = registerQueue.length; i < ii; i++ ) {
            builder.register( registerQueue[ i ].name, registerQueue[ i ].builder );
        }
    }
664421
function sectionIndex()
    {
        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $root = Eresus_CMS::getLegacyKernel()->root.'admin.php?mod=pages&amp;';
        $this->cache['index_controls'] =
            $page->control('setup', $root.'id=%d') . ' ' .
            $page->control('position',
                array($root.'action=up&amp;id=%d',$root.'action=down&amp;id=%d')) . ' ' .
            $page->control('add', $root.'action=create&amp;owner=%d') . ' ' .
            $page->control('move', $root.'action=move&amp;id=%d') . ' ' .
            $page->control('delete', $root.'action=delete&amp;id=%d');
        $types = $this->loadContentTypes();
        for ($i=0; $i<count($types[0]); $i++)
        {
            $this->cache['content_types'][$types[1][$i]] = $types[0][$i];
        }
        $table = new AdminList;
        $table->setHead(array('text'=>'Раздел', 'align'=>'left'), 'Имя', 'Тип', 'Доступ', '');
        $table->addRow(array(admPagesRoot, '', '', '',
            array($page->control('add', $root.'action=create&amp;owner=0'), 'align' => 'center')));
        $table->addRows($this->sectionIndexBranch(0, 1));
        $result = $table->render();
        return $result;
    }
873482
function asCanonicalArray() {
		/** @var string $_this */
		$_this = spl_object_hash($this);
		if (!isset(self::$_canonicalArray[$_this])) {
			/**
			 * @uses \Magento\Framework\Simplexml\Element::asCanonicalArray()
			 * может возвращать строку в случае,
			 * когда структура исходных данных не соответствует массиву.
			 */
			self::$_canonicalArray[$_this] = df_result_array(parent::asCanonicalArray());
		}
		return self::$_canonicalArray[$_this];
	}
1121683
function globalId($id)
    {
        if (empty($id)){
            return null;
        }
        if (isset($this->_global_ids[$id])){
            return $this->_global_ids[$id];
        }
        // Поиск URI по идентифкатору
        $q = $this->db->prepare('SELECT uri FROM {ids} WHERE `id`=? LIMIT 0,1 FOR UPDATE');
        $q->execute([$id]);
        if ($row = $q->fetch(DB::FETCH_ASSOC)){
            $uri = $row['uri'];
            $this->_local_ids[$uri] = intval($id);
            $this->_global_ids[$id] = $uri;
            return $uri;
        }
        return null;
    }
1137179
public function run($id, $data)
    {
        $data = (new RunBeforeSave($this->dic))->run($data);

        $check_auth_id = ORM::for_table('users')
            ->select('id')
            ->where_equal('auth_id', $data['auth_id'])
            ->where_not_equal('id', $id)
            ->find_one();
        if (is_object($check_auth_id)) {
            return Response::error400('Пользователь с такими данными для входа уже существует');
        }

        $user = ORM::for_table('users')
            ->find_one($id);
        if (is_object($user)) {
            $user->auth_id = $data['auth_id'];
            $user->save();
            if (is_object($user) && isset($user->id)) {
                $info = ORM::for_table('info_users')
                    ->where_equal('user_id', $id)
                    ->find_one();
                if (is_object($info)) {
                    if (isset($data['info_users']) && is_array($data['info_users']) && count($data['info_users']) > 0) {
                        foreach ($data['info_users'] as $key => $value) {
                            $info[$key] = $value;
                        }
                    }

                    if (!isset($data['roles']) || !is_array($data['roles'])) {
                        $data['roles'] = [];
                    }

                    $info->roles = json_encode($data['roles']);
                    $info->updated_at = $this->dic['datetimenow'];
                    $info->save();
                    if (is_object($info) && isset($info->id)) {
                        /** @var DataChangeLog $data_change_log */
                        $data_change_log = $this->dic['datachangelog'];
                        $data_change_log->insert('users', 'update', $id, $data);

                        $data['id'] = $id;
                        $data['last_action_date'] = $this->getLastActionDate($id);

                        return (new RunAfterSave($this->dic))->run($data);
                    } else {
                        return Response::error500('Произошла ошибка при изменении информации пользователя, попробуйте ещё раз');
                    }
                } else {
                    return Response::error404('Информация о пользователе не найдена');
                }
            } else {
                return Response::error500('Произошла ошибка при изменении пользователя, попробуйте ещё раз');
            }
        } else {
            return Response::error404('Пользователь не найден');
        }
    }
482836
function attrs($item)
    {
        $result = '';
        if ($item['id']) $result .= ' id="'.$item['id'].'"';
        if ($item['disabled']) $result .= ' disabled="disabled"';
        if (count($item['class'])) $result .= ' class="'.implode(' ', $item['class']).'"';
        # Ширина
        if (isset($item['width'])) $item['style'][] = 'width: '.$item['width'];
        # Стили
        if (count($item['style'])) $result .= ' style="'.implode(';', $item['style']).'"';
        $result .= ' '.$item['extra'];
        return $result;
    }
891233
function action_index() {
        Kohana::$profiling = false;
        $file = Request::current()->param('file');
        $this->auto_render = FALSE;
        $info = pathinfo($file);
        if (($orig = Helper::static_original($file))) {
            $content = file_get_contents($orig);
            switch ($info['extension']) {
                case 'php':
                    if (Kohana::$config->load('meerkat/staticfiles.show_php')) {
                        $content = highlight_string($content, true);
                    } else {
                        $content = 'Disable show php scripts in production environment';
                    }
                    break;
                case 'css':
                    $content = Css::instance()->prepare($content, Css::instance()->get_need_min_external());
                    break;
                case 'js':
                    $content = Js::instance()->prepare($content, (strpos('.min.', $file) !== false));
                    break;
                default:
                    break;
            }
            //производим deploy статического файла, в следующий раз его будет
            //отдавать сразу веб-сервер без запуска PHP, но ТОЛЬКО для режима разработки
            if (Kohana::$config->load('meerkat/staticfiles.deploy')) {
                $deploy = Helper::static_file($file);
                if (!file_exists(dirname($deploy))) {
                    mkdir(dirname($deploy), 0777, true);
                }
                file_put_contents($deploy, $content);
            }
            //}
            //а пока отдадим файл руками
            //$this->response->check_cache(sha1($this->request->uri()) . filemtime($orig));
            $this->response->body(trim($content));
            if ('php' != $info['extension']) {
                $this->response->headers('Content-Type', File::mime_by_ext($info['extension']));
            } else {
                $this->response->headers('Content-Type', File::mime_by_ext('html'));
            }
            $this->response->headers('Content-Length', filesize($orig));
            $this->response->headers('Last-Modified', date('r', filemtime($orig)));
        } else {
            // Return a 404 status
            $this->response->body('404 File not found');
            $this->response->status(404);
        }
    }
49911
public function save()
    {
        $this->_slug = trim(trim($this->_slug), '/');
        if (is_null($this->_slugModel) || $this->_slugModel->slug !== $this->_slug) {
            //Если уже есть запись с таким slug то обновим её присвоев её максимальный id + 1
            $model = SeoSlug::find()
                ->where([
                    'AND',
                    ['=', 'model', $this->owner->className()],
                    ['=', 'model_id', $this->owner->getPrimaryKey()],
                    ['=', 'slug', $this->_slug],
                ])
                ->one();
            if ($model) {
                $maxId = SeoSlug::find()
                    ->max('id');
                $oldId = $model->id;
                $model->id = ++$maxId;
                $model->save();
                SeoSlug::updateAllCounters(['id' => -1], [
                    'AND',
                    ['>', SeoSlug::tableName() . '.id', $oldId],
                ]);
            } else {
                $model = new SeoSlug();
                $model->model = $this->owner->className();
                $model->model_id = $this->owner->getPrimaryKey();
            }
            $model->slug = $this->_slug;
            $model->save();
            if (is_callable($this->afterSave)) {
                call_user_func($this->afterSave, $this);
            }
        }
    }
1253960
private function adminAddItem()
    {
        $request = Eresus_CMS::getLegacyKernel()->request;
        if ('POST' == $request['method'])
        {
            $image = new Gallery_Entity_Image();
            $image->section = arg('section');
            $image->groupId = arg('group') ? arg('group') : 0;
            $_SESSION['gallery_default_group'] = arg('group');
            $image->title = arg('title');
            $image->cover = arg('cover') ? arg('cover') : false;
            $image->active = arg('active');
            $image->posted = new DateTime();
            $image->image = 'image'; // $_FILES['image'];

            if ($this->isImageInputValid($image))
            {
                $table = ORM::getTable($this, 'Image');
                try
                {
                    $table->persist($image);
                }
                catch (Gallery_Exception_FileTooBigException $e)
                {
                    throw new DomainException('Размер загружаемого файла превышает максимально допустимый');
                }

                $url = 'admin.php?mod=content&section=' . $image->section;
                if (arg('pg'))
                {
                    $url .= '&pg=' . arg('pg', 'int');
                }
                HTTP::redirect($url);
            }
        }

        Eresus_Kernel::app()->getPage()->linkStyles($this->urlCode . 'admin.css');

        // Данные для подстановки в шаблон
        $data = array();
        $data['this'] = $this;
        $data['page'] = Eresus_Kernel::app()->getPage();
        $data['sectionId'] = arg('section', 'int');
        $data['defaultGroup'] = isset($_SESSION['gallery_default_group'])
            ? $_SESSION['gallery_default_group']
            : null;
        $data['image'] = isset($image) ? $image : null;

        if ($this->settings['useGroups'])
        {
            $data['groups'] = $this->dbSelect('groups', "`section` = " . arg('section', 'int'),
                'position');
        }

        // Создаём экземпляр шаблона
        $tmpl = $this->templates()->admin('add-image.html');

        // Компилируем шаблон и данные
        $html = $tmpl->compile($data);

        return $html;
    }
391726
public function show($provider_id, $bill_id)
	{
		//Находим счёт
		$bill = Bill::getBill($bill_id, $provider_id);

		//Отдаём ошибку если счёт не найден
		if ($bill == null) {
			$data['error'] = Catalog::C_BILL_NOT_FOUND;

			return $this->responseFromGate($data);
		}

		//Если счёт стал просроченным - меняем статус, кидаем callback и обновляем счёт
		if ($bill->isExpired() && $bill->doExpire($bill_id)) {
			$this->sendCallback($bill_id);
			$bill = Bill::find($bill->id);
		}

		//Фотмируем ответ и возвращаем
		$data = $this->dataFromObj($bill);
		$data['error'] = 0;

		return $this->responseFromGate($data);
	}
697279
public function actionRegister()
    {
        if (!\Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $rr = new RequestResponse();
        $model = new SignupForm();

        $model->scenario = SignupForm::SCENARION_FULLINFO;

        //Запрос на валидацию ajax формы
        if ($rr->isRequestOnValidateAjaxForm()) {
            return $rr->ajaxValidateForm($model);
        }
        //Запрос ajax post
        if ($rr->isRequestAjaxPost()) {
            if ($model->load(\Yii::$app->request->post()) && $registeredUser = $model->signup()) {
                $rr->success = true;
                $rr->message = 'Вы успешно зарегистрированны';

                \Yii::$app->user->login($registeredUser, 0);

                return $this->redirect($registeredUser->getPageUrl());

            } else {
                $rr->message = 'Не удалось зарегистрироваться';
            }

            return (array)$rr;

        } else {
            if (\Yii::$app->request->isPost) {
                if ($model->load(\Yii::$app->request->post()) && $model->sendEmail()) {
                    if ($ref = UrlHelper::getCurrent()->getRef()) {
                        return $this->redirect($ref);
                    } else {
                        return $this->goBack();
                    }
                }
            }
        }

        return $this->render('register', [
            'model' => $model,
        ]);
    }
97869
public function registerData()
	{
		$fieldsAndTabs = array('FIELDS' => array(), 'TABS' => array());
		$tabsWithFields = $this->fields();

		// приводим массив хелперов к формату класс => настройки
		$helpers = array();

		foreach ($this->helpers() as $key => $value) {
			if (is_array($value)) {
				$helpers[$key] = $value;
			}
			else {
				$helpers[$value] = array();
			}
		}

		$helperClasses = array_keys($helpers);
		/**
		 * @var \Bitrix\Main\Entity\DataManager
		 */
		$model = $helperClasses[0]::getModel();
		foreach ($tabsWithFields as $tabCode => $tab) {
			$fieldsAndTabs['TABS'][$tabCode] = $tab['NAME'];

			foreach ($tab['FIELDS'] as $fieldCode => $field) {
				if (empty($field['TITLE']) && $model) {
				    //Битрикс не использует параметр title при создании экземпляра ReferenceField.
                    if (is_a($model::getEntity()->getField($fieldCode), 'Bitrix\Main\Entity\ReferenceField')) {
                        $map = $model::getMap();
                        if(isset($map[$fieldCode]['title'])){
                            $field['TITLE'] = $map[$fieldCode]['title'];
                        }
                    } else {
                        $field['TITLE'] = $model::getEntity()->getField($fieldCode)->getTitle();
                    }
				}

				$field['TAB'] = $tabCode;
				$fieldsAndTabs['FIELDS'][$fieldCode] = $field;
			}
		}

		AdminBaseHelper::setInterfaceSettings($fieldsAndTabs, $helpers, $helperClasses[0]::getModule());

		foreach ($helperClasses as $helperClass) {
			/**
			 * @var AdminBaseHelper $helperClass
			 */
			$helperClass::setInterfaceClass(get_called_class());
		}
	}
876645
private function actionAddDialog()
    {
        $form = array(
            'name' => 'add',
            'caption' => 'Добавление формы',
            'width' => '100%',
            'fields' => array(
                array('type' => 'hidden', 'name' => 'action', 'value' => 'create'),
                array('type' => 'edit', 'name' => 'title', 'label' => 'Описание',
                    'width' => '99%', 'value' => arg('title')),
                array('type' => 'edit', 'name' => 'name', 'label' => 'Имя',
                    'width' => '16em', 'value' => arg('name'), 'comment' =>
                'только латинские буквы, цифры, символы минус и подчёркивание',
                    'pattern' => '/^[\w\-]+$/i',
                    'errormsg' =>
                    'Имя формы может содержать только латинские буквы, цифры, символы минус и подчёркивание'),
                array('type' => 'text',
                    'value' =>
                    '&raquo; <b><a href="https://github.com/Eresus/EForms/wiki/%D0%AF%D0%B7%D1%8B%D0%BA-%D1%84%D0%BE%D1%80%D0%BC">' .
                    'Синтаксис форм</a></b>'),
                array('type' => 'memo', 'name' => 'code', 'height' => '30', 'syntax' => 'html',
                    'value' => arg('code') ? arg('code') :
                        '<form xmlns:ef="http://procreat.ru/eresus2/ext/eforms" method="post">' . "\n</form>"),
            ),
            'buttons' => array('ok', 'cancel'),
        );
        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        return $page->renderForm($form);
    }
62599
public function editAction()
    {
        /** @var Menus_Entity_Table_Menu $table */
        $table = ORM::getTable($this->plugin, 'Menu');
        /** @var Menus_Entity_Menu $menu */
        $menu = $table->find(arg('id', 'int'));

        if (is_null($menu))
        {
            return 'Такое меню не найдено.';
        }

        $req = Eresus_CMS::getLegacyKernel()->request;

        if ('POST' == $req['method'])
        {
            $menu->name = arg('name', 'word');
            $menu->caption = arg('caption', 'dbsafe');
            $menu->active = true;
            $menu->root = arg('root', 'int');
            $menu->rootLevel = arg('rootLevel', 'int');
            $menu->invisible = arg('invisible', 'int');
            $menu->expandLevelAuto = arg('expandLevelAuto', 'int');
            $menu->expandLevelMax = arg('expandLevelMax', 'int');
            $menu->dropDown = arg('dropDown', 'int');
            $menu->template = arg('template', 'dbsafe');

            $test = $table->findByName($menu->name);
            if (is_null($test) || $test->id == $menu->id)
            {
                $table->update($menu);
                HTTP::redirect('admin.php?mod=ext-menus&id=' . $menu->id);
            }
            else
            {
                ErrorMessage('Меню с таким именем уже есть');
            }
        }

        $form = new EresusForm($this->plugin->templates()->adminPath('form.html', false));
        $form->setValue('sections', $this->adminSectionBranch());
        $form->setValue('action', 'edit');
        $form->setValue('menu', $menu);
        $html = $form->compile();

        return $html;
    }
597785
public function sendClientIfo($lastInsertID = false, $roistat = false)
	{
		// Подготовка шаблона сообщения с информациией о клиенте
		$time 		= date("d.m.y_G:i");
		$message 	= "Время $time \n\n Заявка была заполнена на сайте \n" . $this->url . "\n\n";
		$message .= "Имя: $this->name\n";
		$message .= "Телефон: $this->tel\n";

		if (isset($lastInsertID) && !empty($lastInsertID || $lastInsertID != false)){
			$message .= "\n\nCcылка в админку:\n";
			$message .= $this->config->contactsUrl . $lastInsertID;
		}
		if($roistat !== false ){
			$message .= "\n\nRoistat: " . $roistat . "\n";
		}
		$message .= "\n\nВсе варианты ip:\n";
		foreach ($this->ips as $key => $value) {
			$message .= $value."\n";
		}
		$message .= "\nhttp://sypexgeo.net/ru/demo/";

		$this->sendMail($time, $message);
		return true;
	}
1168483
public function getArray()
    {
        $current_folder_id  = $this->get('cms.context')->getCurrentFolderId();
        $router             = $this->get('router');
        $t                  = $this->get('translator');

        // @todo кеширование по языку и юзеру.
        $data = [
            'left' => [
                'administration' => [
                    'title' => $t->trans('Administration'),
                    'descr' => '',
                    'icon' => 'admin',
                    'onlyicon' => true,
                    'uri'   => $router->generate('cms_admin_index'),
                ],
                'menu' => [
                    'title' => $t->trans('Menu'),
                    'descr' => '',
                    'icon' => 'menu',
                    'items' => [
                        'structure' => [
                            'title' => $t->trans('Site structure'),
                            'icon'  => 'structure',
                            'uri'   => $router->generate('cms_admin_structure'),
                        ],
                        'modules' => [
                            'title' => $t->trans('Modules'),
                            'icon'  => 'modules',
                            'uri'   => $router->generate('cms_admin_module'),
                        ],
                        'files' => [
                            'title' => $t->trans('Files'),
                            'icon'  => 'file',
                            'uri'   => $router->generate('cms_admin_files'),
                        ],
                        'regions' => [
                            'title' => $t->trans('Regions'),
                            'icon'  => 'area',
                            'uri'   => $router->generate('cms_admin_structure_region'),
                        ],
                        'users' => [
                            'title' => $t->trans('Users'),
                            'icon'  => 'users',
                            'uri'   => $router->generate('cms_admin_user'),
                        ],
                        'config' => [
                            'title' => $t->trans('Configuration'),
                            'icon'  => 'conf',
                            'uri'   => $router->generate('smart_core_settings'),
                        ],
                        'appearance' => [
                            'title' => $t->trans('Appearance'),
                            'icon'  => 'code',
                            'uri'   => $router->generate('cms_admin_appearance'),
                        ],
                        'reports' => [
                            'title' => $t->trans('Reports'),
                            'icon' => 'report',
                            'uri' => $router->generate('cms_admin_reports'),
                        ],
                        /*
                        'help' => [
                            'title' => $t->trans('Help'),
                            'icon' => 'question-sign',
                            'uri' => $router->generate('cms_admin_help'),
                        ],
                        */
                    ],
                ],
                'structure' => [
                    'title' => '',
                    'descr' => $t->trans('Structure'),
                    'icon'  => 'folder',
                    'onlyicon' => true,
                    'items' => [
                        'folder_edit' => [
                            'title' => $t->trans('Edit folder'),
                            'icon'  => 'edit-toolbar',
                            'uri'   => $router->generate('cms_admin_structure_folder', ['id' => $current_folder_id]),
                        ],
                        'folder_new' => [
                            'title' => $t->trans('Create folder'),
                            'icon'  => 'add',
                            'uri'   => $router->generate('cms_admin_structure_folder_create_in_folder', ['parent' => $current_folder_id]),
                        ],
                        'add_module' => [
                            'title' => $t->trans('Add module'),
                            'icon'  => 'add',
                            'uri'   => $router->generate('cms_admin_structure_node_create_in_folder', ['folder_pid' => $current_folder_id]),
                        ],
                    ],
                ],
            ],
            'right' => [
                //'eip_toggle' => ['Режим правки: ОТКЛ', 'Режим правки: ВКЛ.'], // @todo перевод // [$t->trans('Viewing'), $t->trans('Edit')],
                'user' => [
                    'title' => $this->container->get('security.token_storage')->getToken()->getUser()->getUserName(),
                    'icon' => 'user-setting',
                    'items' => [
                        /*
                        'admin' => [
                            'title' => $t->trans('Control panel'),
                            'uri'   => $router->generate('cms_admin_index'),
                            'icon'  => 'cog',
                            'overalay' => false,
                        ],
                        */
                        'profile' => [
                            'title' => $t->trans('My profile'),
                            'uri'   => $router->generate('cms_admin_user_edit', ['id' => $this->container->get('security.token_storage')->getToken()->getUser()->getId()]),
                            'icon'  => 'profile',
                            'overalay' => false,
                        ],
                        'logout' => [
                            'title' => $t->trans('Logout'),
                            'uri'   => $router->generate('cms_admin_logout'),
                            'icon'  => 'exit',
                            'overalay' => false,
                        ],
                    ],
                ],
            ],
            'notifications' => [],
        ];

        foreach ($this->get('cms.node')->getNodes() as $node) {
            if ($node->getControlsInToolbar() == Node::TOOLBAR_ONLY_IN_SELF_FOLDER) {
                foreach ($node->getFrontControls() as $controls) {
                    if (isset($controls['default']) and $controls['default'] == true) {
                        $data['left']['node_'.$node->getId()] = [
                            'title' => $controls['title'],
                            'descr' => isset($controls['descr']) ? $controls['descr'] : '',
                            'uri'   => $controls['uri'],
                        ];
                    }
                }
            }
        }

        foreach ($this->get('cms.module')->all() as $module) {
            $notices = $module->getNotifications();

            if (!empty($notices)) {
                $data['notifications'][$module->getName()] = $notices;
            }
        }

        return $data;
    }