• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/documentservice.php
  • Класс: BitrixDiskControllerDocumentService
  • Вызов: DocumentService::goToEditAction
public function goToEditAction($serviceCode, $attachedObjectId = null, $objectId = null, $documentSessionId = null)
{
	$driver = Driver::getInstance();
	$handlersManager = $driver->getDocumentHandlersManager();
	$documentHandler = $handlersManager->getHandlerByCode($serviceCode);
	if (!$documentHandler)
	{
		$this->addError(new Error('There is no document service by code'));
	}

	if ($documentHandler instanceof OnlyOfficeHandler)
	{
		if ($documentSessionId)
		{
			/** @see BitrixDiskControllerOnlyOffice::loadDocumentEditorByViewSessionAction() */
			return $this->forward(OnlyOffice::class, 'loadDocumentEditorByViewSession', [
				'documentSessionId' => $documentSessionId,
			]);
		}

		/** @see BitrixDiskControllerOnlyOffice::loadDocumentEditorAction() */
		return $this->forward(OnlyOffice::class, 'loadDocumentEditor', [
			'attachedObjectId' => $attachedObjectId,
			'objectId' => $objectId,
		]);
	}

	$urlManager = $driver->getUrlManager();
	if ($attachedObjectId)
	{
		LocalRedirect($urlManager::getUrlToStartEditUfFileByService($attachedObjectId, $documentHandler::getCode()));

	}
	else
	{
		LocalRedirect($urlManager::getUrlForStartEditFile($objectId, $documentHandler::getCode()));
	}
}