4use \Bitrix\Landing\File;
5use \Bitrix\Landing\Rights;
6use \Bitrix\Landing\Landing;
7use \Bitrix\Landing\Site;
8use \Bitrix\Landing\Restriction;
9use \Bitrix\Landing\Site\Type;
10use \Bitrix\Main\Application;
11use \Bitrix\Main\Event;
12use \Bitrix\Main\Localization\Loc;
13use \Bitrix\Rest\Configuration;
15Loc::loadMessages(__FILE__);
44 private static $entityList = [
52 private static $accessManifest = [
64 private static $contextSiteId =
null;
72 return self::$processing;
81 return static::$entityList;
91 $request = Application::getInstance()->getContext()->getRequest();
92 $additional =
$request->get(
'additional');
93 $siteId = $additional[
'siteId'] ??
null;
96 foreach (self::$accessManifest as
$code)
102 $langCode = mb_strtoupper(mb_substr(
$code, mb_strlen(self::PREFIX_CODE)));
107 'PLACEMENT' => [
$code],
112 'DISABLE_CLEAR_FULL' =>
'Y',
113 'DISABLE_NEED_START_BTN' =>
'Y',
114 'COLOR' =>
'#ff799c',
115 'ICON' =>
'/bitrix/images/landing/landing_transfer.svg',
116 'TITLE' => Loc::getMessage(
'LANDING_TRANSFER_GROUP_TITLE_' . $langCode),
118 'EXPORT_TITLE_PAGE' => Loc::getMessage(
'LANDING_TRANSFER_EXPORT_ACTION_TITLE_BLOCK_' . $langCode),
119 'EXPORT_TITLE_BLOCK' => Loc::getMessage(
'LANDING_TRANSFER_EXPORT_ACTION_TITLE_BLOCK_' . $langCode),
120 'EXPORT_ACTION_DESCRIPTION' => Loc::getMessage(
'LANDING_TRANSFER_EXPORT_ACTION_DESCRIPTION_' . $langCode),
121 'IMPORT_TITLE_PAGE' => Loc::getMessage(
'LANDING_TRANSFER_IMPORT_ACTION_TITLE_BLOCK_' . $langCode),
122 'IMPORT_TITLE_BLOCK' => Loc::getMessage(
'LANDING_TRANSFER_IMPORT_ACTION_TITLE_BLOCK_' . $langCode),
123 'IMPORT_DESCRIPTION_UPLOAD' => Loc::getMessage(
'LANDING_TRANSFER_IMPORT_DESCRIPTION_UPLOAD_' . $langCode),
124 'IMPORT_DESCRIPTION_START' =>
' ',
125 'INSTALL_STEP' => Loc::getMessage(
'LANDING_TRANSFER_IMPORT_DESCRIPTION_STEP_' . $langCode),
126 'IMPORT_INSTALL_FINISH_TEXT' =>
'',
127 'IMPORT_TITLE_PAGE_CREATE' => Loc::getMessage(
'LANDING_TRANSFER_IMPORT_ACTION_TITLE_BLOCK_CREATE_' . $langCode),
128 'REST_IMPORT_AVAILABLE' =>
'Y',
131 'MODULE_ID' =>
'landing',
133 '\Bitrix\Landing\Transfer\AppConfiguration',
140 return $manifestList;
151 if ($manifest[
'CODE'] ??
null)
157 $siteId = $manifest[
'SITE_ID'] ?? 0;
158 if (
$type ===
'export')
186 self::$processing =
true;
188 if (in_array(
$code, static::$accessManifest))
190 if (
$type ==
'EXPORT')
194 else if (
$type ==
'IMPORT')
211 $manifest =
$event->getParameter(
'MANIFEST');
212 $access = array_intersect($manifest[
'USES'], static::$accessManifest);
214 self::$processing =
true;
216 if (
Restriction\Manager::isAllowed(
'limit_sites_transfer'))
234 self::$contextSiteId =
$event->getParameter(
'RATIO')[
'LANDING'][
'SITE_ID'] ??
null;
237 self::$processing =
true;
239 Landing::disableCheckUniqueAddress();
241 if (isset(static::$entityList[
$code]))
246 Landing::enableCheckUniqueAddress();
261 if (in_array(
$code, static::$accessManifest))
263 if (
$type ==
'EXPORT')
267 $setting =
new Configuration\Setting(
$context);
269 if (!empty($manifest[
'SITE_ID']))
272 $res = Site::getList([
277 'ID' => $manifest[
'SITE_ID'],
280 if ($row =
$res->fetch())
282 $structure =
new Configuration\Structure(
$context);
283 $structure->setArchiveName(\CUtil::translit(
287 'replace_space' =>
'_',
288 'replace_other' =>
'_',
295 else if (
$type ==
'IMPORT')
301 self::$processing =
false;
313 $checkExternal = self::$contextSiteId && ($file[
'ID'] ??
null);
314 $externalId = $checkExternal ? self::$contextSiteId .
'_' . $file[
'ID'] :
null;
318 $res = \CFile::getList([], [
'EXTERNAL_ID' => $externalId]);
319 if ($row =
$res->fetch())
326 $fileData = \CFile::makeFileArray(
332 $fileData[
'name'] = $file[
'NAME'];
333 $fileData[
'external_id'] = $externalId;
335 if (\CFile::checkImageFile($fileData, 0, 0, 0,
array(
'IMAGE')) ===
null)
337 $fileData[
'MODULE_ID'] =
'landing';
339 $fileId = (int)\CFile::saveFile($fileData, $fileData[
'MODULE_ID']);
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
static sanitizeFileName(string $fileName)
static getOperationsForSite($siteId)
static hasAdditionalRight($code, $type=null, bool $checkExtraRights=false, bool $strict=false)
static setScope($scope, array $params=[])
static getManifestList(Event $event)
static onInitManifest(Event $event)
static onCheckAccess(string $type, array $manifest)
static onEventExportController(Event $event)
static onFinish(Event $event)
static saveFile(array $file)
const SYSTEM_BLOCK_REST_PENDING
const SYSTEM_COMPONENT_REST_PENDING
static onEventImportController(Event $event)
static nextStep(Event $event)
static getInitManifest(Event $event)
static onFinish(Event $event)
static nextStep(Event $event)
static getInitManifest(Event $event)
static onFinish(Event $event)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
if(!is_array($deviceNotifyCodes)) $access