2namespace Bitrix\Landing;
4use \Bitrix\Landing\Copilot;
5use \Bitrix\Landing\Metrika;
6use \Bitrix\Main\Localization\Loc;
8use \Bitrix\Main\EventResult;
10Loc::loadMessages(__FILE__);
32 public static function ping(
int $id,
bool $deleted =
false): bool
34 if (array_key_exists($id, self::$pings))
36 return self::$pings[$id];
44 $filter[
'=DELETED'] = [
'Y',
'N'];
47 $check = Site::getList([
53 self::$pings[$id] = (boolean) $check->fetch();
55 return self::$pings[$id];
65 if (array_key_exists($id, self::$pings))
67 unset(self::$pings[$id]);
79 public static function getPublicUrl($id,
bool $full =
true,
bool $hostInclude =
true,
bool $previewForNotActive =
false)
86 $hostUrl = Domain::getHostUrl();
90 'DOMAIN_PROTOCOL' =>
'DOMAIN.PROTOCOL',
91 'DOMAIN_NAME' =>
'DOMAIN.DOMAIN',
102 '=DELETED' => [
'Y',
'N'],
103 'CHECK_PERMISSIONS' =>
'N'
106 while ($row =
$res->fetch())
109 $isB24localVar = $isB24;
111 if ($row[
'TYPE'] ==
'SMN')
113 $isB24localVar =
false;
116 if (!$isB24localVar || $disableCloud)
120 $row[
'SMN_SITE_ID'] ? $row[
'SMN_SITE_ID'] :
null
122 $pubPath = rtrim($pubPath,
'/');
125 if ($siteKeyCode ==
'ID')
127 $row[
'CODE'] =
'/' . $row[
'ID'] .
'/';
136 if ($row[
'DOMAIN_ID'])
138 $paths[$row[
'ID']] = ($hostInclude ? ($disableCloud ? $hostUrl : $row[
'DOMAIN_PROTOCOL'] .
'://' . $row[
'DOMAIN_NAME']) :
'') . $pubPath;
141 if ($disableCloud && $isB24localVar)
143 $paths[$row[
'ID']] .= $row[
'CODE'];
145 else if (!$isB24localVar)
147 $paths[$row[
'ID']] .=
'/';
153 $paths[$row[
'ID']] = ($hostInclude ? $hostUrl :
'') . $defaultPubPath . ($full ? $row[
'CODE'] :
'');
155 if ($previewForNotActive && ($row[
'ACTIVE'] ===
'N' || $row[
'DELETED'] ===
'Y'))
157 $paths[$row[
'ID']] .=
'preview/' . self::getPublicHash($row[
'ID'], $row[
'DOMAIN_NAME']) .
'/';
179 $res = self::getList([
187 if ($row =
$res->fetch())
189 if ($row[
'LANDING_ID_INDEX'])
191 return Landing::createInstance(0)->getPreview($row[
'LANDING_ID_INDEX'], $skipCloud);
210 return Hook::getForSite($id);
227 $resSite = self::getList([
235 if (
$site = $resSite->fetch())
258 foreach (self::getHooks($id) as $hook)
260 $fields += $hook->getPageFields();
275 Hook::saveForSite($id,
$data);
284 static $types =
null;
292 'PAGE' => Loc::getMessage(
'LANDING_TYPE_PAGE'),
293 'STORE' => Loc::getMessage(
'LANDING_TYPE_STORE'),
294 'SMN' => Loc::getMessage(
'LANDING_TYPE_SMN'),
295 'KNOWLEDGE' => Loc::getMessage(
'LANDING_TYPE_KNOWLEDGE'),
296 'GROUP' => Loc::getMessage(
'LANDING_TYPE_GROUP'),
297 'MAINPAGE' => Loc::getMessage(
'LANDING_TYPE_MAINPAGE'),
318 public static function delete($id, $pagesDelete =
false)
329 '=DELETED' => [
'Y',
'N']
332 while ($row =
$res->fetch())
334 if ($row[
'FOLDER_ID'])
341 if (!$resDel->isSuccess())
350 self::clearPing($id);
370 if (
$result->getType() == EventResult::ERROR)
372 $return = new \Bitrix\Main\Result;
383 if (($currentScope =
Site\Type::getCurrentScopeId()))
391 self::clearPing($id);
411 if (
$result->getType() == EventResult::ERROR)
413 $return = new \Bitrix\Main\Result;
427 self::clearPing($id);
440 $result = new \Bitrix\Main\Result;
443 $siteRow = Site::getList([
453 Loc::getMessage(
'LANDING_COPY_ERROR_SITE_NOT_FOUND')
459 'CODE' => $siteRow[
'CODE'],
461 'TITLE' => $siteRow[
'TITLE'],
462 'XML_ID' => $siteRow[
'XML_ID'],
463 'DESCRIPTION' => $siteRow[
'DESCRIPTION'],
464 'TYPE' => $siteRow[
'TYPE'],
465 'SMN_SITE_ID' => $siteRow[
'SMN_SITE_ID'],
466 'LANG' => $siteRow[
'LANG']
501 $siteForExport = intval($siteForExport);
504 $editMode = isset(
$params[
'edit_mode']) &&
$params[
'edit_mode'] ===
'Y';
506 Landing::setEditMode($editMode);
507 Hook::setEditMode($editMode);
513 $params[
'hooks_files'] = Hook::HOOKS_CODES_FILES;
522 !isset(
$params[
'hooks_disable']) ||
523 !is_array(
$params[
'hooks_disable'])
530 preg_match(
'/[^a-z0-9]/i',
$params[
'code'])
533 throw new \Bitrix\Main\Config\ConfigurationException(
534 Loc::getMessage(
'LANDING_EXPORT_ERROR')
538 $params[
'hooks_disable'][] =
'B24BUTTON_CODE';
539 $params[
'hooks_disable'][] =
'FAVICON_PICTURE';
546 while ($row =
$res->fetch())
548 $tplsXml[$row[
'ID']] = $row[
'XML_ID'];
556 'SITE_ID' => $siteForExport
564 if ($pagesCount =
$res->fetch())
566 $pagesCount = $pagesCount[
'CNT'];
583 'SITE_CODE' =>
'SITE.CODE',
584 'SITE_TYPE' =>
'SITE.TYPE',
585 'SITE_TPL_ID' =>
'SITE.TPL_ID',
586 'SITE_TITLE' =>
'SITE.TITLE',
587 'SITE_DESCRIPTION' =>
'SITE.DESCRIPTION',
588 'LANDING_ID_INDEX' =>
'SITE.LANDING_ID_INDEX',
589 'LANDING_ID_404' =>
'SITE.LANDING_ID_404'
592 'SITE_ID' => $siteForExport,
600 if (!($row =
$res->fetch()))
610 'code' => isset(
$params[
'code'])
612 : trim($row[
'SITE_CODE'],
'/'),
613 'code_mainpage' =>
'',
614 'site_code' => $row[
'SITE_CODE'],
615 'name' => isset(
$params[
'name'])
617 : $row[
'SITE_TITLE'],
618 'description' => isset(
$params[
'description'])
620 : $row[
'SITE_DESCRIPTION'],
621 'preview' => isset(
$params[
'preview'])
624 'preview2x' => isset(
$params[
'preview2x'])
627 'preview3x' => isset(
$params[
'preview3x'])
630 'preview_url' => isset(
$params[
'preview_url'])
633 'show_in_list' =>
'Y',
634 'type' => mb_strtolower($row[
'SITE_TYPE']),
635 'version' => $version,
637 'ADDITIONAL_FIELDS' =>
array(),
638 'TITLE' => isset(
$params[
'name'])
640 : $row[
'SITE_TITLE'],
641 'LANDING_ID_INDEX' => $row[
'LANDING_ID_INDEX'],
642 'LANDING_ID_404' => $row[
'LANDING_ID_404']
645 'folders' =>
array(),
646 'syspages' =>
array(),
650 if ($row[
'SITE_TPL_ID'])
652 $export[
'layout'] =
array(
653 'code' => $tplsXml[$row[
'SITE_TPL_ID']],
660 $export[
'syspages'][$syspage[
'TYPE']] = $syspage[
'LANDING_ID'];
663 $hookFields = &$export[
'fields'][
'ADDITIONAL_FIELDS'];
664 foreach (Hook::getForSite($row[
'SITE_ID']) as $hookCode => $hook)
666 if ($hookCode ==
'SETTINGS')
670 foreach ($hook->getFields() as $fCode => $field)
672 $hookCodeFull = $hookCode .
'_' . $fCode;
673 if (!in_array($hookCodeFull,
$params[
'hooks_disable']))
675 $hookFields[$hookCodeFull] = $field->getValue();
676 if (!$hookFields[$hookCodeFull])
678 unset($hookFields[$hookCodeFull]);
681 in_array($hookCodeFull,
$params[
'hooks_files']) &&
682 intval($hookFields[$hookCodeFull]) > 0
685 $hookFields[
'~' . $hookCodeFull] = $hookFields[$hookCodeFull];
687 $hookFields[$hookCodeFull]
689 if ($hookFields[$hookCodeFull])
692 $hookFields[$hookCodeFull]
702 $export[
'items'][$row[
'ID']] =
array(
703 'old_id' => $row[
'ID'],
704 'code' => $pagesCount > 1
705 ? $export[
'code'] .
'/' . $row[
'CODE']
707 'name' => (isset(
$params[
'name']) && $pagesCount == 1)
710 'description' => (isset(
$params[
'description']) && $pagesCount == 1)
712 : $row[
'DESCRIPTION'],
713 'preview' => (isset(
$params[
'preview']) && $pagesCount == 1)
716 'preview2x' => (isset(
$params[
'preview2x']) && $pagesCount == 1)
719 'preview3x' => (isset(
$params[
'preview3x']) && $pagesCount == 1)
722 'preview_url' => (isset(
$params[
'preview_url']) && $pagesCount == 1)
725 'show_in_list' => ($pagesCount == 1) ?
'Y' :
'N',
726 'type' => mb_strtolower($row[
'SITE_TYPE']),
727 'version' => $version,
729 'TITLE' => (isset(
$params[
'name']) && $pagesCount == 1)
732 'RULE' => $row[
'RULE'],
733 'ADDITIONAL_FIELDS' =>
array(),
735 'layout' => $row[
'TPL_ID']
737 'code' => $tplsXml[$row[
'TPL_ID']],
746 $row[
'LANDING_ID_INDEX'] == $row[
'ID']
749 $export[
'code_mainpage'] = $row[
'CODE'];
752 if ($row[
'LANDING_ID_INDEX'] == $row[
'ID'])
754 $export[
'fields'][
'LANDING_ID_INDEX'] = $export[
'items'][$row[
'ID']][
'code'];
756 if ($row[
'LANDING_ID_404'] == $row[
'ID'])
758 $export[
'fields'][
'LANDING_ID_404'] = $export[
'items'][$row[
'ID']][
'code'];
761 $hookFields = &$export[
'items'][$row[
'ID']][
'fields'][
'ADDITIONAL_FIELDS'];
762 foreach (Hook::getForLanding($row[
'ID']) as $hookCode => $hook)
764 if ($hookCode ==
'SETTINGS')
768 foreach ($hook->getFields() as $fCode => $field)
770 $hookCodeFull = $hookCode .
'_' . $fCode;
771 if (!in_array($hookCodeFull,
$params[
'hooks_disable']))
773 $hookFields[$hookCodeFull] = $field->getValue();
774 if (!$hookFields[$hookCodeFull])
776 unset($hookFields[$hookCodeFull]);
779 in_array($hookCodeFull,
$params[
'hooks_files']) &&
780 intval($hookFields[$hookCodeFull]) > 0
783 $hookFields[
'~' . $hookCodeFull] = $hookFields[$hookCodeFull];
785 $hookFields[$hookCodeFull]
787 if ($hookFields[$hookCodeFull])
790 $hookFields[$hookCodeFull]
799 if ($row[
'FOLDER_ID'])
801 if (!isset($export[
'folders'][$row[
'FOLDER_ID']]))
803 $export[
'folders'][$row[
'FOLDER_ID']] =
array();
805 $export[
'folders'][$row[
'FOLDER_ID']][] = $row[
'ID'];
808 $landing = Landing::createInstance($row[
'ID']);
809 if ($landing->exist())
811 foreach ($landing->getBlocks() as $block)
813 if (!$block->isActive())
818 $repoBlock =
array();
819 if ($block->getRepoId())
827 'app_code' => $repoBlock[
'block'][
'app_code'],
828 'xml_id' => $repoBlock[
'block'][
'xml_id']
832 $exportBlock = $block->export();
834 'old_id' => $block->getId(),
835 'code' => $block->getCode(),
836 'access' => $block->getAccess(),
837 'anchor' => $block->getLocalAnchor(),
838 'repo_block' => $repoBlock,
839 'cards' => $exportBlock[
'cards'],
840 'nodes' => $exportBlock[
'nodes'],
841 'menu' => $exportBlock[
'menu'],
842 'style' => array_map(
static function ($style){
843 if (is_array($style) && isset($style[
'classList']))
845 $style = $style[
'classList'];
848 }, $exportBlock[
'style']),
849 'attrs' => $exportBlock[
'attrs'],
850 'dynamic' => $exportBlock[
'dynamic']
852 foreach ($exportItem as
$key => $item)
856 unset($exportItem[
$key]);
859 $export[
'items'][$row[
'ID']][
'items'][
'#block' . $block->getId()] = $exportItem;
863 while ($row =
$res->fetch());
865 if ($export[
'code_mainpage'])
867 $export[
'code'] = $export[
'code'] .
'/' . $export[
'code_mainpage'];
869 unset($export[
'code_mainpage']);
871 $pages = $export[
'items'];
872 $export[
'items'] =
array();
875 if (isset($export[
'layout'][
'ref']))
877 foreach ($export[
'layout'][
'ref'] as &$lid)
879 if (isset($pages[$lid]))
881 $lid = $pages[$lid][
'code'];
888 foreach ($export[
'folders'] as $folderId => $folderPages)
890 $export[
'folders'][
'n' . $nCount] = [];
891 foreach ($folderPages as
$pageId)
895 $export[
'folders'][
'n' . $nCount][] = $pages[
$pageId][
'code'];
898 unset($export[
'folders'][$folderId]);
901 foreach ($export[
'folders'] as $folderId => $folderPages)
903 $export[
'folders'][$folderPages[0]] = $folderPages;
904 unset($export[
'folders'][$folderId]);
907 foreach ($export[
'syspages'] as &$lid)
909 if (isset($pages[$lid]))
911 $lid = $pages[$lid][
'code'];
916 foreach ($pages as
$page)
918 if (isset(
$page[
'layout'][
'ref']))
920 foreach (
$page[
'layout'][
'ref'] as &$lid)
922 if (isset($pages[$lid]))
924 $lid = $pages[$lid][
'code'];
944 static $domains = [];
946 if (isset($hashes[$id]))
960 if ($domain ===
null)
962 if (!isset($domains[$id]))
967 'SITE_DOMAIN' =>
'DOMAIN.DOMAIN'
973 if ($row =
$res->fetch())
975 $domains[$id] = $row[
'SITE_DOMAIN'];
978 $domain = $domains[$id];
993 $hashes[$id] = md5(implode(
'',
$hash));
1006 return \Bitrix\Landing\Internals\SiteTable::switchDomain($siteId1, $siteId2);
1016 return \Bitrix\Landing\Internals\SiteTable::randomizeDomain(
$siteId);
1028 $result = new \Bitrix\Main\Entity\AddResult;
1031 $className = \CBitrixComponent::includeComponentClass(
$componentName);
1033 $demoCmp =
new $className;
1035 $demoCmp->arParams = [
1037 'DISABLE_REDIRECT' =>
'Y'
1039 $res = $demoCmp->actionSelect(
$code, $additional);
1043 $resSite = self::getList([
1054 if ($rowSite = $resSite->fetch())
1056 $result->setId($rowSite[
'ID']);
1061 foreach ($demoCmp->getErrors() as
$code =>
$title)
1079 $result = new \Bitrix\Main\Result();
1083 if ($fromSiteAccess && $toSiteAccess)
1085 Landing::disableCheckUniqueAddress();
1087 $childrenExist =
false;
1088 $res = Folder::getList([
1090 'SITE_ID' => $fromSite
1093 while ($row =
$res->fetch())
1095 $oldId = $row[
'ID'];
1098 if ($row[
'PARENT_ID'])
1100 $childrenExist =
true;
1104 unset($row[
'PARENT_ID']);
1107 if ($row[
'INDEX_ID'])
1109 unset($row[
'INDEX_ID']);
1112 $row[
'SITE_ID'] = $toSite;
1113 $resAdd = Folder::add($row);
1114 $folderMap[$oldId] = $resAdd->isSuccess() ? $resAdd->getId() :
null;
1120 $res = Folder::getList([
1125 'SITE_ID' => $toSite,
1126 '!PARENT_ID' =>
false
1129 while ($row =
$res->fetch())
1131 Folder::update($row[
'ID'], [
1132 'PARENT_ID' => $folderMap[$row[
'PARENT_ID']] ?:
null
1137 Landing::enableCheckUniqueAddress();
1142 Loc::getMessage(
'LANDING_COPY_ERROR_SITE_NOT_FOUND'),
1164 $result = new \Bitrix\Main\Entity\AddResult;
1166 Loc::getMessage(
'LANDING_COPY_ERROR_SITE_NOT_FOUND'),
1189 $result = new \Bitrix\Main\Entity\UpdateResult;
1191 Loc::getMessage(
'LANDING_COPY_ERROR_SITE_NOT_FOUND'),
1208 $result = new \Bitrix\Main\Result;
1209 $siteId = self::getFolder($folderId)[
'SITE_ID'] ??
null;
1219 $char = $mark ?
'Y' :
'N';
1220 foreach ($breadCrumbs as $folder)
1222 if ($folder[
'ACTIVE'] === $char)
1226 if ($folder[
'DELETED'] ===
'Y')
1229 Loc::getMessage(
'LANDING_COPY_ERROR_FOLDER_NOT_FOUND'),
1234 $res = Folder::update($folder[
'ID'], [
1237 if (!
$res->isSuccess())
1247 Loc::getMessage(
'LANDING_COPY_ERROR_FOLDER_NOT_FOUND'),
1264 $returnError =
function()
1266 $result = new \Bitrix\Main\Result;
1268 Loc::getMessage(
'LANDING_COPY_ERROR_FOLDER_NOT_FOUND'),
1274 $folder = Folder::getList([
1282 if ($toSiteId && (
int)$folder[
'SITE_ID'] !== $toSiteId)
1287 if (!$hasRightFrom || !$hasRightTo)
1289 return $returnError();
1296 $toFolder = Folder::getList([
1298 'ID' => $toFolderId,
1299 'SITE_ID' => $toSiteId
1304 return $returnError();
1309 $res = Folder::update($folderId, [
1310 'SITE_ID' => $toSiteId,
1311 'PARENT_ID' => $toFolder[
'ID'] ??
null
1313 if (
$res->isSuccess())
1321 $willBeRoot = !$toFolderId;
1327 $toFolder = Folder::getList([
1334 return $returnError();
1339 $toFolder = $folder;
1345 for (
$i = 0, $c =
count($breadCrumbs);
$i < $c;
$i++)
1347 if ($breadCrumbs[
$i][
'ID'] === $folder[
'ID'])
1349 $result = new \Bitrix\Main\Result;
1351 Loc::getMessage(
'LANDING_COPY_ERROR_MOVE_RESTRICTION'),
1361 if ($hasRightFrom && $hasRightTo)
1363 return Folder::update($folderId, [
1364 'SITE_ID' => $toFolder[
'SITE_ID'],
1365 'PARENT_ID' => !$willBeRoot ? $toFolder[
'ID'] :
null
1370 return $returnError();
1393 $res = Folder::getList([
1396 'DATE_MODIFY' =>
'desc'
1399 while ($row =
$res->fetch())
1401 $folders[$row[
'ID']] = $row;
1414 $folder = Folder::getList([
1428 return is_array($folder) ? $folder :
null;
1438 $folder = self::getFolder($id);
1442 $result = new \Bitrix\Main\Entity\AddResult;
1444 Loc::getMessage(
'LANDING_COPY_ERROR_FOLDER_NOT_FOUND'),
1455 '!==AREAS.ID' =>
null,
1460 $result = new \Bitrix\Main\Entity\AddResult;
1462 Loc::getMessage(
'LANDING_DELETE_FOLDER_ERROR_CONTAINS_AREAS'),
1463 'FOLDER_CONTAINS_AREAS'
1468 $event =
new Event(
'landing',
'onBeforeFolderRecycle', [
1476 if (
$result->getType() == EventResult::ERROR)
1478 $return = new \Bitrix\Main\Result;
1489 if (($currentScope =
Site\Type::getCurrentScopeId()))
1494 $updateResult = Folder::update($id, [
1498 if ($updateResult->isSuccess())
1500 self::setDeletedStatusForFolderLandings($id,
'Y');
1503 return $updateResult;
1513 $folder = self::getFolder($id);
1517 $result = new \Bitrix\Main\Entity\AddResult;
1519 Loc::getMessage(
'LANDING_COPY_ERROR_FOLDER_NOT_FOUND'),
1533 if (
$result->getType() == EventResult::ERROR)
1535 $return = new \Bitrix\Main\Result;
1546 $updateResult = Folder::update($id,
array(
1550 if ($updateResult->isSuccess())
1552 self::setDeletedStatusForFolderLandings($id,
'N');
1555 return $updateResult;
1566 private static function setDeletedStatusForFolderLandings(
int $folderId,
string $deletedValue): void
1568 $folderIds = [$folderId];
1570 if (!empty($subFolderIds))
1572 $folderIds = array_merge($folderIds, $subFolderIds);
1577 'FOLDER_ID' => $folderIds,
1578 '=DELETED' => $deletedValue ===
'Y' ?
'N' :
'Y'
1581 while ($row =
$res->fetch())
1584 'DELETED' => $deletedValue
1598 Landing::setEditMode();
1605 '!==AREAS.ID' =>
null
1608 while ($row =
$res->fetch())
1610 $landing = Landing::createInstance($row[
'ID']);
1611 if ($landing->exist())
1613 foreach ($landing->getBlocks() as $block)
1615 $manifest = $block->getManifest();
1616 if (isset($manifest[
'menu']))
1618 foreach ($manifest[
'menu'] as $menuSelector => $foo)
1620 $block->updateNodes([
1623 'text' =>
$data[
'TITLE'],
1624 'href' =>
'#landing' .
$data[
'ID']
1627 ], [
'appendMenu' =>
true]);
1642 public static function touch(
int $id): void
1644 static $touched = [];
1646 if (isset($touched[$id]))
1651 $touched[$id] =
true;
1669 $return = new \Bitrix\Main\Result;
1673 $verificationError =
new Error();
1676 $return->addError($verificationError->getFirstError());
1684 'ID',
'ACTIVE',
'PUBLIC'
1690 [
'FOLDER_ID' =>
null],
1696 $metrikaType = Metrika\Types::template;
1699 $metrikaType = Metrika\Types::ai;
1704 event: $mark ?
Metrika\Events::publishSite :
Metrika\Events::unpublishSite,
1706 subSection: $metrikaFields?->subSection ??
'from_list',
1707 element: $metrikaFields?->element ??
'manual',
1711 while ($row =
$res->fetch())
1713 if ($row[
'ACTIVE'] !=
'Y')
1715 $row[
'PUBLIC'] =
'N';
1717 if ($row[
'PUBLIC'] ==
'Y')
1721 $landing = Landing::createInstance($row[
'ID'], [
1722 'skip_blocks' =>
true
1727 $resPublication = $landing->publication(
null, $metrikaParams);
1731 $resPublication = $landing->unpublic();
1736 && !$landing->getError()->isEmpty()
1740 $landing->getError()->getFirstError()
1741 ?? new \Bitrix\Main\Error(
'some_error',
'SOME_ERROR')
1743 $return->addError(
$error);
1745 $metrikaParams->error =
$error;
1746 self::sendAnalytics($metrikaParams, $id);
1752 self::sendAnalytics($metrikaParams, $id);
1754 $res = Folder::getList([
1760 '=ACTIVE' => $mark ?
'N' :
'Y',
1764 while ($row =
$res->fetch())
1766 Folder::update($row[
'ID'], [
1767 'ACTIVE' => $mark ?
'Y' :
'N'
1771 return parent::update($id, [
1772 'ACTIVE' => $mark ?
'Y' :
'N'
1783 return self::publication($id,
false);
1793 $site = self::getList([
1803 $metrika =
new Metrika\Metrika(
1804 Metrika\Categories::getBySiteType(
$site[
'TYPE']),
1807 $metrika->setType(
$params->type);
1808 $metrika->setSubSection(
$params->subSection);
1809 $metrika->setElement(
$params->element);
1810 $metrika->setParam(3,
'siteId',
$siteId);
1813 $metrika->setError(
$params->error);
1827 $site = \Bitrix\Landing\Site::getList([
1832 '=TPL_CODE' => $tplCode
1839 return $site[
'ID'] ??
null;
1854 '=SITE.SMN_SITE_ID' =>
$siteId,
1855 'CHECK_PERMISSIONS' =>
'N'
1862 Loc::getMessage(
'LANDING_CLB_ERROR_DELETE_SMN'),
1887 '=SITE.SMN_SITE_ID' =>
$siteId,
1888 '=SITE.DELETED' => [
'Y',
'N'],
1889 '=DELETED' => [
'Y',
'N']
1892 while ($row =
$res->fetch())
1894 $realSiteId = $row[
'SITE_ID'];
1906 '=DELETED' => [
'Y',
'N']
1909 if ($row =
$res->fetch())
1911 $realSiteId = $row[
'ID'];
1917 self::delete($realSiteId);
1931 if (self::getTypes()[
$type] ??
null)
1933 parent::update($id,
array(
1947 parent::update($id,
array(
static addUniqueAgent(string $funcName, array $params=[], int $time=7200, ?int $nextExecDelay=null)
static copySiteFiles($from, $to)
static getFilePath($fileId)
static changeSiteIdRecursive(int $folderId, int $newSiteId)
static getBreadCrumbs(int $folderId, ?int $siteId=null)
static getSubFolderIds(int $folderId)
static getFolderIdsForSite(int $siteId, array $additionalFilter=[])
static getPublicationPath($siteCode=null, $siteId=null, $createPubPath=false)
static getUrlFromFile($file)
static checkSiteVerification(int $_852491107, Error $_1491703301)
static hasAccessForSite($siteId, $accessType, $deleted=false)
static setScope($scope, array $params=[])
static addFolder(int $siteId, array $fields)
static switchDomain(int $siteId1, int $siteId2)
static changeType(int $id, string $type)
static getFolders(int $siteId, array $filter=[])
static addLandingToMenu(int $siteId, array $data)
static updateFolder(int $siteId, int $folderId, array $fields)
static getSiteIdByTemplate(string $tplCode)
static getPreview(int $siteId, bool $skipCloud=false)
static getPublicUrl($id, bool $full=true, bool $hostInclude=true, bool $previewForNotActive=false)
static getAdditionalFields($id)
static moveFolder(int $folderId, ?int $toFolderId, ?int $toSiteId=null)
static ping(int $id, bool $deleted=false)
static publication(int $id, bool $mark=true, ?Metrika\FieldsDto $metrikaFields=null)
static getPublicHash($id, $domain=null)
static fullExport($siteForExport, $params=array())
static copyFolders(int $fromSite, int $toSite, array &$folderMap=[])
static changeCode(int $id, string $code)
static getFolder(int $folderId, string $accessLevel=Rights::ACCESS_TYPES['read'])
static randomizeDomain(int $siteId)
static saveAdditionalFields($id, array $data)
static onBeforeMainSiteDelete($siteId)
static clearPing(int $id)
static getVersion($siteId)
static markFolderUnDelete(int $id)
static onMainSiteDelete($siteId)
static publicationFolder(int $folderId, bool $mark=true)
static markFolderDelete(int $id)
static get(int $id, bool $active=false, bool $force=false)
static getForLanding($id)
fetch(\Bitrix\Main\Text\Converter $converter=null)
static update($primary, array $data)
static getList(array $parameters=array())
</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
const LICENSE_KEY($show_sql_stat=='Y')
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']