Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
site.php
1<?php
3
7use \Bitrix\Landing\Site as SiteCore;
8use \Bitrix\Landing\Landing as LandingCore;
10use \Bitrix\Landing\Transfer\AppConfiguration;
11use \Bitrix\Landing\Block;
12use \Bitrix\Landing\File;
13use \Bitrix\Landing\Hook;
14use \Bitrix\Landing\Template;
15use \Bitrix\Landing\TemplateRef;
16use \Bitrix\Landing\Manager;
17use \Bitrix\Landing\Syspage;
18use \Bitrix\Landing\Internals\BlockTable;
19use \Bitrix\Rest\Marketplace;
20use \Bitrix\Rest\Configuration;
21use \Bitrix\Main\Event;
22use \Bitrix\Main\ORM\Data\AddResult;
23use \Bitrix\Main\Localization\Loc;
24use \Bitrix\Main\ModuleManager;
25
26Loc::loadMessages(__FILE__);
27
31class Site
32{
38 public static function getUrl(string $type): string
39 {
40 if (!\Bitrix\Main\Loader::includeModule('rest'))
41 {
42 return '';
43 }
44 return Marketplace\Url::getConfigurationImportManifestUrl(
45 AppConfiguration::PREFIX_CODE . strtolower($type)
46 );
47 }
48
54 public static function getInitManifest(Event $event): ?array
55 {
56 return [
57 'NEXT' => false
58 ];
59 }
60
67 protected static function importSite(array $data, Configuration\Structure $structure): AddResult
68 {
69 $code = isset($data['CODE']) ? $data['CODE'] : null;
70
71 // clear old keys
72 $notAllowedKeys = [
73 'ID', 'DOMAIN_ID', 'DATE_CREATE', 'DATE_MODIFY',
74 'CREATED_BY_ID', 'MODIFIED_BY_ID', 'CODE'
75 ];
76 foreach ($notAllowedKeys as $key)
77 {
78 if (isset($data[$key]))
79 {
80 unset($data[$key]);
81 }
82 }
83
84 // if site path are exist, create random one
85 if ($code)
86 {
87 $check = SiteCore::getList([
88 'select' => [
89 'ID'
90 ],
91 'filter' => [
92 '=CODE' => $code
93 ]
94 ]);
95 if ($check->fetch())
96 {
97 $code = null;
98 }
99 }
100 if (!$code)
101 {
102 $code = strtolower(\randString(10));
103 }
104 $data['CODE'] = $code;
105 $data['ACTIVE'] = 'Y';
106
107 // files
108 $files = [];
109 foreach (Hook::HOOKS_CODES_FILES as $hookCode)
110 {
111 if (
112 isset($data['ADDITIONAL_FIELDS'][$hookCode]) &&
113 $data['ADDITIONAL_FIELDS'][$hookCode] > 0
114 )
115 {
116 $unpackFile = $structure->getUnpackFile($data['ADDITIONAL_FIELDS'][$hookCode]);
117 if ($unpackFile)
118 {
119 $files[] = $data['ADDITIONAL_FIELDS'][$hookCode] = AppConfiguration::saveFile(
120 $unpackFile
121 );
122 }
123 else
124 {
125 unset($data['ADDITIONAL_FIELDS'][$hookCode]);
126 }
127 }
128 }
129
130 $res = SiteCore::add($data);
131
132 // save files to site
133 if ($files && $res->isSuccess())
134 {
135 foreach ($files as $fileId)
136 {
137 File::addToSite($res->getId(), $fileId);
138 }
139 }
140
141 return $res;
142 }
143
149 public static function nextStep(Event $event): ?array
150 {
151 $code = $event->getParameter('CODE');
152 $content = $event->getParameter('CONTENT');
153 $ratio = $event->getParameter('RATIO');
154 $contextUser = $event->getParameter('CONTEXT_USER');
155 $userId = $event->getParameter('USER_ID');
156 $additional = $event->getParameter('ADDITIONAL_OPTION');
157 $structure = new Configuration\Structure($contextUser);
158 $return = [
159 'RATIO' => isset($ratio[$code]) ? $ratio[$code] : [],
160 'ERROR_EXCEPTION' => []
161 ];
162
163 if (!isset($content['~DATA']))
164 {
165 return null;
166 }
167
168 if ($userId)
169 {
171 }
172
173 // if all import - add page in current site
174 $isPageImport = $return['RATIO']['IS_PAGE_IMPORT'] ?? false;
175 // if only current step add page
176 $isPageStep = false;
177 // if replace landing, not import
178 $isReplaceLanding = $additional && (int)($additional['replaceLid'] ?? 0) > 0;
179 if (isset($ratio[$code]['SITE_ID']) && (int)$ratio[$code]['SITE_ID'] > 0)
180 {
181 $isPageStep = true;
182 }
183 elseif (
184 $additional && (int)$additional['siteId'] > 0
185 )
186 {
187 $return['RATIO']['SITE_ID'] = (int)$additional['siteId'];
188 $isPageImport = $return['RATIO']['IS_PAGE_IMPORT'] ?? true;
189 }
190
191 if ($isReplaceLanding)
192 {
193 $return['RATIO']['REPLACE_ID'] = (int)$additional['replaceLid'];
194 }
195
196 // common ratio params
197 $data = self::prepareData($content['~DATA']);
198 $data = self::prepareAdditionalFields($data, $additional);
199 if ($isReplaceLanding && !$isPageStep)
200 {
201 $return['RATIO']['ADDITIONAL_FIELDS_SITE'] = $data['ADDITIONAL_FIELDS'];
202 }
203 if (!isset($return['RATIO']['SPECIAL_PAGES']))
204 {
205 $return['RATIO']['SPECIAL_PAGES'] = [
206 'LANDING_ID_INDEX' => isset($data['LANDING_ID_INDEX']) ? (int)$data['LANDING_ID_INDEX'] : 0,
207 'LANDING_ID_404' => isset($data['LANDING_ID_404']) ? (int)$data['LANDING_ID_404'] : 0,
208 'LANDING_ID_503' => isset($data['LANDING_ID_503']) ? (int)$data['LANDING_ID_503'] : 0
209 ];
210 }
211 $return['RATIO']['IS_PAGE_IMPORT'] = $isPageImport;
212 $return['RATIO']['TYPE'] = $data['TYPE'];
213
214 // site import
215 if (!$isPageImport && !$isPageStep && !$isReplaceLanding)
216 {
217 Type::setScope($data['TYPE']);
218 $res = self::importSite($data, $structure);
219 if ($res->isSuccess())
220 {
221 $return['RATIO']['BLOCKS'] = [];
222 $return['RATIO']['BLOCKS_PENDING'] = [];
223 $return['RATIO']['LANDINGS'] = [];
224 $return['RATIO']['TEMPLATES'] = [];
225 $return['RATIO']['TEMPLATE_LINKING'] = [];
226 $return['RATIO']['SITE_ID'] = $res->getId();
227 $return['RATIO']['FOLDERS_NEW'] = $data['FOLDERS_NEW'] ?? [];
228 $return['RATIO']['SYS_PAGES'] = $data['SYS_PAGES'];
229
230 if (isset($data['TEMPLATES']) && is_array($data['TEMPLATES']))
231 {
232 $return['RATIO']['TEMPLATES'] = $data['TEMPLATES'];
233 }
234 if (isset($data['TPL_ID']) && $data['TPL_ID'])
235 {
236 $return['RATIO']['TEMPLATE_LINKING'][-1 * $res->getId()] = [
237 'TPL_ID' => (int) $data['TPL_ID'],
238 'TEMPLATE_REF' => isset($data['TEMPLATE_REF'])
239 ? (array) $data['TEMPLATE_REF']
240 : []
241 ];
242 }
243 return $return;
244 }
245
246 $return['ERROR_EXCEPTION'] = $res->getErrorMessages();
247
248 return $return;
249 }
250
251 // something went wrong, site was not created
252 if (!isset($return['RATIO']['SITE_ID']))
253 {
254 $return['ERROR_EXCEPTION'][] = Loc::getMessage('LANDING_IMPORT_ERROR_SITE_ID_NOT_FOUND');
255 return $return;
256 }
257
258 // skip import site step if import page in existing site
259 if (!isset($data['SITE_ID']))
260 {
261 return $return;
262 }
263
264 // not site imports
265 if (isset($return['RATIO']['REPLACE_ID']) && $return['RATIO']['REPLACE_ID'] > 0)
266 {
267 return Landing::replaceLanding($event);
268 }
269
270 return Landing::importLanding($event);
271 }
272
278 protected static function prepareData(array $data): array
279 {
280 if (!isset($data['TYPE']))
281 {
282 $data['TYPE'] = 'PAGE';
283 }
284
285 $data['LANG'] = Manager::getZone();
286
287 return $data;
288 }
289
296 protected static function prepareAdditionalFields(array $data, ?array $additional): array
297 {
298 if ($additional)
299 {
300 if (isset($additional['theme']) && $additional['theme'])
301 {
302 $color = $additional['theme'];
303 if ($color[0] !== '#')
304 {
305 $color = '#' . $color;
306 }
307 $data['ADDITIONAL_FIELDS']['THEME_COLOR'] = $color;
308 unset($data['ADDITIONAL_FIELDS']['THEME_CODE']);
309 $data['ADDITIONAL_FIELDS']['THEME_USE'] = 'Y';
310 }
311
312 if (isset($additional['title']) && $additional['title'])
313 {
314 $data['TITLE'] = $additional['title'];
315 }
316 }
317
318 //default widget value
319 $buttons = B24button::getButtons();
320 $buttonKeys = array_keys($buttons);
321 if (!empty($buttonKeys))
322 {
323 $data['ADDITIONAL_FIELDS']['B24BUTTON_CODE'] = $buttonKeys[0];
324 }
325 else
326 {
327 $data['ADDITIONAL_FIELDS']['B24BUTTON_CODE'] = 'N';
328 }
329 //default site boost
330 $data['ADDITIONAL_FIELDS']['SPEED_USE_WEBPACK'] = 'Y';
331 $data['ADDITIONAL_FIELDS']['SPEED_USE_LAZY'] = 'Y';
332 //default powered by b24
333 $data['ADDITIONAL_FIELDS']['COPYRIGHT_SHOW'] = 'Y';
334 $data['ADDITIONAL_FIELDS']['COPYRIGHT_CODE'] = Copyright::getRandomPhraseId();
335 //default cookie
336 if (in_array(Manager::getZone(), ['es', 'de', 'fr', 'it', 'pl', 'uk']))
337 {
338 $data['ADDITIONAL_FIELDS']['COOKIES_USE'] = 'Y';
339 }
340
341 return $data;
342 }
343
350 protected static function linkingPendingBlocks(array $pendingIds, array $replace): void
351 {
352 $replaceEncoded = base64_encode(serialize($replace));
353 $res = BlockTable::getList([
354 'select' => [
355 'ID'
356 ],
357 'filter' => [
358 'ID' => $pendingIds
359 ]
360 ]);
361 while ($row = $res->fetch())
362 {
363 $blockInstance = new Block($row['ID']);
364 if ($blockInstance->exist())
365 {
366 $blockInstance->updateNodes([
367 AppConfiguration::SYSTEM_COMPONENT_REST_PENDING => [
368 'REPLACE' => $replaceEncoded
369 ]
370 ]);
371 $blockInstance->save();
372 }
373 }
374 }
375
382 protected static function updateFolderIds(int $siteId, array $folderMapIds): void
383 {
384 $res = LandingCore::getList([
385 'select' => [
386 'ID', 'FOLDER_ID'
387 ],
388 'filter' => [
389 'SITE_ID' => $siteId,
390 'FOLDER_ID' => array_keys($folderMapIds)
391 ]
392 ]);
393 while ($row = $res->fetch())
394 {
395 if (isset($folderMapIds[$row['FOLDER_ID']]))
396 {
397 LandingCore::update($row['ID'], [
398 'FOLDER_ID' => $folderMapIds[$row['FOLDER_ID']]
399 ]);
400 }
401 }
402 }
403
411 protected static function addFolders(int $siteId, array $foldersNew, array $landingMapIds): void
412 {
413 if (!$foldersNew)
414 {
415 return;
416 }
417
418 $folderMapIds = [];
419 foreach ($foldersNew as $folderId => $folder)
420 {
421 $indexId = null;
422
423 if (!$folder['PARENT_ID'])
424 {
425 unset($folder['PARENT_ID']);
426 }
427
428 if ($folder['INDEX_ID'] ?? null)
429 {
430 $indexId = $landingMapIds[$folder['INDEX_ID']] ?? null;
431 unset($folder['INDEX_ID']);
432 }
433
434 $res = SiteCore::addFolder($siteId, $folder);
435 if ($res->isSuccess())
436 {
437 if ($indexId)
438 {
439 $resLanding = LandingCore::update($indexId, [
440 'FOLDER_ID' => $res->getId()
441 ]);
442 if ($resLanding->isSuccess())
443 {
444 \Bitrix\Landing\Folder::update($res->getId(), [
445 'INDEX_ID' => $indexId
446 ]);
447 }
448 }
449 $folderMapIds[$folderId] = $res->getId();
450 }
451 }
452
453 $newFolders = SiteCore::getFolders($siteId);
454 foreach ($newFolders as $folder)
455 {
456 if ($folderMapIds[$folder['PARENT_ID']] ?? null)
457 {
458 \Bitrix\Landing\Folder::update($folder['ID'], [
459 'PARENT_ID' => $folderMapIds[$folder['PARENT_ID']]
460 ]);
461 }
462 }
463
464 self::updateFolderIds($siteId, $folderMapIds);
465 }
466
472 public static function onFinish(Event $event): array
473 {
474 $ratio = $event->getParameter('RATIO');
475 $userId = $event->getParameter('USER_ID');
476
477 if ($userId)
478 {
480 }
481
482 if (isset($ratio['LANDING']))
483 {
485 $siteType = $ratio['LANDING']['TYPE'];
486 $siteId = $ratio['LANDING']['SITE_ID'];
487 $blocks = $ratio['LANDING']['BLOCKS'];
488 $landings = $ratio['LANDING']['LANDINGS'];
489 $blocksPending = $ratio['LANDING']['BLOCKS_PENDING'];
490 $foldersRef = $ratio['LANDING']['FOLDERS_REF'];
491 $templatesOld = $ratio['LANDING']['TEMPLATES'];
492 $templateLinking = $ratio['LANDING']['TEMPLATE_LINKING'];
493 $specialPages = $ratio['LANDING']['SPECIAL_PAGES'];
494 $sysPages = $ratio['LANDING']['SYS_PAGES'];
495 $foldersNew = $ratio['LANDING']['FOLDERS_NEW'];
496 $additional = $event->getParameter('ADDITIONAL_OPTION') ?? [];
497
498 // if import just page in existing site
499 $isPageImport = false;
500 $isReplaceLanding = isset($additional['replaceLid']) && (int)$additional['replaceLid'] > 0;
501 if (
502 (isset($additional['siteId']) && (int)$additional['siteId'] > 0)
503 || $isReplaceLanding
504 )
505 {
506 $isPageImport = true;
507 }
508
509 // index page for multipage, or just once - for sigle page import
510 $mainPageId = null;
511 if (!empty($landings))
512 {
513 if ($isPageImport)
514 {
515 $mainPageId = reset($landings);
516 }
517 elseif (
518 $siteId
519 && $specialPages
520 && $specialPages['LANDING_ID_INDEX']
521 && $landings[$specialPages['LANDING_ID_INDEX']]
522 )
523 {
524 $mainPageId = $landings[$specialPages['LANDING_ID_INDEX']];
525 }
526 }
527
528 Type::setScope($siteType);
529 if ($blocksPending)
530 {
531 self::linkingPendingBlocks($blocksPending, [
532 'block' => $blocks,
533 'landing' => $landings
534 ]);
535 }
536 // replace links in blocks content
537 if ($blocks)
538 {
539 $replace = [];
540 ksort($blocks);
541 ksort($landings);
542 $blocks = array_reverse($blocks, true);
543 $landings = array_reverse($landings, true);
544 foreach ($blocks as $oldId => $newId)
545 {
546 $replace['/#block' . $oldId . '([^\d]{1})/'] = '#block' . $newId . '$1';
547 }
548 foreach ($landings as $oldId => $newId)
549 {
550 $replace['/#landing' . $oldId . '([^\d]{1})/'] = '#landing' . $newId . '$1';
551 }
552
553 $res = BlockTable::getList([
554 'select' => [
555 'ID', 'CONTENT'
556 ],
557 'filter' => [
558 'ID' => array_values($blocks),
559 '!ID' => $blocksPending
560 ]
561 ]);
562 while ($row = $res->fetch())
563 {
564 $count = 0;
565 $row['CONTENT'] = preg_replace(
566 array_keys($replace),
567 array_values($replace),
568 $row['CONTENT'],
569 -1,
570 $count
571 );
572 if ($count)
573 {
574 BlockTable::update($row['ID'], [
575 'CONTENT' => $row['CONTENT']
576 ]);
577 }
578 }
579 }
580
581 if (!$isPageImport)
582 {
583 // move pages to the folders if needed (backward compatibility)
584 if ($foldersRef)
585 {
586 $res = LandingCore::getList([
587 'select' => [
588 'ID', 'FOLDER_ID',
589 ],
590 'filter' => [
591 'SITE_ID' => $siteId,
592 'FOLDER_ID' => array_keys($foldersRef),
593 ],
594 ]);
595 while ($row = $res->fetch())
596 {
597 LandingCore::update($row['ID'], [
598 'FOLDER_ID' => $foldersRef[$row['FOLDER_ID']],
599 ]);
600 }
601 }
602 // add folders and move pages (new format)
603 self::addFolders($siteId, $foldersNew, $landings);
604 // gets actual layouts
605 $templatesNew = [];
606 $templatesRefs = [];
607 $res = Template::getList([
608 'select' => [
609 'ID', 'XML_ID',
610 ],
611 ]);
612 while ($row = $res->fetch())
613 {
614 $templatesNew[$row['XML_ID']] = $row['ID'];
615 }
616 foreach ($templatesOld as $oldId => $oldXmlId)
617 {
618 if (is_string($oldXmlId) && isset($templatesNew[$oldXmlId]))
619 {
620 $templatesRefs[$oldId] = $templatesNew[$oldXmlId];
621 }
622 }
623
624 // set layouts to site and landings
625 foreach ($templateLinking as $entityId => $templateItem)
626 {
627 $tplId = $templateItem['TPL_ID'];
628 $tplRefs = [];
629 if (isset($templatesRefs[$tplId]))
630 {
631 $tplId = $templatesRefs[$tplId];
632 foreach ($templateItem['TEMPLATE_REF'] as $areaId => $landingId)
633 {
634 if (intval($landingId) && isset($landings[$landingId]))
635 {
636 $tplRefs[$areaId] = $landings[$landingId];
637 }
638 }
639 if ($entityId < 0)
640 {
641 SiteCore::update(-1 * $entityId, [
642 'TPL_ID' => $tplId,
643 ]);
644 TemplateRef::setForSite(-1 * $entityId, $tplRefs);
645 }
646 else
647 {
648 LandingCore::update($entityId, [
649 'TPL_ID' => $tplId,
650 ]);
651 TemplateRef::setForLanding($entityId, $tplRefs);
652 }
653 }
654 }
655
656 // replace special pages in site (503, 404)
657 if ($specialPages && $siteId)
658 {
659 foreach ($specialPages as $code => $id)
660 {
661 $specialPages[$code] = isset($landings[$id]) ? $landings[$id] : 0;
662 }
663 SiteCore::update($siteId, $specialPages);
664 }
665
666 // system pages
667 if (is_array($sysPages) && $siteId)
668 {
669 foreach ($sysPages as $sysPage)
670 {
671 if (isset($landings[$sysPage['LANDING_ID']]))
672 {
673 Syspage::set($siteId, $sysPage['TYPE'], $landings[$sysPage['LANDING_ID']]);
674 }
675 }
676 }
677 }
678
679 //set default additional fields for page
680 if ($mainPageId && !$isReplaceLanding)
681 {
682 self::setAdditionalPageFields($mainPageId, $additional);
683 }
684
686
687 // link for "go to site" button
688 $linkAttrs = [
689 'class' => 'ui-btn ui-btn-md ui-btn-success ui-btn-round',
690 'data-is-site' => 'Y',
691 'data-site-id' => $siteId,
692 'href' => '#' . $siteId,
693 'target' => '_top'
694 ];
695 if ($mainPageId)
696 {
697 $linkAttrs['data-is-landing'] = 'Y';
698 $linkAttrs['data-landing-id'] = $mainPageId;
699 }
700 $linkText = Loc::getMessage('LANDING_IMPORT_FINISH_GOTO_SITE');
701 if ($siteType === 'KNOWLEDGE')
702 {
703 $linkAttrs['href'] = \Bitrix\Landing\Site::getPublicUrl($siteId);
704 }
705 elseif ($siteType === 'PAGE' && empty($additional))
706 {
707 $linkText = Loc::getMessage('LANDING_IMPORT_FINISH_GOTO_PAGE');
708 $url = Manager::getOption('tmp_last_show_url', '');
709 if ($url === '' && ModuleManager::isModuleInstalled('bitrix24'))
710 {
711 $linkAttrs['href'] = '/sites/';
712 }
713 elseif ($url !== '')
714 {
715 $linkAttrs['href'] = str_replace(
716 [
717 '#site_show#',
718 '#landing_edit#',
719 ],
720 [
721 $siteId,
722 $siteId,
723 ],
724 $url
725 );
726 }
727 }
728
729 if ($isReplaceLanding)
730 {
731 $linkAttrs['data-replace-lid'] = (int)$additional['replaceLid'];
732 }
733
734 $domList = [
735 [
736 'TAG' => 'a',
737 'DATA' => [
738 'attrs' => $linkAttrs,
739 'text' => $linkText,
740 ]
741 ]
742 ];
743
744 if (mb_strpos($linkAttrs['href'], '#') !== 0)
745 {
746 $domList[] = [
747 'TAG' => 'script',
748 'DATA' => [
749 'html' => "top.window.location.href='" . $linkAttrs['href'] . "'",
750 ]
751 ];
752 }
753
754 $isNewAnalytic = false;
755 if (
756 !empty($additional)
757 && array_key_exists('st_category', $additional)
758 && array_key_exists('st_event', $additional)
759 )
760 {
761 $isNewAnalytic = true;
762
763 $analyticData = [
764 'category' => $additional['st_category'],
765 'event' => $additional['st_event'],
766 ];
767 if (array_key_exists('st_section', $additional))
768 {
769 $analyticData['c_section'] = $additional['st_section'];
770 }
771 if (array_key_exists('st_element', $additional))
772 {
773 $analyticData['c_element'] = $additional['st_element'];
774 }
775 if (array_key_exists('app_code', $additional))
776 {
777 $analyticData['params'] = [
778 'appCode' => $additional['app_code'],
779 ];
780 }
781
782 $script = "if (typeof BX.Landing.Metrika !== 'undefined') {";
783 $script .= "const metrika = new BX.Landing.Metrika(true);";
784 $script .= "metrika.sendData(" . \CUtil::PhpToJSObject($analyticData) . ")";
785 $script .= "}";
786 $domList[] = [
787 'TAG' => 'script',
788 'DATA' => [
789 'html' => $script,
790 ]
791 ];
792 }
793
794 return [
795 'CREATE_DOM_LIST' => $domList,
796 'ADDITIONAL' => [
797 'id' => $siteId,
798 'publicUrl' => \Bitrix\Landing\Site::getPublicUrl($siteId),
799 'imageUrl' => Manager::getUrlFromFile(\Bitrix\Landing\Site::getPreview($siteId)),
800 // tmp param - del when all analytic will be new
801 'isNewAnalytic' => $isNewAnalytic ? 'Y' : 'N',
802 ]
803 ];
804 }
805
807
808 return [];
809 }
810
811 protected static function setAdditionalPageFields($landingId, array $additional): void
812 {
813 $additionalFields = [];
814
815 // set Title and Description to mainpage
816 if (!empty($additional))
817 {
818 if (isset($additional['title']))
819 {
820 $additionalFields['METAMAIN_TITLE'] = $additional['title'];
821 $additionalFields['METAOG_TITLE'] = $additional['title'];
822
823 LandingCore::update($landingId, [
824 'TITLE' => $additional['title']
825 ]);
826 }
827 if (isset($additional['description']))
828 {
829 $additionalFields['METAMAIN_DESCRIPTION'] = $additional['description'];
830 $additionalFields['METAOG_DESCRIPTION'] = $additional['description'];
831 }
832 }
833
834 LandingCore::saveAdditionalFields($landingId, $additionalFields);
835 }
836}
static addToSite(int $id, int $fileId, bool $temp=false)
Definition file.php:228
static getOption($code, $default=null)
Definition manager.php:160
static getUrlFromFile($file)
Definition manager.php:1067
static setContextUserId(int $uid)
Definition rights.php:166
static setGlobalOff()
Definition rights.php:105
static set($id, $type, $lid=false)
Definition syspage.php:30
static setForLanding($id, array $data=array())
static setForSite($id, array $data=array())
static importSite(array $data, Configuration\Structure $structure)
Definition site.php:67
static updateFolderIds(int $siteId, array $folderMapIds)
Definition site.php:382
static setAdditionalPageFields($landingId, array $additional)
Definition site.php:811
static linkingPendingBlocks(array $pendingIds, array $replace)
Definition site.php:350
static prepareAdditionalFields(array $data, ?array $additional)
Definition site.php:296
static nextStep(Event $event)
Definition site.php:149
static getInitManifest(Event $event)
Definition site.php:54
static getUrl(string $type)
Definition site.php:38
static onFinish(Event $event)
Definition site.php:472
static addFolders(int $siteId, array $foldersNew, array $landingMapIds)
Definition site.php:411
static prepareData(array $data)
Definition site.php:278
getParameter($key)
Definition event.php:80
static update($primary, array $data)
Definition file.php:228
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getList(array $parameters=array())