• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documentcontroller.php
  • Класс: BitrixDiskDocumentDocumentController
  • Вызов: DocumentController::processActionPublishBlank
protected function processActionPublishBlank()
{
	$this->checkRequiredGetParams(array(
		'type'
	));
	if($this->errorCollection->hasErrors())
	{
		$this->sendJsonErrorResponse();
	}

	$fileData = new BlankFileData($this->request->getQuery('type'));
	$fileData = $this->documentHandler->createBlankFile($fileData);
	if(!$fileData)
	{
		if($this->documentHandler->isRequiredAuthorization())
		{
			$this->sendNeedAuth();
		}
		$this->errorCollection->add($this->documentHandler->getErrors());
		$this->sendJsonErrorResponse();
	}
	$session = $this->addCreateEditSessionByCurrentUser($fileData);
	if(!$session)
	{
		$this->sendJsonErrorResponse();
	}

	$this->sendJsonSuccessResponse(array(
		'editSessionId' => $session->getId(),
		'id' => $fileData->getId(),
		'link' => $fileData->getLinkInService(),
	));
}