• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/integration/templates/bitrix24/themepicker.php
  • Класс: BitrixIntranetIntegrationTemplatesBitrix24ThemePicker
  • Вызов: ThemePicker::getStandardTheme
public function getStandardTheme($themeId)
{
	$config = static::getConfig();
	if (!is_string($themeId) || !is_array($config))
	{
		return null;
	}

	list($baseThemeId, $subThemeId) = static::getThemeIdParts($themeId);
	if (!isset($config["baseThemes"][$baseThemeId]) || !isset($config["subThemes"][$themeId]))
	{
		return null;
	}

	$theme = is_array($config["subThemes"][$themeId]) ? $config["subThemes"][$themeId] : array();
	$theme["id"] = $themeId;
	$theme["removable"] = false;

	$themePath = $this->getThemesPath()."/".$baseThemeId.($subThemeId ? "/".$subThemeId : "");
	if (isset($theme["previewImage"]))
	{
		$theme["previewImage"] = static::getAssetPath($theme["previewImage"], $themePath);
	}

	$images = array();
	if (isset($theme["prefetchImages"]) && is_array($theme["prefetchImages"]))
	{
		foreach ($theme["prefetchImages"] as $fileName)
		{
			$images[] = static::getAssetPath($fileName, $themePath);
		}
	}
	$theme["prefetchImages"] = $images;

	$css = $this->getBaseThemeCss($baseThemeId);
	if (isset($theme["css"]) && is_array($theme["css"]))
	{
		foreach ($theme["css"] as $fileName)
		{
			$css[] = CUtil::getAdditionalFileURL($themePath."/".$fileName);
		}
	}
	else if ($subThemeId)
	{
		$css[] = CUtil::getAdditionalFileURL($themePath."/style.css");
	}

	$theme["css"] = $css;

	if (isset($theme["video"]) && is_array($theme["video"]))
	{
		$theme["video"]["poster"] =
			isset($theme["video"]["poster"])
				? static::getAssetPath($theme["video"]["poster"], $themePath)
				: ""
		;

		if (isset($theme["video"]["sources"]) && is_array($theme["video"]["sources"]))
		{
			foreach ($theme["video"]["sources"] as $type => $source)
			{
				$theme["video"]["sources"][$type] = static::getAssetPath($source, $themePath);
			}
		}
		else
		{
			$theme["video"]["sources"] = array();
		}
	}

	return $theme;
}