• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/hook/page/favicon.php
  • Класс: BitrixLandingHookPageFavicon
  • Вызов: Favicon::exec
public function exec()
{
	if ($this->execCustom())
	{
		return;
	}

	$picture = intval($this->fields['PICTURE']->getValue());

	if ($picture > 0)
	{
		$icons = "n";
		// first simple favicons
		$sizes = ['16x16', '32x32', '96x96'];
		foreach ($sizes as $size)
		{
			list($w, $h) = explode('x', $size);
			$file = CFile::resizeImageGet(
				BitrixLandingFile::getFileArray($picture),
				array(
					'width' => $w,
					'height' => $h
				),
				BX_RESIZE_IMAGE_EXACT
			);
			if ($file)
			{
				$srcExplode = explode('.', $file['src']);
				$ext = array_pop($srcExplode);
				$icons .= '' . "n";
			}
		}
		// apple icons
		$sizes = array('120x120', '180x180', '152x152', '167x167');
		foreach ($sizes as $size)
		{
			list($w, $h) = explode('x', $size);
			$file = CFile::resizeImageGet(
				BitrixLandingFile::getFileArray($picture),
				array(
					'width' => $w,
					'height' => $h
				),
				BX_RESIZE_IMAGE_EXACT
			);
			if ($file)
			{
				$icons .= '' . "n";
			}
		}
		if ($icons)
		{
			Manager::setPageView(
				'BeforeHeadClose',
				$icons,
				true
			);
		}
	}
}