• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/focuscontroller.php
  • Класс: BitrixDiskFocusController
  • Вызов: FocusController::processActionOpenTrashcanFileDetail
protected function processActionOpenTrashcanFileDetail()
{
	if(!$this->checkRequiredGetParams(array('fileId')))
	{
		$this->sendJsonErrorResponse();
	}

	/** @var File $file */
	$file = File::loadById((int)$this->request->getQuery('fileId'), array('STORAGE'));
	if(!$file)
	{
		$this->errorCollection->addOne(new Error('Could not find file', self::ERROR_COULD_NOT_FIND_FILE));
		$this->showNotFound();
	}
	if(!$file->canRead($file->getStorage()->getCurrentUserSecurityContext()))
	{
		$this->errorCollection->addOne(new Error('Could not find file', self::ERROR_COULD_NOT_READ_FILE));
		$this->showNotFound();
	}

	$urlManager = Driver::getInstance()->getUrlManager();
	$pathDetail = $urlManager->getPathTrashcanFileDetail($file);
	if($this->request->getQuery('back'))
	{
		$pathDetail .= '?&' . http_build_query(array('back' => $this->request->getQuery('back')));
	}
	LocalRedirect(
		$urlManager->encodeUrn($pathDetail)
	);
}