Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
landing.php
1<?php
3
4use \Bitrix\Landing\Hook;
5use \Bitrix\Landing\Manager;
6use \Bitrix\Landing\File;
7use \Bitrix\Landing\Folder;
8use \Bitrix\Landing\Site;
9use \Bitrix\Landing\Block as BlockCore;
10use \Bitrix\Landing\TemplateRef;
11use \Bitrix\Landing\Landing as LandingCore;
12use \Bitrix\Landing\PublicActionResult;
13use \Bitrix\Landing\Internals\HookDataTable;
14use \Bitrix\Landing\History;
15use \Bitrix\Main\Localization\Loc;
16
17Loc::loadMessages(__FILE__);
18
20{
26 protected static function clearDisallowFields(array $fields)
27 {
28 $disallow = ['RULE', 'TPL_CODE', 'ACTIVE', 'INITIATOR_APP_CODE', 'VIEWS'];
29
30 if (is_array($fields))
31 {
32 foreach ($fields as $k => $v)
33 {
34 if (in_array($k, $disallow))
35 {
36 unset($fields[$k]);
37 }
38 }
39 }
40
41 return $fields;
42 }
43
49 public static function getPreview($lid)
50 {
51 $result = new PublicActionResult();
52 $landing = LandingCore::createInstance($lid, [
53 'skip_blocks' => true
54 ]);
55
56 if ($landing->exist())
57 {
58 $result->setResult($landing->getPreview());
59 }
60 $result->setError($landing->getError());
61
62 return $result;
63 }
64
70 public static function getPublicUrl($lid)
71 {
72 $result = new PublicActionResult();
73 $landing = LandingCore::createInstance($lid, [
74 'skip_blocks' => true
75 ]);
76
77 if ($landing->exist())
78 {
79 $result->setResult(
80 $landing->getPublicUrl()
81 );
82 }
83 $result->setError($landing->getError());
84
85 return $result;
86 }
87
94 public static function resolveIdByPublicUrl(string $landingUrl, int $siteId): PublicActionResult
95 {
96 $result = new PublicActionResult();
97 $result->setResult(LandingCore::resolveIdByPublicUrl($landingUrl, $siteId));
98 return $result;
99 }
100
106 public static function getAdditionalFields($lid)
107 {
108 $result = new PublicActionResult();
109 $landing = LandingCore::createInstance($lid, [
110 'skip_blocks' => true
111 ]);
112
113 if ($landing->exist())
114 {
115 $fields = $landing->getAdditionalFields($landing->getId());
116 foreach ($fields as $key => $field)
117 {
118 $fields[$key] = $field->getValue();
119 if (!$fields[$key])
120 {
121 unset($fields[$key]);
122 }
123 }
124 $result->setResult(
125 $fields
126 );
127 }
128 $result->setError($landing->getError());
129
130 return $result;
131 }
132
138 public static function publication($lid)
139 {
140 $result = new PublicActionResult();
141 $landing = LandingCore::createInstance($lid, [
142 'skip_blocks' => true
143 ]);
144
145 if ($landing->exist())
146 {
147 if ($landing->publication())
148 {
149 $result->setResult(true);
150 }
151 }
152
153 $result->setError($landing->getError());
154
155 return $result;
156 }
157
163 public static function unpublic($lid)
164 {
165 $result = new PublicActionResult();
166 $landing = LandingCore::createInstance($lid, [
167 'skip_blocks' => true
168 ]);
169
170 if ($landing->exist())
171 {
172 $result->setResult(
173 $landing->unpublic()
174 );
175 }
176
177 $result->setError($landing->getError());
178
179 return $result;
180 }
181
189 public static function addBlock($lid, array $fields, bool $preventHistory = false)
190 {
191 LandingCore::setEditMode();
192 Hook::setEditMode(true);
193
194 $result = new PublicActionResult();
195 $landing = LandingCore::createInstance($lid);
196 if ($landing->exist())
197 {
198 $data = array(
199 'PUBLIC' => 'N',
200 );
201 if (isset($fields['ACTIVE']))
202 {
203 $data['ACTIVE'] = $fields['ACTIVE'];
204 }
205 if (isset($fields['CONTENT']))
206 {
207 $data['CONTENT'] = Manager::sanitize(
208 $fields['CONTENT'],
209 $bad
210 );
211 }
212 // sort
213 if (isset($fields['AFTER_ID']))
214 {
215 $blocks = $landing->getBlocks();
216 if (isset($blocks[$fields['AFTER_ID']]))
217 {
218 $data['SORT'] = $blocks[$fields['AFTER_ID']]->getSort() + 1;
219 }
220 }
221 else
222 {
223 $data['SORT'] = -1;
224 }
225 $preventHistory ? History::deactivate() : History::activate();
226 $newBlockId = $landing->addBlock($fields['CODE'] ?? '', $data, true);
227 $landing->resortBlocks();
228
229 // want return content ob block
230 if (
231 isset($fields['RETURN_CONTENT']) &&
232 $fields['RETURN_CONTENT'] == 'Y'
233 )
234 {
235 $return = BlockCore::getBlockContent($newBlockId, true);
236 }
237 else
238 {
239 $return = $newBlockId;
240 }
241 $result->setResult($return);
242 }
243 $result->setError($landing->getError());
244 return $result;
245 }
246
253 public static function deleteBlock($lid, $block)
254 {
255 LandingCore::setEditMode();
256
257 $result = new PublicActionResult();
258 $landing = LandingCore::createInstance($lid);
259 if ($landing->exist())
260 {
261 $result->setResult($landing->deleteBlock($block));
262 $landing->resortBlocks();
263 }
264 $result->setError($landing->getError());
265 return $result;
266 }
267
276 public static function markDeletedBlock(int $lid, int $block, bool $mark = true, bool $preventHistory = false): PublicActionResult
277 {
278 LandingCore::setEditMode();
279
280 $result = new PublicActionResult();
281 $landing = LandingCore::createInstance($lid);
282 if ($landing->exist())
283 {
284 $preventHistory ? History::deactivate() : History::activate();
285 $result->setResult(
286 $landing->markDeletedBlock($block, $mark)
287 );
288 $landing->resortBlocks();
289 }
290 $result->setError($landing->getError());
291 return $result;
292 }
293
301 public static function markUnDeletedBlock(int $lid, int $block, bool $preventHistory = false): PublicActionResult
302 {
303 return self::markDeletedBlock($lid, $block, false, $preventHistory);
304 }
305
313 private static function sort(int $lid, int $block, string $action): PublicActionResult
314 {
315 $result = new PublicActionResult();
316 $landing = LandingCore::createInstance($lid);
317 if ($landing->exist())
318 {
319 if ($action === 'up')
320 {
321 $result->setResult($landing->upBlock($block));
322 }
323 else
324 {
325 $result->setResult($landing->downBlock($block));
326 }
327 if ($landing->getError()->isEmpty())
328 {
329 $landing->resortBlocks();
330 }
331 }
332 $result->setError($landing->getError());
333
334 return $result;
335 }
336
344 public static function upBlock(int $lid, int $block, bool $preventHistory = false): PublicActionResult
345 {
346 LandingCore::setEditMode();
347 $preventHistory ? History::deactivate() : History::activate();
348
349 return self::sort($lid, $block, 'up');
350 }
351
359 public static function downBlock(int $lid, int $block, bool $preventHistory = false): PublicActionResult
360 {
361 LandingCore::setEditMode();
362 $preventHistory ? History::deactivate() : History::activate();
363
364 return self::sort($lid, $block, 'down');
365 }
366
374 public static function favoriteBlock(int $lid, int $block, array $meta = []): PublicActionResult
375 {
376 $result = new PublicActionResult();
377 LandingCore::setEditMode();
378 $landing = LandingCore::createInstance($lid);
379 if ($landing->exist())
380 {
381 $result->setResult($landing->favoriteBlock($block, $meta));
382 }
383 $result->setError($landing->getError());
384 return $result;
385 }
386
392 public static function unFavoriteBlock(int $blockId): PublicActionResult
393 {
394 $result = new PublicActionResult();
395 LandingCore::setEditMode();
396 $landing = LandingCore::createInstance(0);
397 $delResult = $landing->unFavoriteBlock($blockId);
398 if ($delResult)
399 {
400 $result->setResult($delResult);
401 }
402 else
403 {
404 $result->setError($landing->getError());
405 }
406 return $result;
407 }
408
416 private static function activate($lid, $block, $action)
417 {
418 $result = new PublicActionResult();
419 $landing = LandingCore::createInstance($lid);
420 if ($landing->exist())
421 {
422 if ($action == 'show')
423 {
424 $result->setResult($landing->showBlock($block));
425 }
426 else
427 {
428 $result->setResult($landing->hideBlock($block));
429 }
430 }
431 $result->setError($landing->getError());
432 return $result;
433 }
434
441 public static function showBlock($lid, $block)
442 {
443 LandingCore::setEditMode();
444 return self::activate($lid, $block, 'show');
445 }
446
453 public static function hideBlock($lid, $block)
454 {
455 LandingCore::setEditMode();
456 return self::activate($lid, $block, 'hide');
457 }
458
466 private static function changeParentOfBlock($lid, $block, array $params)
467 {
468 $result = new PublicActionResult();
469 $landing = LandingCore::createInstance($lid);
470 $afterId = isset($params['AFTER_ID']) ? $params['AFTER_ID'] : 0;
471 if ($landing->exist())
472 {
473 if ($params['MOVE'])
474 {
475 $res = $landing->moveBlock($block, $afterId);
476 }
477 else
478 {
479 $res = $landing->copyBlock($block, $afterId);
480 }
481
482 if (
483 isset($params['RETURN_CONTENT']) &&
484 $params['RETURN_CONTENT'] == 'Y'
485 )
486 {
487 $result->setResult(array(
488 'result' => $res > 0,
489 'content' => BlockCore::getBlockContent($res, true)
490 ));
491 }
492 else
493 {
494 $result->setResult($res);
495 }
496 }
497 $result->setError($landing->getError());
498 return $result;
499 }
500
508 public static function copyBlock($lid, $block, array $params = array())
509 {
510 if (!is_array($params))
511 {
512 $params = array();
513 }
514 $params['MOVE'] = false;
515 LandingCore::setEditMode();
516 return self::changeParentOfBlock($lid, $block, $params);
517 }
518
526 public static function moveBlock($lid, $block, array $params = array())
527 {
528 if (!is_array($params))
529 {
530 $params = array();
531 }
532 $params['MOVE'] = true;
533 LandingCore::setEditMode();
534 return self::changeParentOfBlock($lid, $block, $params);
535 }
536
543 public static function removeEntities($lid, array $data)
544 {
545 $result = new PublicActionResult();
546
547 LandingCore::setEditMode();
548 $landing = LandingCore::createInstance($lid);
549
550 if ($landing->exist())
551 {
552 $blocks = $landing->getBlocks();
553 if (isset($data['blocks']) && is_array($data['blocks']))
554 {
555 foreach ($data['blocks'] as $block)
556 {
557 self::deleteBlock($lid, $block);
558 unset($blocks[$block]);
559 }
560 }
561 if (isset($data['images']) && is_array($data['images']))
562 {
563 foreach ($data['images'] as $item)
564 {
565 if (isset($blocks[$item['block']]))
566 {
567 File::deleteFromBlock($item['block'], $item['image']);
568 }
569 }
570 }
571 $result->setResult(true);
572 }
573
574 $result->setError($landing->getError());
575
576 return $result;
577 }
578
584 public static function getList(array $params = []): PublicActionResult
585 {
586 $result = new PublicActionResult();
587 $params = $result->sanitizeKeys($params);
588 $landingFake = LandingCore::createInstance(0);
589 $getPreview = false;
590 $getUrls = false;
591 $checkArea = false;
592
593 if ($params['filter']['SITE_ID'] ?? null)
594 {
595 $siteId = $params['filter']['SITE_ID'];
596 if (is_array($siteId))
597 {
598 $siteId = array_shift($siteId);
599 }
600 $params['filter'][] = [
601 'LOGIC' => 'OR',
602 ['FOLDER_ID' => null],
603 ['!FOLDER_ID' => Folder::getFolderIdsForSite($siteId, ['=DELETED' => 'Y']) ?: [-1]]
604 ];
605 }
606
607 if (isset($params['get_preview']))
608 {
609 $getPreview = !!$params['get_preview'];
610 unset($params['get_preview']);
611 }
612
613 if (isset($params['get_urls']))
614 {
615 $getUrls = !!$params['get_urls'];
616 unset($params['get_urls']);
617 }
618
619 if (isset($params['check_area']))
620 {
621 $checkArea = !!$params['check_area'];
622 unset($params['check_area']);
623 }
624
625 if (isset($params['filter']['CHECK_PERMISSIONS']))
626 {
627 unset($params['filter']['CHECK_PERMISSIONS']);
628 }
629
630 $data = [];
631 $rows = [];
632 $publicUrls = [];
633
634 $params['select'] = $params['select'] ?? ['*'];
635 $params['select']['DOMAIN_ID'] = 'SITE.DOMAIN_ID';
636 $res = LandingCore::getList($params);
637 while ($row = $res->fetch())
638 {
639 $rows[$row['ID']] = $row;
640 }
641
642 if ($getPreview || $getUrls)
643 {
644 $publicUrls = LandingCore::createInstance(0)->getPublicUrl(array_keys($rows));
645 }
646
647 foreach ($rows as $row)
648 {
649 if (isset($row['DATE_CREATE']))
650 {
651 $row['DATE_CREATE'] = (string) $row['DATE_CREATE'];
652 }
653 if (isset($row['DATE_MODIFY']))
654 {
655 $row['DATE_MODIFY'] = (string) $row['DATE_MODIFY'];
656 }
657 if ($getUrls && isset($row['ID']))
658 {
659 $row['PUBLIC_URL'] = $publicUrls[$row['ID']];
660 }
661 if ($getPreview && isset($row['ID']))
662 {
663 if ($row['DOMAIN_ID'] == 0)
664 {
665 \Bitrix\Landing\Hook::setEditMode(true);
666 }
667 $row['PREVIEW'] = $landingFake->getPreview(
668 $row['ID'],
669 $row['DOMAIN_ID'] == 0,
670 $publicUrls[$row['ID']]
671 );
672 }
673 if ($checkArea && isset($row['ID']))
674 {
675 $data[$row['ID']] = $row;
676 }
677 else
678 {
679 $checkArea = false;
680 $data[] = $row;
681 }
682 }
683
684 // landing is area?
685 if ($checkArea)
686 {
688 array_keys($data)
689 );
690 foreach ($areas as $lid => $isA)
691 {
692 $data[$lid]['IS_AREA'] = $isA;
693 }
694 }
695
696 $result->setResult(array_values($data));
697
698 return $result;
699 }
700
707 protected static function checkAddingInMenu(array $fields, ?bool &$willAdded = null): array
708 {
709 $blockId = null;
710 $menuCode = null;
711
712 if (isset($fields['BLOCK_ID']))
713 {
714 $blockId = (int)$fields['BLOCK_ID'];
715 unset($fields['BLOCK_ID']);
716 }
717 if (isset($fields['MENU_CODE']))
718 {
719 $menuCode = $fields['MENU_CODE'];
720 unset($fields['MENU_CODE']);
721 }
722
723 if (!$blockId || !$menuCode || !is_string($menuCode))
724 {
725 return $fields;
726 }
727
728 $willAdded = true;
729
730 LandingCore::callback('OnAfterAdd',
731 function(\Bitrix\Main\Event $event) use ($blockId, $menuCode)
732 {
733 $primary = $event->getParameter('primary');
734 $fields = $event->getParameter('fields');
735
736 if ($primary)
737 {
738 $landingId = BlockCore::getLandingIdByBlockId($blockId);
739 if ($landingId)
740 {
741 $updateData = [
742 $menuCode => [
743 [
744 'text' => $fields['TITLE'],
745 'href' => '#landing' . $primary['ID']
746 ]
747 ]
748 ];
749 Block::updateNodes(
750 $landingId,
751 $blockId,
752 $updateData,
753 ['appendMenu' => true]
754 );
755 }
756 }
757 }
758 );
759
760
761 return $fields;
762 }
763
769 public static function add(array $fields)
770 {
771 $result = new PublicActionResult();
772 $error = new \Bitrix\Landing\Error;
773
774 $fields = self::clearDisallowFields($fields);
775 $fields['ACTIVE'] = 'N';
776
777 $fields = self::checkAddingInMenu($fields);
778
779 $res = LandingCore::add($fields);
780
781 if ($res->isSuccess())
782 {
783 $result->setResult($res->getId());
784 }
785 else
786 {
787 $error->addFromResult($res);
788 $result->setError($error);
789 }
790
791 return $result;
792 }
793
801 public static function addByTemplate($siteId, $code, array $fields = [])
802 {
803 $result = new PublicActionResult();
804 $error = new \Bitrix\Landing\Error;
805
806 $willAdded = false;
807 $siteId = intval($siteId);
808 $fields = self::checkAddingInMenu($fields, $willAdded);
809
810 $res = LandingCore::addByTemplate($siteId, $code, $fields);
811
812 if ($res->isSuccess())
813 {
814 $result->setResult($res->getId());
815 if (
816 !$willAdded &&
817 isset($fields['ADD_IN_MENU']) &&
818 isset($fields['TITLE']) &&
819 $fields['ADD_IN_MENU'] == 'Y'
820 )
821 {
822 Site::addLandingToMenu($siteId, [
823 'ID' => $res->getId(),
824 'TITLE' => $fields['TITLE']
825 ]);
826 }
827 }
828 else
829 {
830 $error->addFromResult($res);
831 $result->setError($error);
832 }
833
834 return $result;
835 }
836
843 public static function update($lid, array $fields)
844 {
845 $result = new PublicActionResult();
846 $error = new \Bitrix\Landing\Error;
847
848 $fields = self::clearDisallowFields($fields);
849
850 $res = LandingCore::update($lid, $fields);
851
852 if ($res->isSuccess())
853 {
854 $result->setResult(true);
855 }
856 else
857 {
858 $error->addFromResult($res);
859 $result->setError($error);
860 }
861
862 return $result;
863 }
864
870 public static function delete($lid)
871 {
872 $result = new PublicActionResult();
873 $error = new \Bitrix\Landing\Error;
874
875 $res = LandingCore::delete($lid);
876
877 if ($res->isSuccess())
878 {
879 $result->setResult(true);
880 }
881 else
882 {
883 $error->addFromResult($res);
884 $result->setError($error);
885 }
886
887 return $result;
888 }
889
897 public static function move(int $lid, ?int $toSiteId = null, ?int $toFolderId = null): PublicActionResult
898 {
899 $result = new PublicActionResult();
900 $landing = LandingCore::createInstance($lid);
901 $result->setResult($landing->move($toSiteId ?: null, $toFolderId ?: null));
902 $result->setError($landing->getError());
903 return $result;
904 }
905
914 public static function copy(int $lid, ?int $toSiteId = null, ?int $toFolderId = null, bool $skipSystem = false): PublicActionResult
915 {
916 $result = new PublicActionResult();
917
918 LandingCore::disableCheckDeleted();
919 $landing = LandingCore::createInstance($lid);
920 $result->setResult($landing->copy($toSiteId ?: null, $toFolderId ?: null, false, Utils::isTrue($skipSystem)));
921 $result->setError($landing->getError());
922 LandingCore::enableCheckDeleted();
923
924 return $result;
925 }
926
933 public static function markDelete($lid, $mark = true)
934 {
935 $result = new PublicActionResult();
936 $error = new \Bitrix\Landing\Error;
937
938 if ($mark)
939 {
940 $res = LandingCore::markDelete($lid);
941 }
942 else
943 {
944 $res = LandingCore::markUnDelete($lid);
945 }
946 if ($res->isSuccess())
947 {
948 $result->setResult($res->getId());
949 }
950 else
951 {
952 $error->addFromResult($res);
953 $result->setError($error);
954 }
955
956 return $result;
957 }
958
964 public static function markUnDelete($lid)
965 {
966 return self::markDelete($lid, false);
967 }
968
977 public static function uploadFile($lid, $picture, $ext = false, array $params = array())
978 {
979 static $internal = true;
980 static $mixedParams = ['picture'];
981
982 $result = new PublicActionResult();
983 $error = new \Bitrix\Landing\Error;
984 $lid = intval($lid);
985
986 $landing = LandingCore::createInstance($lid, [
987 'skip_blocks' => true
988 ]);
989
990 if ($landing->exist())
991 {
992 $file = Manager::savePicture($picture, $ext, $params);
993 if ($file)
994 {
995 File::addToLanding($lid, $file['ID']);
996 $result->setResult(array(
997 'id' => $file['ID'],
998 'src' => $file['SRC']
999 ));
1000 }
1001 else
1002 {
1003 $error->addError(
1004 'FILE_ERROR',
1005 Loc::getMessage('LANDING_FILE_ERROR')
1006 );
1007 $result->setError($error);
1008 }
1009 }
1010
1011 $result->setError($landing->getError());
1012
1013 return $result;
1014 }
1015
1022 public static function updateHead($lid, $content)
1023 {
1024 static $internal = true;
1025
1026 $lid = intval($lid);
1027 $result = new PublicActionResult();
1028 $landing = LandingCore::createInstance($lid, [
1029 'skip_blocks' => true
1030 ]);
1031 $result->setResult(false);
1032
1033 if ($landing->exist())
1034 {
1035 // fix module security
1036 $content = str_replace('<st yle', '<style', $content);
1037 $content = str_replace('<li nk ', '<link ', $content);
1038
1039 $fields = array(
1040 'ENTITY_ID' => $lid,
1041 'ENTITY_TYPE' => \Bitrix\Landing\Hook::ENTITY_TYPE_LANDING,
1042 'HOOK' => 'FONTS',
1043 'CODE' => 'CODE',
1044 'PUBLIC' => 'N'
1045 );
1046 $res = HookDataTable::getList(array(
1047 'select' => array(
1048 'ID', 'VALUE'
1049 ),
1050 'filter' => $fields
1051 ));
1052 if ($row = $res->fetch())
1053 {
1054 $existsContent = $row['VALUE'];
1055
1056 // concat new fonts to the exists
1057 $found = preg_match_all(
1058 '#(<noscript>.*?<style.*?data-id="([^"]+)"[^>]*>[^<]+</style>)#is',
1059 $content,
1060 $newFonts
1061 );
1062 if ($found)
1063 {
1064 foreach ($newFonts[1] as $i => $newFont)
1065 {
1066 if (mb_strpos($existsContent, '"' . $newFonts[2][$i] . '"') === false)
1067 {
1068 $existsContent .= $newFont;
1069 }
1070 }
1071 }
1072
1073 if ($existsContent != $row['VALUE'])
1074 {
1075 HookDataTable::update(
1076 $row['ID'],
1077 ['VALUE' => $existsContent]
1078 );
1079 }
1080 }
1081 else
1082 {
1083 $fields['VALUE'] = $content;
1084 HookDataTable::add($fields);
1085 }
1086
1087 if (Manager::getOption('public_hook_on_save') === 'Y')
1088 {
1090 Hook::publicationLanding($landing->getId());
1091 }
1092
1093 $result->setResult(true);
1094 }
1095
1096 $result->setError($landing->getError());
1097
1098 return $result;
1099 }
1100}
static addToLanding($lid, $fileId)
Definition file.php:266
static deleteFromBlock($blockId, $fileId=array())
Definition file.php:363
static getFolderIdsForSite(int $siteId, array $additionalFilter=[])
Definition folder.php:109
static publicationLanding($lid)
Definition hook.php:453
static setEditMode(bool $mode=true)
Definition hook.php:232
const ENTITY_TYPE_LANDING
Definition hook.php:25
static callback($code, $callback)
Definition base.php:168
static getOption($code, $default=null)
Definition manager.php:160
static sanitize($value, &$bad=false, $splitter=' ')
Definition manager.php:1255
static savePicture($file, $ext=false, $params=array())
Definition manager.php:585
static removeEntities($lid, array $data)
Definition landing.php:543
static copy(int $lid, ?int $toSiteId=null, ?int $toFolderId=null, bool $skipSystem=false)
Definition landing.php:914
static showBlock($lid, $block)
Definition landing.php:441
static updateHead($lid, $content)
Definition landing.php:1022
static addByTemplate($siteId, $code, array $fields=[])
Definition landing.php:801
static copyBlock($lid, $block, array $params=array())
Definition landing.php:508
static update($lid, array $fields)
Definition landing.php:843
static markUnDeletedBlock(int $lid, int $block, bool $preventHistory=false)
Definition landing.php:301
static unFavoriteBlock(int $blockId)
Definition landing.php:392
static checkAddingInMenu(array $fields, ?bool &$willAdded=null)
Definition landing.php:707
static getList(array $params=[])
Definition landing.php:584
static hideBlock($lid, $block)
Definition landing.php:453
static clearDisallowFields(array $fields)
Definition landing.php:26
static markDelete($lid, $mark=true)
Definition landing.php:933
static downBlock(int $lid, int $block, bool $preventHistory=false)
Definition landing.php:359
static addBlock($lid, array $fields, bool $preventHistory=false)
Definition landing.php:189
static uploadFile($lid, $picture, $ext=false, array $params=array())
Definition landing.php:977
static resolveIdByPublicUrl(string $landingUrl, int $siteId)
Definition landing.php:94
static upBlock(int $lid, int $block, bool $preventHistory=false)
Definition landing.php:344
static favoriteBlock(int $lid, int $block, array $meta=[])
Definition landing.php:374
static move(int $lid, ?int $toSiteId=null, ?int $toFolderId=null)
Definition landing.php:897
static add(array $fields)
Definition landing.php:769
static moveBlock($lid, $block, array $params=array())
Definition landing.php:526
static deleteBlock($lid, $block)
Definition landing.php:253
static markDeletedBlock(int $lid, int $block, bool $mark=true, bool $preventHistory=false)
Definition landing.php:276
static addLandingToMenu(int $siteId, array $data)
Definition site.php:1547
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())