• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/update/timemanversion18user.php
  • Класс: BitrixTimemanUpdateTimemanVersion18User
  • Вызов: TimemanVersion18User::__GetSettings
protected function __GetSettings($arNeededSettings, $bPersonal = false)
{
	global $CACHE_MANAGER;

	$cat = intval($bPersonal);

	if (!is_array($this->SETTINGS[$cat]))
	{
		$this->SETTINGS[$cat] = [];

		$cache_id = 'timeman|structure_settings|u' . $this->USER_ID . '_' . $cat;

		if (CACHED_timeman_settings !== false
			&& $CACHE_MANAGER->Read(
				CACHED_timeman_settings,
				$cache_id,
				"timeman_structure_" . COption::GetOptionInt('intranet', 'iblock_structure', false)
			)
		)
		{
			$this->SETTINGS[$cat] = $CACHE_MANAGER->Get($cache_id);
		}
		else
		{
			$this->SETTINGS[$cat] = $bPersonal ? $this->_GetPersonalSettings() : $this->_GetSettings();

			if (CACHED_timeman_settings !== false)
			{
				$CACHE_MANAGER->Set($cache_id, $this->SETTINGS[$cat]);
			}
		}
	}

	$arSettings = $this->SETTINGS[$cat];

	if (is_array($arNeededSettings) && count($arNeededSettings) > 0)
	{
		foreach ($arSettings as $set => $value)
		{
			if (!in_array($set, $arNeededSettings))
			{
				unset($arSettings[$set]);
			}
		}
	}

	return $arSettings;
}