• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/ui/viewer/previewmanager.php
  • Класс: BitrixMainUIViewerPreviewManager
  • Вызов: PreviewManager::processViewByUserRequest
public function processViewByUserRequest($file, $options): void
{
	self::disableCatchingViewByUser();

	$response = null;
	if ($this->httpRequest->get(self::GET_KEY_TO_SEND_PREVIEW_CONTENT))
	{
		$response = $this->sendPreviewContent($file, $options);
	}
	elseif ($this->httpRequest->get(self::GET_KEY_TO_SHOW_IMAGE))
	{
		$this->showImage($file, $options);
	}
	elseif ($this->httpRequest->getHeader(self::HEADER_TO_RUN_FORCE_TRANSFORMATION))
	{
		$response = $this->sendPreview($file, true);
	}
	elseif ($this->httpRequest->getHeader(self::HEADER_TO_CHECK_TRANSFORMATION))
	{
		$response = $this->checkTransformation($file);
	}
	elseif ($this->httpRequest->getHeader(self::HEADER_TO_SEND_PREVIEW))
	{
		$response = $this->sendPreview($file);
	}
	elseif ($this->httpRequest->getHeader(self::HEADER_TO_RESIZE_IMAGE))
	{
		$response = $this->sendResizedImage($file);
	}

	if (($response instanceof ResponseBFile) && isset($options['cache_time']))
	{
		$response->setCacheTime($options['cache_time']);
	}

	if ($response instanceof MainResponse)
	{
		/** @global CMain $APPLICATION */
		global $APPLICATION;

		$APPLICATION->RestartBuffer();

		Application::getInstance()->end(0, $response);
	}
}