4use \Bitrix\Main\Localization\Loc;
6use \Bitrix\Main\EventResult;
30 public static function ping(
int $id,
bool $deleted =
false): bool
32 if (array_key_exists($id, self::$pings))
34 return self::$pings[$id];
42 $filter[
'=DELETED'] = [
'Y',
'N'];
45 $check = Site::getList([
51 self::$pings[$id] = (boolean) $check->fetch();
53 return self::$pings[$id];
63 if (array_key_exists($id, self::$pings))
65 unset(self::$pings[$id]);
77 public static function getPublicUrl($id,
bool $full =
true,
bool $hostInclude =
true,
bool $previewForNotActive =
false)
82 $siteKeyCode = Site\Type::getKeyCode();
84 $hostUrl = Domain::getHostUrl();
86 $res = self::getList(array(
88 'DOMAIN_PROTOCOL' =>
'DOMAIN.PROTOCOL',
89 'DOMAIN_NAME' =>
'DOMAIN.DOMAIN',
100 '=DELETED' => [
'Y',
'N'],
101 'CHECK_PERMISSIONS' =>
'N'
104 while ($row = $res->fetch())
107 $isB24localVar = $isB24;
109 if ($row[
'TYPE'] ==
'SMN')
111 $isB24localVar =
false;
114 if (!$isB24localVar || $disableCloud)
118 $row[
'SMN_SITE_ID'] ? $row[
'SMN_SITE_ID'] : null
120 $pubPath = rtrim($pubPath,
'/');
123 if ($siteKeyCode ==
'ID')
125 $row[
'CODE'] =
'/' . $row[
'ID'] .
'/';
131 $row[
'DOMAIN_PROTOCOL'] = \Bitrix\Landing\Internals\DomainTable::PROTOCOL_HTTPS;
134 if ($row[
'DOMAIN_ID'])
136 $paths[$row[
'ID']] = ($hostInclude ? ($disableCloud ? $hostUrl : $row[
'DOMAIN_PROTOCOL'] .
'://' . $row[
'DOMAIN_NAME']) :
'') . $pubPath;
139 if ($disableCloud && $isB24localVar)
141 $paths[$row[
'ID']] .= $row[
'CODE'];
143 else if (!$isB24localVar)
145 $paths[$row[
'ID']] .=
'/';
151 $paths[$row[
'ID']] = ($hostInclude ? $hostUrl :
'') . $defaultPubPath . ($full ? $row[
'CODE'] :
'');
153 if ($previewForNotActive && ($row[
'ACTIVE'] ===
'N' || $row[
'DELETED'] ===
'Y'))
155 $paths[$row[
'ID']] .=
'preview/' . self::getPublicHash($row[
'ID'], $row[
'DOMAIN_NAME']) .
'/';
165 return isset($paths[$id]) ? $paths[$id] :
'';
176 $res = self::getList([
184 if ($row = $res->fetch())
186 if ($row[
'LANDING_ID_INDEX'])
188 return Landing::createInstance(0)->getPreview($row[
'LANDING_ID_INDEX']);
219 if (isset($versions[$siteId]))
221 return $versions[$siteId];
224 $resSite = self::getList([
232 if ($site = $resSite->fetch())
234 $versions[$siteId] = (int)$site[
'VERSION'];
238 $versions[$siteId] = 0;
241 return $versions[$siteId];
255 foreach (self::getHooks($id) as $hook)
257 $fields += $hook->getPageFields();
281 static $types =
null;
314 public static function delete($id, $pagesDelete =
false)
325 '=DELETED' => [
'Y',
'N']
328 while ($row = $res->fetch())
330 if ($row[
'FOLDER_ID'])
337 if (!$resDel->isSuccess())
345 $result = parent::delete($id);
346 self::clearPing($id);
358 $event =
new Event(
'landing',
'onBeforeSiteRecycle', array(
364 foreach ($event->getResults() as $result)
366 if ($result->getType() == EventResult::ERROR)
368 $return = new \Bitrix\Main\Result;
369 foreach ($result->getErrors() as $error)
379 if (($currentScope =
Site\Type::getCurrentScopeId()))
384 $res = parent::update($id, array(
387 self::clearPing($id);
399 $event =
new Event(
'landing',
'onBeforeSiteRecycle', array(
405 foreach ($event->getResults() as $result)
407 if ($result->getType() == EventResult::ERROR)
409 $return = new \Bitrix\Main\Result;
410 foreach ($result->getErrors() as $error)
420 $res = parent::update($id, array(
423 self::clearPing($id);
433 public static function copy($siteId)
435 $siteId = intval($siteId);
436 $result = new \Bitrix\Main\Result;
439 $siteRow = Site::getList([
454 $result = Site::add([
455 'CODE' => $siteRow[
'CODE'],
457 'TITLE' => $siteRow[
'TITLE'],
458 'XML_ID' => $siteRow[
'XML_ID'],
459 'DESCRIPTION' => $siteRow[
'DESCRIPTION'],
460 'TYPE' => $siteRow[
'TYPE'],
461 'SMN_SITE_ID' => $siteRow[
'SMN_SITE_ID'],
462 'LANG' => $siteRow[
'LANG']
465 if ($result->isSuccess())
480 if (!$error->isEmpty())
482 $result->addError($error->getFirstError());
494 public static function fullExport($siteForExport, $params = array())
497 $siteForExport = intval($siteForExport);
500 $editMode = isset($params[
'edit_mode']) && $params[
'edit_mode'] ===
'Y';
502 Landing::setEditMode($editMode);
505 if (!is_array($params))
511 if (isset($params[
'scope']))
513 Site\Type::setScope($params[
'scope']);
518 !isset($params[
'hooks_disable']) ||
519 !is_array($params[
'hooks_disable'])
522 $params[
'hooks_disable'] = array();
525 isset($params[
'code']) &&
526 preg_match(
'/[^a-z0-9]/i', $params[
'code'])
529 throw new \Bitrix\Main\Config\ConfigurationException(
534 $params[
'hooks_disable'][] =
'B24BUTTON_CODE';
535 $params[
'hooks_disable'][] =
'FAVICON_PICTURE';
537 $res = Template::getList(array(
542 while ($row = $res->fetch())
544 $tplsXml[$row[
'ID']] = $row[
'XML_ID'];
552 'SITE_ID' => $siteForExport
560 if ($pagesCount = $res->fetch())
562 $pagesCount = $pagesCount[
'CNT'];
579 'SITE_CODE' =>
'SITE.CODE',
580 'SITE_TYPE' =>
'SITE.TYPE',
581 'SITE_TPL_ID' =>
'SITE.TPL_ID',
582 'SITE_TITLE' =>
'SITE.TITLE',
583 'SITE_DESCRIPTION' =>
'SITE.DESCRIPTION',
584 'LANDING_ID_INDEX' =>
'SITE.LANDING_ID_INDEX',
585 'LANDING_ID_404' =>
'SITE.LANDING_ID_404'
588 'SITE_ID' => $siteForExport,
596 if (!($row = $res->fetch()))
605 'charset' => SITE_CHARSET,
606 'code' => isset($params[
'code'])
608 : trim($row[
'SITE_CODE'],
'/'),
609 'code_mainpage' =>
'',
610 'site_code' => $row[
'SITE_CODE'],
611 'name' => isset($params[
'name'])
613 : $row[
'SITE_TITLE'],
614 'description' => isset($params[
'description'])
615 ? $params[
'description']
616 : $row[
'SITE_DESCRIPTION'],
617 'preview' => isset($params[
'preview'])
620 'preview2x' => isset($params[
'preview2x'])
621 ? $params[
'preview2x']
623 'preview3x' => isset($params[
'preview3x'])
624 ? $params[
'preview3x']
626 'preview_url' => isset($params[
'preview_url'])
627 ? $params[
'preview_url']
629 'show_in_list' =>
'Y',
630 'type' => mb_strtolower($row[
'SITE_TYPE']),
631 'version' => $version,
633 'ADDITIONAL_FIELDS' => array(),
634 'TITLE' => isset($params[
'name'])
636 : $row[
'SITE_TITLE'],
637 'LANDING_ID_INDEX' => $row[
'LANDING_ID_INDEX'],
638 'LANDING_ID_404' => $row[
'LANDING_ID_404']
641 'folders' => array(),
642 'syspages' => array(),
646 if ($row[
'SITE_TPL_ID'])
648 $export[
'layout'] = array(
649 'code' => $tplsXml[$row[
'SITE_TPL_ID']],
656 $export[
'syspages'][$syspage[
'TYPE']] = $syspage[
'LANDING_ID'];
659 $hookFields = &$export[
'fields'][
'ADDITIONAL_FIELDS'];
662 if ($hookCode ==
'SETTINGS')
666 foreach ($hook->getFields() as $fCode => $field)
668 $hookCodeFull = $hookCode .
'_' . $fCode;
669 if (!in_array($hookCodeFull, $params[
'hooks_disable']))
671 $hookFields[$hookCodeFull] = $field->getValue();
672 if (!$hookFields[$hookCodeFull])
674 unset($hookFields[$hookCodeFull]);
677 in_array($hookCodeFull, $params[
'hooks_files']) &&
678 intval($hookFields[$hookCodeFull]) > 0
681 $hookFields[
'~' . $hookCodeFull] = $hookFields[$hookCodeFull];
683 $hookFields[$hookCodeFull]
685 if ($hookFields[$hookCodeFull])
688 $hookFields[$hookCodeFull]
698 $export[
'items'][$row[
'ID']] = array(
699 'old_id' => $row[
'ID'],
700 'code' => $pagesCount > 1
701 ? $export[
'code'] .
'/' . $row[
'CODE']
703 'name' => (isset($params[
'name']) && $pagesCount == 1)
706 'description' => (isset($params[
'description']) && $pagesCount == 1)
707 ? $params[
'description']
708 : $row[
'DESCRIPTION'],
709 'preview' => (isset($params[
'preview']) && $pagesCount == 1)
712 'preview2x' => (isset($params[
'preview2x']) && $pagesCount == 1)
713 ? $params[
'preview2x']
715 'preview3x' => (isset($params[
'preview3x']) && $pagesCount == 1)
716 ? $params[
'preview3x']
718 'preview_url' => (isset($params[
'preview_url']) && $pagesCount == 1)
719 ? $params[
'preview_url']
721 'show_in_list' => ($pagesCount == 1) ?
'Y' :
'N',
722 'type' => mb_strtolower($row[
'SITE_TYPE']),
723 'version' => $version,
725 'TITLE' => (isset($params[
'name']) && $pagesCount == 1)
728 'RULE' => $row[
'RULE'],
729 'ADDITIONAL_FIELDS' => array(),
731 'layout' => $row[
'TPL_ID']
733 'code' => $tplsXml[$row[
'TPL_ID']],
742 $row[
'LANDING_ID_INDEX'] == $row[
'ID']
745 $export[
'code_mainpage'] = $row[
'CODE'];
748 if ($row[
'LANDING_ID_INDEX'] == $row[
'ID'])
750 $export[
'fields'][
'LANDING_ID_INDEX'] = $export[
'items'][$row[
'ID']][
'code'];
752 if ($row[
'LANDING_ID_404'] == $row[
'ID'])
754 $export[
'fields'][
'LANDING_ID_404'] = $export[
'items'][$row[
'ID']][
'code'];
757 $hookFields = &$export[
'items'][$row[
'ID']][
'fields'][
'ADDITIONAL_FIELDS'];
760 if ($hookCode ==
'SETTINGS')
764 foreach ($hook->getFields() as $fCode => $field)
766 $hookCodeFull = $hookCode .
'_' . $fCode;
767 if (!in_array($hookCodeFull, $params[
'hooks_disable']))
769 $hookFields[$hookCodeFull] = $field->getValue();
770 if (!$hookFields[$hookCodeFull])
772 unset($hookFields[$hookCodeFull]);
775 in_array($hookCodeFull, $params[
'hooks_files']) &&
776 intval($hookFields[$hookCodeFull]) > 0
779 $hookFields[
'~' . $hookCodeFull] = $hookFields[$hookCodeFull];
781 $hookFields[$hookCodeFull]
783 if ($hookFields[$hookCodeFull])
786 $hookFields[$hookCodeFull]
795 if ($row[
'FOLDER_ID'])
797 if (!isset($export[
'folders'][$row[
'FOLDER_ID']]))
799 $export[
'folders'][$row[
'FOLDER_ID']] = array();
801 $export[
'folders'][$row[
'FOLDER_ID']][] = $row[
'ID'];
804 $landing = Landing::createInstance($row[
'ID']);
805 if ($landing->exist())
807 foreach ($landing->getBlocks() as $block)
809 if (!$block->isActive())
814 $repoBlock = array();
815 if ($block->getRepoId())
823 'app_code' => $repoBlock[
'block'][
'app_code'],
824 'xml_id' => $repoBlock[
'block'][
'xml_id']
828 $exportBlock = $block->export();
830 'old_id' => $block->getId(),
831 'code' => $block->getCode(),
832 'access' => $block->getAccess(),
833 'anchor' => $block->getLocalAnchor(),
834 'repo_block' => $repoBlock,
835 'cards' => $exportBlock[
'cards'],
836 'nodes' => $exportBlock[
'nodes'],
837 'menu' => $exportBlock[
'menu'],
838 'style' => array_map(
static function ($style){
839 if (is_array($style) && isset($style[
'classList']))
841 $style = $style[
'classList'];
844 }, $exportBlock[
'style']),
845 'attrs' => $exportBlock[
'attrs'],
846 'dynamic' => $exportBlock[
'dynamic']
848 foreach ($exportItem as $key => $item)
852 unset($exportItem[$key]);
855 $export[
'items'][$row[
'ID']][
'items'][
'#block' . $block->getId()] = $exportItem;
859 while ($row = $res->fetch());
861 if ($export[
'code_mainpage'])
863 $export[
'code'] = $export[
'code'] .
'/' . $export[
'code_mainpage'];
865 unset($export[
'code_mainpage']);
867 $pages = $export[
'items'];
868 $export[
'items'] = array();
871 if (isset($export[
'layout'][
'ref']))
873 foreach ($export[
'layout'][
'ref'] as &$lid)
875 if (isset($pages[$lid]))
877 $lid = $pages[$lid][
'code'];
884 foreach ($export[
'folders'] as $folderId => $folderPages)
886 $export[
'folders'][
'n' . $nCount] = [];
887 foreach ($folderPages as $pageId)
889 if (isset($pages[$pageId]))
891 $export[
'folders'][
'n' . $nCount][] = $pages[$pageId][
'code'];
894 unset($export[
'folders'][$folderId]);
897 foreach ($export[
'folders'] as $folderId => $folderPages)
899 $export[
'folders'][$folderPages[0]] = $folderPages;
900 unset($export[
'folders'][$folderId]);
903 foreach ($export[
'syspages'] as &$lid)
905 if (isset($pages[$lid]))
907 $lid = $pages[$lid][
'code'];
912 foreach ($pages as $page)
914 if (isset($page[
'layout'][
'ref']))
916 foreach ($page[
'layout'][
'ref'] as &$lid)
918 if (isset($pages[$lid]))
920 $lid = $pages[$lid][
'code'];
925 $export[
'items'][$page[
'code']] = $page;
940 static $domains = [];
942 if (isset($hashes[$id]))
956 if ($domain ===
null)
958 if (!isset($domains[$id]))
961 $res = self::getList(array(
963 'SITE_DOMAIN' =>
'DOMAIN.DOMAIN'
969 if ($row = $res->fetch())
971 $domains[$id] = $row[
'SITE_DOMAIN'];
974 $domain = $domains[$id];
986 $hash[] = LICENSE_KEY;
989 $hashes[$id] = md5(implode(
'', $hash));
1002 return \Bitrix\Landing\Internals\SiteTable::switchDomain($siteId1, $siteId2);
1012 return \Bitrix\Landing\Internals\SiteTable::randomizeDomain($siteId);
1022 public static function addByTemplate(
string $code,
string $type, $additional =
null): \
Bitrix\Main\
Entity\
AddResult
1024 $result = new \Bitrix\Main\Entity\AddResult;
1026 $componentName =
'bitrix:landing.demo';
1027 $className = \CBitrixComponent::includeComponentClass($componentName);
1029 $demoCmp =
new $className;
1030 $demoCmp->initComponent($componentName);
1031 $demoCmp->arParams = [
1033 'DISABLE_REDIRECT' =>
'Y'
1035 $res = $demoCmp->actionSelect($code, $additional);
1039 $resSite = self::getList([
1050 if ($rowSite = $resSite->fetch())
1052 $result->setId($rowSite[
'ID']);
1057 foreach ($demoCmp->getErrors() as $code => $title)
1059 $result->addError(
new \
Bitrix\Main\Error($title, $code));
1075 $result = new \Bitrix\Main\Result();
1079 if ($fromSiteAccess && $toSiteAccess)
1081 Landing::disableCheckUniqueAddress();
1083 $childrenExist =
false;
1084 $res = Folder::getList([
1086 'SITE_ID' => $fromSite
1089 while ($row = $res->fetch())
1091 $oldId = $row[
'ID'];
1094 if ($row[
'PARENT_ID'])
1096 $childrenExist =
true;
1100 unset($row[
'PARENT_ID']);
1103 if ($row[
'INDEX_ID'])
1105 unset($row[
'INDEX_ID']);
1108 $row[
'SITE_ID'] = $toSite;
1109 $resAdd = Folder::add($row);
1110 $folderMap[$oldId] = $resAdd->isSuccess() ? $resAdd->getId() :
null;
1116 $res = Folder::getList([
1121 'SITE_ID' => $toSite,
1122 '!PARENT_ID' =>
false
1125 while ($row = $res->fetch())
1127 Folder::update($row[
'ID'], [
1128 'PARENT_ID' => $folderMap[$row[
'PARENT_ID']] ?: null
1133 Landing::enableCheckUniqueAddress();
1155 $fields[
'SITE_ID'] = $siteId;
1156 $result = Folder::add($fields);
1160 $result = new \Bitrix\Main\Entity\AddResult;
1180 $fields[
'SITE_ID'] = $siteId;
1181 $result = Folder::update($folderId, $fields);
1185 $result = new \Bitrix\Main\Entity\UpdateResult;
1204 $result = new \Bitrix\Main\Result;
1205 $siteId = self::getFolder($folderId)[
'SITE_ID'] ??
null;
1215 $char = $mark ?
'Y' :
'N';
1216 foreach ($breadCrumbs as $folder)
1218 if ($folder[
'ACTIVE'] === $char)
1222 if ($folder[
'DELETED'] ===
'Y')
1230 $res = Folder::update($folder[
'ID'], [
1233 if (!$res->isSuccess())
1260 $returnError =
function()
1262 $result = new \Bitrix\Main\Result;
1270 $folder = Folder::getList([
1278 if ($toSiteId && (
int)$folder[
'SITE_ID'] !== $toSiteId)
1283 if (!$hasRightFrom || !$hasRightTo)
1285 return $returnError();
1292 $toFolder = Folder::getList([
1294 'ID' => $toFolderId,
1295 'SITE_ID' => $toSiteId
1300 return $returnError();
1305 $res = Folder::update($folderId, [
1306 'SITE_ID' => $toSiteId,
1307 'PARENT_ID' => $toFolder[
'ID'] ??
null
1309 if ($res->isSuccess())
1317 $willBeRoot = !$toFolderId;
1323 $toFolder = Folder::getList([
1330 return $returnError();
1335 $toFolder = $folder;
1341 for ($i = 0, $c = count($breadCrumbs); $i < $c; $i++)
1343 if ($breadCrumbs[$i][
'ID'] === $folder[
'ID'])
1345 $result = new \Bitrix\Main\Result;
1357 if ($hasRightFrom && $hasRightTo)
1359 return Folder::update($folderId, [
1360 'SITE_ID' => $toFolder[
'SITE_ID'],
1361 'PARENT_ID' => !$willBeRoot ? $toFolder[
'ID'] : null
1366 return $returnError();
1375 public static function getFolders(
int $siteId, array $filter = []): array
1382 if (!isset($filter[
'DELETED']) && !isset($filter[
'=DELETED']))
1384 $filter[
'=DELETED'] =
'N';
1388 $filter[
'SITE_ID'] = $siteId;
1389 $res = Folder::getList([
1390 'filter' => $filter,
1392 'DATE_MODIFY' =>
'desc'
1395 while ($row = $res->fetch())
1397 $folders[$row[
'ID']] = $row;
1410 $folder = Folder::getList([
1424 return is_array($folder) ? $folder :
null;
1434 $folder = self::getFolder($id);
1438 $result = new \Bitrix\Main\Entity\AddResult;
1451 '!==AREAS.ID' =>
null,
1456 $result = new \Bitrix\Main\Entity\AddResult;
1459 'FOLDER_CONTAINS_AREAS'
1464 $event =
new Event(
'landing',
'onBeforeFolderRecycle', [
1470 foreach ($event->getResults() as $result)
1472 if ($result->getType() == EventResult::ERROR)
1474 $return = new \Bitrix\Main\Result;
1475 foreach ($result->getErrors() as $error)
1485 if (($currentScope =
Site\Type::getCurrentScopeId()))
1490 return Folder::update($id, [
1502 $folder = self::getFolder($id);
1506 $result = new \Bitrix\Main\Entity\AddResult;
1514 $event =
new Event(
'landing',
'onBeforeFolderRecycle', array(
1520 foreach ($event->getResults() as $result)
1522 if ($result->getType() == EventResult::ERROR)
1524 $return = new \Bitrix\Main\Result;
1525 foreach ($result->getErrors() as $error)
1535 return Folder::update($id, array(
1549 Landing::setEditMode();
1555 'SITE_ID' => $siteId,
1556 '!==AREAS.ID' =>
null
1559 while ($row = $res->fetch())
1561 $landing = Landing::createInstance($row[
'ID']);
1562 if ($landing->exist())
1564 foreach ($landing->getBlocks() as $block)
1566 $manifest = $block->getManifest();
1567 if (isset($manifest[
'menu']))
1569 foreach ($manifest[
'menu'] as $menuSelector => $foo)
1571 $block->updateNodes([
1574 'text' => $data[
'TITLE'],
1575 'href' =>
'#landing' . $data[
'ID']
1578 ], [
'appendMenu' =>
true]);
1593 public static function touch(
int $id): void
1595 static $touched = [];
1597 if (isset($touched[$id]))
1602 $touched[$id] =
true;
1617 $return = new \Bitrix\Main\Result;
1621 $verificationError =
new Error();
1624 $return->addError($verificationError->getFirstError());
1632 'ID',
'ACTIVE',
'PUBLIC'
1638 [
'FOLDER_ID' =>
null],
1643 while ($row = $res->fetch())
1645 if ($row[
'ACTIVE'] !=
'Y')
1647 $row[
'PUBLIC'] =
'N';
1649 if ($row[
'PUBLIC'] ==
'Y')
1653 $landing = Landing::createInstance($row[
'ID'], [
1654 'skip_blocks' =>
true
1659 $resPublication = $landing->publication();
1663 $resPublication = $landing->unpublic();
1666 if (!$resPublication)
1668 if (!$landing->getError()->isEmpty())
1670 $error = $landing->getError()->getFirstError();
1672 $error->getMessage(),
1680 $res = Folder::getList([
1686 '=ACTIVE' => $mark ?
'N' :
'Y',
1690 while ($row = $res->fetch())
1692 Folder::update($row[
'ID'], [
1693 'ACTIVE' => $mark ?
'Y' :
'N'
1697 return parent::update($id, [
1698 'ACTIVE' => $mark ?
'Y' :
'N'
1709 return self::publication($id,
false);
1719 $site = \Bitrix\Landing\Site::getList([
1724 '=TPL_CODE' => $tplCode
1731 return $site[
'ID'] ??
null;
1746 '=SITE.SMN_SITE_ID' => $siteId,
1747 'CHECK_PERMISSIONS' =>
'N'
1779 '=SITE.SMN_SITE_ID' => $siteId,
1780 '=SITE.DELETED' => [
'Y',
'N'],
1781 '=DELETED' => [
'Y',
'N']
1784 while ($row = $res->fetch())
1786 $realSiteId = $row[
'SITE_ID'];
1792 $res = self::getList(array(
1797 '=SMN_SITE_ID' => $siteId,
1798 '=DELETED' => [
'Y',
'N']
1801 if ($row = $res->fetch())
1803 $realSiteId = $row[
'ID'];
1809 self::delete($realSiteId);
1823 if (self::getTypes()[$type] ??
null)
1825 parent::update($id, array(
1839 parent::update($id, array(
static addUniqueAgent(string $funcName, array $params=[], int $time=7200, ?int $nextExecDelay=null)
addError($code, $message='')
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 copySite($from, $to)
static getForLanding($id)
static setEditMode(bool $mode=true)
static saveForSite(int $id, array $data)
static getPublicationPath($siteCode=null, $siteId=null, $createPubPath=false)
static getUrlFromFile($file)
static checkSiteVerification(int $_1798975350, Error $_268582848)
static hasAccessForSite($siteId, $accessType, $deleted=false)
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)
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)
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)
static update($primary, array $data)
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)
static getList(array $parameters=array())