• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/controller/leftmenu.php
  • Класс: BitrixIntranetControllerLeftMenu
  • Вызов: LeftMenu::saveCustomPresetAction
public function saveCustomPresetAction()
{
	if (!$this->isCurrentUserAdmin())
	{
		return null;
	}

	if (isset($_POST['userApply']) && $_POST['userApply'] == 'currentUser')
	{
		CUserOptions::DeleteOptionsByName('intranet', 'left_menu_sorted_items_' . SITE_ID);
		CUserOptions::DeleteOptionsByName('intranet', 'left_menu_preset_' . SITE_ID);
		CUserOptions::DeleteOptionsByName('intranet', 'left_menu_first_page_' . SITE_ID);
	}

	if (isset($_POST['itemsSort']))
	{
		Option::set(
			'intranet',
			'left_menu_custom_preset_sort',
			serialize(self::convertItemsSortFromJSToDB($_POST['itemsSort'], $_POST['version'])),
			SITE_ID
		);
	}

	if (isset($_POST['customItems']))
	{
		Option::set('intranet', 'left_menu_custom_preset_items', serialize($_POST['customItems']), false, SITE_ID);
	}

	Option::set('intranet', 'left_menu_preset', 'custom', false, SITE_ID);
	if (isset($_POST['firstItemLink']))
	{
		$firstPageUrl = $_POST['firstItemLink'];
		if (preg_match('~company/personal/user/d+/tasks/$~i', $firstPageUrl, $match))
		{
			$firstPageUrl = $_POST["siteDir"] . 'company/personal/user/#USER_ID#/tasks/';
		}

		Option::set('intranet', 'left_menu_first_page', $firstPageUrl, false, SITE_ID);
	}
}