protected function initializeStorage() { if (isset($this->arParams['STORAGE'])) { $this->storage = $this->arParams['STORAGE']; return $this; } else { $this->storage = Storage::load(array('MODULE_ID' => $this->arParams['STORAGE_MODULE_ID'], 'ENTITY_TYPE' => $this->arParams['STORAGE_ENTITY_TYPE'], 'ENTITY_ID' => $this->arParams['STORAGE_ENTITY_ID'])); } return $this; }
/** * Returns storage by app id (using in REST). * * @param string $appId Id of application in REST. * @return null|Storage */ public function getStorageByRestApp($appId) { return Storage::load(array('MODULE_ID' => self::INTERNAL_MODULE_ID, 'ENTITY_TYPE' => ProxyType\RestApp::className(), 'ENTITY_ID' => $appId), array('ROOT_OBJECT')); }
$componentPage = "index"; $arParams["RESOURCE_TYPE"] = $arParams["RESOURCE_TYPE"] == "FOLDER" ? "FOLDER" : "IBLOCK"; if ($arParams["RESOURCE_TYPE"] == "IBLOCK") { //$arParams["IBLOCK_TYPE"] $arParams["IBLOCK_ID"] = intVal($arParams["IBLOCK_ID"]); $arParams['CHECK_CREATOR'] = "N"; // only for socnet $arParams['SHOW_TAGS'] = $arParams['SHOW_TAGS'] == "Y" ? "Y" : "N"; if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) { $requestURL = $APPLICATION->GetCurPage(); $arParams["SEF_FOLDER"] = str_replace("\\", "/", $arParams["SEF_FOLDER"]); if ($arParams["SEF_FOLDER"] != "/") { $arParams["SEF_FOLDER"] = "/" . Trim($arParams["SEF_FOLDER"], "/ \t\n\r\v") . "/"; } $currentPageUrl = SubStr($requestURL, StrLen($arParams["SEF_FOLDER"])); $diskStorage = \Bitrix\Disk\Storage::load(array('MODULE_ID' => \Bitrix\Disk\Driver::INTERNAL_MODULE_ID, 'ENTITY_TYPE' => \Bitrix\Disk\ProxyType\Common::className(), 'XML_ID' => (int) $arParams['IBLOCK_ID']), array('ROOT_OBJECT')); if ($diskStorage) { //it means / if (!$currentPageUrl || $currentPageUrl == 'index.php') { if ($arParams["SEF_FOLDER"]) { $arParams["SEF_FOLDER"] = rtrim($arParams["SEF_FOLDER"], '/'); } LocalRedirect($arParams["SEF_FOLDER"] . '/path/'); } $arParams['STORAGE'] = $diskStorage; $componentPage = ''; $arVariablesD = array(); $engine = new CComponentEngine($this); $engine->addGreedyPart("#PATH#"); $engine->addGreedyPart("#FILE_PATH#"); $engine->addGreedyPart("#TRASH_PATH#");
private static function needProxyToDiskByDocType($documentType) { if (!(\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk'))) { return false; } if (empty($documentType)) { return false; } $storage = null; if (substr($documentType, 0, 7) == 'STORAGE') { $storageId = (int) substr($documentType, 8); if ($storageId) { $storage = \Bitrix\Disk\Storage::loadById($storageId); } if ($storage) { return $storage; } } list(, $iblockId) = explode('_', $documentType); if (!$iblockId) { return false; } $storage = \Bitrix\Disk\Storage::load(array('XML_ID' => $iblockId, 'MODULE_ID' => \Bitrix\Disk\Driver::INTERNAL_MODULE_ID, 'ENTITY_TYPE' => \Bitrix\Disk\ProxyType\Common::className())); if (!$storage) { return false; } return $storage; }