Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
block.php
1<?php
3
5use \Bitrix\Landing\Manager;
6use \Bitrix\Landing\File;
7use \Bitrix\Landing\Landing;
8use \Bitrix\Landing\Hook;
9use \Bitrix\Landing\Assets;
10use \Bitrix\Landing\Restriction;
11use \Bitrix\Landing\Block as BlockCore;
12use \Bitrix\Main\Localization\Loc;
13use \Bitrix\Landing\PublicActionResult;
14
15Loc::loadMessages(__FILE__);
16
17class Block
18{
28 private static function cardAction($action, $lid, $block, $selector, array $params = array())
29 {
30 $error = new \Bitrix\Landing\Error;
31 $result = new PublicActionResult();
32 $landing = Landing::createInstance($lid, [
33 'blocks_id' => $block
34 ]);
35 // try find the block in landing instance
36 if ($landing->exist())
37 {
38 $block = intval($block);
39 $blocks = $landing->getBlocks();
40 if (isset($blocks[$block]))
41 {
42 // action with card of block
43 if (mb_strpos($selector, '@') !== false)
44 {
45 [$selector, $position] = explode('@', $selector);
46 }
47 else
48 {
49 $position = -1;
50 }
51 if (
52 mb_strtolower($action) == 'clonecard' &&
53 isset($params['content'])
54 )
55 {
56 $res = $blocks[$block]->$action(
57 $selector,
58 $position,
60 $params['content'], $bad
61 )
62 );
63 }
64 else
65 {
66 $res = $blocks[$block]->$action($selector, $position);
67 }
68 if ($res)
69 {
70 $result->setResult($blocks[$block]->save());
71 }
72 if ($blocks[$block]->getError()->isEmpty())
73 {
74 $landing->touch();
75 }
76 $result->setError($blocks[$block]->getError());
77 }
78 else
79 {
80 $error->addError(
81 'BLOCK_NOT_FOUND',
82 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
83 );
84 }
85 }
86 $result->setError($landing->getError());
87 $result->setError($error);
88 return $result;
89 }
90
99 public static function cloneCard($lid, $block, $selector, bool $preventHistory = false)
100 {
102 $preventHistory ? History::deactivate() : History::activate();
103
104 return self::cardAction('cloneCard', $lid, $block, $selector);
105 }
106
116 public static function addCard($lid, $block, $selector, $content, bool $preventHistory = false)
117 {
119 $preventHistory ? History::deactivate() : History::activate();
120
121 return self::cardAction(
122 'cloneCard',
123 $lid,
124 $block,
125 $selector,
126 array(
127 'content' => $content
128 )
129 );
130 }
131
140 public static function removeCard($lid, $block, $selector, bool $preventHistory = false)
141 {
143 $preventHistory ? History::deactivate() : History::activate();
144
145 return self::cardAction('removeCard', $lid, $block, $selector);
146 }
147
155 public static function updateCards($lid, $block, array $data)
156 {
157 $error = new \Bitrix\Landing\Error;
158 $result = new PublicActionResult();
159
161
162 $landing = Landing::createInstance($lid, [
163 'blocks_id' => $block
164 ]);
165 if ($landing->exist())
166 {
167 $block = intval($block);
168 $blocks = $landing->getBlocks();
169 if (isset($blocks[$block]))
170 {
171 $currBlock = $blocks[$block];
172 $currBlock->updateCards((array)$data);
173 $result->setResult($currBlock->save());
174 $result->setError($currBlock->getError());
175 if ($currBlock->getError()->isEmpty())
176 {
177 $landing->touch();
178 }
179 }
180 else
181 {
182 $error->addError(
183 'BLOCK_NOT_FOUND',
184 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
185 );
186 }
187 }
188 $result->setError($landing->getError());
189 $result->setError($error);
190
191 return $result;
192 }
193
202 public static function changeNodeName($lid, $block, array $data, bool $preventHistory = false)
203 {
204 $error = new \Bitrix\Landing\Error;
205 $result = new PublicActionResult();
206
207 $content = array();
209
210 $preventHistory ? History::deactivate() : History::activate();
211
212 // collect selectors in right array
213 foreach ($data as $selector => $value)
214 {
215 if (mb_strpos($selector, '@') !== false)
216 {
217 [$selector, $position] = explode('@', $selector);
218 }
219 else
220 {
221 $position = 0;
222 }
223 if (!isset($content[$selector]))
224 {
225 $content[$selector] = array();
226 }
227 $content[$selector][$position] = $value;
228 }
229
230 if (!empty($content))
231 {
232 $landing = Landing::createInstance($lid, [
233 'blocks_id' => $block
234 ]);
235 // try find the block in landing instance
236 if ($landing->exist())
237 {
238 $block = intval($block);
239 $blocks = $landing->getBlocks();
240 if (isset($blocks[$block]))
241 {
242 $blocks[$block]->changeNodeName($content);
243 $result->setResult($blocks[$block]->save());
244 $result->setError($blocks[$block]->getError());
245 if ($blocks[$block]->getError()->isEmpty())
246 {
247 $landing->touch();
248 }
249 }
250 else
251 {
252 $error->addError(
253 'BLOCK_NOT_FOUND',
254 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
255 );
256 }
257 }
258 $result->setError($landing->getError());
259 }
260 else
261 {
262 $error->addError(
263 'NODES_NOT_FOUND',
264 Loc::getMessage('LANDING_BLOCK_NODES_NOT_FOUND')
265 );
266 }
267
268 return $result;
269 }
270
279 public static function changeAnchor($lid, $block, $data, bool $preventHistory = false)
280 {
281 $error = new \Bitrix\Landing\Error;
282 $result = new PublicActionResult();
283
285
286 $preventHistory ? History::deactivate() : History::activate();
287
288 $landing = Landing::createInstance($lid, [
289 'blocks_id' => $block
290 ]);
291
292 if ($landing->exist())
293 {
294 $block = intval($block);
295 $blocks = $landing->getBlocks();
296 if (isset($blocks[$block]))
297 {
298 $blocks[$block]->setAnchor($data);
299 $result->setResult($blocks[$block]->save());
300 $result->setError($blocks[$block]->getError());
301 if ($blocks[$block]->getError()->isEmpty())
302 {
303 $landing->touch();
304 }
305 }
306 else
307 {
308 $error->addError(
309 'BLOCK_NOT_FOUND',
310 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
311 );
312 }
313 }
314 $result->setError($landing->getError());
315
316 return $result;
317 }
318
328 public static function updateNodes($lid, $block, array $data, array $additional = array(), bool $preventHistory = false)
329 {
330 $error = new \Bitrix\Landing\Error;
331 $result = new PublicActionResult();
332
333 $attributes = array();
334 $components = array();
335 $content = array();
336 $data = (array) $data;
337 $dynamicParamsExists = false;
338 $block = intval($block);
339
341 $preventHistory ? History::deactivate() : History::activate();
342
343 // save dynamic cards settings
344 if (isset($data['dynamicState']) || isset($data['dynamicBlock']))//@tmp refactor
345 {
346 $dynamicParamsExists = true;
347 $landing = Landing::createInstance($lid, [
348 'blocks_id' => $block
349 ]);
350 if ($landing->exist())
351 {
352 if ($blockCurrent = $landing->getBlockById($block))
353 {
354 $manifest = $blockCurrent->getManifest();
355 if (
356 !isset($manifest['block']['dynamic']) ||
357 $manifest['block']['dynamic'] !== false
358 )
359 {
360 // get dynamic data from request or from block
361 if (isset($data['dynamicParams']))
362 {
363 $dynamicParams = $data['dynamicParams'];
364 unset($data['dynamicParams']);
365 }
366 else
367 {
368 $dynamicParams = $blockCurrent->getDynamicParams();
369 }
370 // if some dynamic is off
371 if (isset($data['dynamicState']))
372 {
373 foreach ((array) $data['dynamicState'] as $selector => $flag)
374 {
375 if (!Utils::isTrue($flag) && isset($dynamicParams[$selector]))
376 {
377 unset($dynamicParams[$selector]);
378 }
379 }
380 }
381 $blockCurrent->saveDynamicParams(
382 $dynamicParams
383 );
384 }
385 $result->setResult(true);
386 }
387 else
388 {
389 $error->addError(
390 'BLOCK_NOT_FOUND',
391 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
392 );
393 $result->setError($error);
394 }
395 }
396 $result->setError($landing->getError());
397 }
398
399 // break on error
400 if (!$result->getError()->isEmpty())
401 {
402 return $result;
403 }
404
405 // collect selectors in right array
406 foreach ($data as $selector => $value)
407 {
408 if (mb_strpos($selector, '@') !== false)
409 {
410 [$selector, $position] = explode('@', $selector);
411 }
412 else
413 {
414 $position = -1;
415 }
416 if (!isset($data[$selector]))
417 {
418 $data[$selector] = array();
419 }
420 if (isset($value['attrs']) && count($value) == 1)
421 {
422 if (mb_strpos($selector, ':') !== false)
423 {
424 $components[$selector] = $value['attrs'];
425 }
426 else
427 {
428 $attributes[$selector][$position] = $value['attrs'];
429 }
430 }
431 else
432 {
433 if (!isset($content[$selector]))
434 {
435 $content[$selector] = array();
436 }
437 $content[$selector][max(0, $position)] = $value;
438 }
439 }
440
441 // data is not empty
442 if (!empty($content) || !empty($attributes) || !empty($components))
443 {
444 if (!isset($landing))
445 {
446 $landing = Landing::createInstance($lid, [
447 'blocks_id' => $block
448 ]);
449 }
450 // try find the block in landing instance
451 if ($landing->exist())
452 {
453 $blocks = $landing->getBlocks();
454 if (isset($blocks[$block]))
455 {
456 if (!empty($content))
457 {
458 $blocks[$block]->updateNodes($content, $additional);
459 }
460 if (!empty($attributes))
461 {
462 $blocks[$block]->setAttributes($attributes);
463 }
464 if (!empty($components))
465 {
466 // fix for security waf
467 if (!$blocks[$block]->getRepoId())
468 {
469 $manifest = $blocks[$block]->getManifest();
470 foreach ($components as $selector => &$attrs)
471 {
472 if (
473 isset($manifest['nodes'][$selector]['waf_ignore']) &&
474 $manifest['nodes'][$selector]['waf_ignore']
475 )
476 {
477 $rawData = \Bitrix\Landing\PublicAction::getRawData();
478 if (isset($rawData['data'][$selector]['attrs']))
479 {
480 $rawAttrs = $rawData['data'][$selector]['attrs'];
481 foreach ($attrs as $attCode => &$attValue)
482 {
483 $attValue = $rawAttrs[$attCode];
484 $attValue = \Bitrix\Main\Text\Encoding::convertEncoding(
485 $attValue,
486 'utf-8',
487 SITE_CHARSET
488 );
489 }
490 }
491 unset($attValue);
492 }
493 }
494 unset($attrs);
495 $blocks[$block]->updateNodes($components, $additional);
496 }
497 }
498 $blocks[$block]->saveContent(
499 str_replace(
500 'contenteditable="true"',
501 '',
502 $blocks[$block]->getContent()
503 )
504 );
505 $result->setResult($blocks[$block]->save());
506 $result->setError($blocks[$block]->getError());
507 if ($blocks[$block]->getError()->isEmpty())
508 {
509 $landing->touch();
510 }
511 }
512 else
513 {
514 $error->addError(
515 'BLOCK_NOT_FOUND',
516 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
517 );
518 }
519 }
520 $result->setError($landing->getError());
521 }
522 else if (!$dynamicParamsExists)
523 {
524 $error->addError(
525 'NODES_NOT_FOUND',
526 Loc::getMessage('LANDING_BLOCK_NODES_NOT_FOUND')
527 );
528 }
529
530 $result->setError($error);
531
532 return $result;
533 }
534
543 private static function updateAttributes($lid, $block, array $data, $method)
544 {
545 $error = new \Bitrix\Landing\Error;
546 $result = new PublicActionResult();
547
549
550 // try find the block in landing instance
551 $landing = Landing::createInstance($lid, [
552 'blocks_id' => $block
553 ]);
554 if ($landing->exist())
555 {
556 $block = intval($block);
557 $blocks = $landing->getBlocks();
558 if (isset($blocks[$block]))
559 {
560 if (is_callable(array($blocks[$block], $method)))
561 {
562 $blocks[$block]->$method($data);
563 }
564 $result->setResult($blocks[$block]->save());
565 $result->setError($blocks[$block]->getError());
566 if ($blocks[$block]->getError()->isEmpty())
567 {
568 $landing->touch();
569 }
570 }
571 else
572 {
573 $error->addError(
574 'BLOCK_NOT_FOUND',
575 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
576 );
577 }
578 }
579 $result->setError($landing->getError());
580 $result->setError($error);
581
582 return $result;
583 }
584
593 public static function updateStyles($lid, $block, array $data, bool $preventHistory = false)
594 {
595 $preventHistory ? History::deactivate() : History::activate();
596
597 $lastResult = null;
598 foreach ($data as $selector => $value)
599 {
600 $lastResult = self::updateAttributes($lid, $block, [$selector => $value], 'setClasses');
601 }
602 return $lastResult;
603 }
604
612 public static function updateAttrs($lid, $block, array $data)
613 {
614 foreach ($data as $selector => $value)
615 {
616 if (mb_strpos($selector, '@') !== false)
617 {
618 unset($data[$selector]);
619 [$selector, $pos] = explode('@', $selector);
620 if (
621 !isset($data[$selector]) ||
622 !is_array($data[$selector])
623 )
624 {
625 $data[$selector] = [];
626 }
627 $data[$selector][$pos] = $value;
628 }
629 }
630 return self::updateAttributes($lid, $block, $data, 'setAttributes');
631 }
632
641 public static function getContent($lid, $block, $editMode = false, array $params = array())
642 {
643 $result = new PublicActionResult();
644 $error = new \Bitrix\Landing\Error;
645
646 if ($editMode)
647 {
650 }
651
652 $landing = Landing::createInstance($lid, [
653 'blocks_id' => $block
654 ]);
655 // try find the block in landing instance
656 if ($landing->exist())
657 {
658 $block = intval($block);
659 $blocks = $landing->getBlocks();
660 if (isset($blocks[$block]))
661 {
662 if (!is_array($params))
663 {
664 $params = array();
665 }
666
667 $result->setResult(
668 BlockCore::getBlockContent(
669 $blocks[$block]->getId(),
670 $editMode,
671 $params
672 )
673 );
674 }
675 else
676 {
677 $error->addError(
678 'BLOCK_NOT_FOUND',
679 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
680 );
681 }
682 }
683 $result->setError($landing->getError());
684
685 return $result;
686 }
687
697 public static function updateContent($lid, $block, $content, $designed = false, bool $preventHistory = false)
698 {
699 $result = new PublicActionResult();
700 $error = new \Bitrix\Landing\Error;
701
703
704 if (Utils::isTrue($designed))
705 {
706 if (!Restriction\Manager::isAllowed('limit_crm_superblock'))
707 {
708 return $result;
709 }
710 }
711
712 if (strpos($content, 'block-wrapper'))
713 {
714 $content = preg_replace('/^<div.*?class="[^"]*block-wrapper[\s"][^>]+>(.*?)<\/div>$/is', '$1', $content);
715 }
716
717 $landing = Landing::createInstance($lid, [
718 'blocks_id' => $block
719 ]);
720 // try find the block in landing instance
721 if ($landing->exist())
722 {
723 $block = intval($block);
724 $blocks = $landing->getBlocks();
725 if (isset($blocks[$block]))
726 {
727 // remove extra files
728 $newContent = Manager::sanitize($content, $bad);
729 $filesBeforeSave = File::getFilesFromBlockContent(
730 $block,
731 $blocks[$block]->getContent()
732 );
733 $filesAfterSave = File::getFilesFromBlockContent(
734 $block,
735 $newContent
736 );
737 $filesRest = array_intersect($filesBeforeSave, $filesAfterSave);
738 $filesDelete = [];
739 foreach ($filesBeforeSave as $fileId)
740 {
741 if (!in_array($fileId, $filesRest))
742 {
743 $filesDelete[] = $fileId;
744 }
745 }
746 if ($filesDelete)
747 {
748 File::deleteFromBlock($block, $filesDelete);
749 }
750
751 if (!$preventHistory)
752 {
754 $history = new History($lid, History::ENTITY_TYPE_LANDING);
755 $history->push('UPDATE_CONTENT', [
756 'block' => $blocks[$block]->getId(),
757 'contentBefore' => $blocks[$block]->getContent(),
758 'contentAfter' => $newContent,
759 'designed' => $designed,
760 ]);
761 }
762 else
763 {
765 }
766
767 // update content
768 $blocks[$block]->saveContent(
769 $newContent,
770 Utils::isTrue($designed)
771 );
772 Assets\PreProcessing::blockUpdateNodeProcessing(
773 $blocks[$block]
774 );
775 $result->setResult(
776 $blocks[$block]->save()
777 );
778 $result->setError($blocks[$block]->getError());
779 }
780 else
781 {
782 $error->addError(
783 'BLOCK_NOT_FOUND',
784 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
785 );
786 }
787 }
788 $result->setError($landing->getError());
789
790 return $result;
791 }
792
798 public static function publication(int $block): PublicActionResult
799 {
800 $result = new PublicActionResult();
801
802 $lid = BlockCore::getLandingIdByBlockId($block);
803 if ($lid)
804 {
805 $landing = Landing::createInstance($lid);
806 if ($landing->exist())
807 {
808 $result->setResult($landing->publication($block));
809 }
810 $result->setError($landing->getError());
811 }
812
813 return $result;
814 }
815
822 public static function getList($lid, array $params = array())
823 {
824 static $mixedParams = ['lid'];
825
826 $result = new PublicActionResult();
827 $lids = is_array($lid) ? $lid : [$lid];
828
829 // some params
830 if (
831 isset($params['edit_mode']) &&
832 $params['edit_mode']
833 )
834 {
836 }
837
838 // get list
839 $data = array();
840 foreach ($lids as $lid)
841 {
842 $lid = intval($lid);
843 $landing = Landing::createInstance($lid, array(
844 'deleted' => isset($params['deleted']) && $params['deleted']
845 ));
846 if ($landing->exist())
847 {
848 foreach ($landing->getBlocks() as $i => $block)
849 {
850 if ($manifest = $block->getManifest())
851 {
852 $data[$i] = array(
853 'id' => $block->getId(),
854 'lid' => $lid,
855 'code' => $block->getCode(),
856 'name' => $manifest['block']['name'],
857 'active' => $block->isActive(),
858 'meta' => $block->getMeta()
859 );
860
861 // stringify meta
862 foreach ($data[$i]['meta'] as &$meta)
863 {
864 $meta = (string)$meta;
865 }
866 unset($meta);
867
868 // buffer content
869 if (
870 isset($params['get_content']) &&
871 $params['get_content']
872 )
873 {
874 ob_start();
875 $block->view(false, $landing);
876 $data[$i]['content'] = ob_get_contents();
877 $data[$i]['css'] = $block->getCSS();
878 $data[$i]['js'] = $block->getJS();
879 ob_end_clean();
880 }
881 }
882 }
883 }
884 $result->setError($landing->getError());
885 }
886
887 $result->setResult(array_values($data));
888
889 return $result;
890 }
891
898 public static function getById($block, array $params = array())
899 {
900 $error = new \Bitrix\Landing\Error;
901 $result = new PublicActionResult();
902 $block = (int)$block;
903
904 // recognize landing by block
905 $lid = BlockCore::getLandingIdByBlockId($block);
906 if ($lid)
907 {
908 // and find this block in landing blocks
909 $blocks = self::getList($lid, $params)->getResult();
910 foreach ($blocks as $item)
911 {
912 if ($item['id'] == $block)
913 {
914 $result->setResult($item);
915 return $result;
916 }
917 }
918 }
919
920 $error->addError(
921 'BLOCK_NOT_FOUND',
922 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
923 );
924 $result->setError($error);
925
926 return $result;
927 }
928
936 public static function getManifest($lid, $block, array $params = array())
937 {
938 $error = new \Bitrix\Landing\Error;
939 $result = new PublicActionResult();
940
941 if (
942 isset($params['edit_mode']) &&
943 $params['edit_mode']
944 )
945 {
947 }
948
949 $landing = Landing::createInstance($lid, [
950 'blocks_id' => $block
951 ]);
952
953 if ($landing->exist())
954 {
955 $block = intval($block);
956 $blocks = $landing->getBlocks();
957 if (isset($blocks[$block]))
958 {
959 $manifest = $blocks[$block]->getManifest();
960 $manifest['preview'] = $blocks[$block]->getPreview();
961 $manifest['assets'] = $blocks[$block]->getAsset();
962 $result->setResult($manifest);
963 }
964 else
965 {
966 $error->addError(
967 'BLOCK_NOT_FOUND',
968 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
969 );
970 }
971 }
972
973 $result->setError($landing->getError());
974 $result->setError($error);
975
976 return $result;
977 }
978
984 public static function getManifestFile($code)
985 {
986 $result = new PublicActionResult();
987
988 if (mb_strpos($code, ':') === false)
989 {
990 $code = 'bitrix:' . $code;
991 }
992
993 $manifest = BlockCore::getManifestFile($code);
994 $result->setResult($manifest);
995
996 return $result;
997 }
998
1004 public static function getContentFromRepository($code)
1005 {
1006 $result = new PublicActionResult();
1007
1008 $result->setResult(
1009 BlockCore::getContentFromRepository($code)
1010 );
1011
1012 return $result;
1013 }
1014
1021 public static function getRepository($section = null, $withManifest = false)
1022 {
1023 $result = new PublicActionResult();
1024 $repo = \Bitrix\Landing\Block::getRepository($withManifest);
1025
1026 if ($section === null)
1027 {
1028 $result->setResult($repo);
1029 }
1030 else
1031 {
1032 $result->setResult(
1033 (is_string($section) && isset($repo[$section])) ? $repo[$section] : false
1034 );
1035 }
1036
1037 return $result;
1038 }
1039
1049 public static function uploadFile($block, $picture, $ext = false, array $params = [], $temp = false): PublicActionResult
1050 {
1051 static $mixedParams = ['picture'];
1052
1053 $result = new PublicActionResult();
1054 $error = new \Bitrix\Landing\Error;
1055 $block = intval($block);
1056
1057 $landing = Landing::createInstance(
1058 BlockCore::getLandingIdByBlockId($block),
1059 ['skip_blocks' => true]
1060 );
1061
1062 if ($landing->exist())
1063 {
1064 $file = Manager::savePicture($picture, $ext, $params);
1065 if ($file)
1066 {
1067 File::addToBlock($block, $file['ID'], Utils::isTrue($temp));
1068 $result->setResult(array(
1069 'id' => $file['ID'],
1070 'src' => $file['SRC']
1071 ));
1072 }
1073 else
1074 {
1075 $error->addError(
1076 'FILE_ERROR',
1077 Loc::getMessage('LANDING_FILE_ERROR')
1078 );
1079 $result->setError($error);
1080 }
1081 }
1082 else
1083 {
1084 $error->addError(
1085 'BLOCK_NOT_FOUND',
1086 Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
1087 );
1088 $result->setError($error);
1089 }
1090
1091 return $result;
1092 }
1093
1099 public static function getFileDisk(int $fileId): PublicActionResult
1100 {
1101 static $internal = true;
1102
1103 $result = new PublicActionResult();
1104 $result->setResult(null);
1105
1106 if ($file = \Bitrix\Landing\Connector\Disk::getFileInfo($fileId, true, true))
1107 {
1108 $result->setResult([
1109 'ID' => $file['OBJECT_ID'],
1110 'NAME' => $file['NAME']
1111 ]);
1112 }
1113
1114 return $result;
1115 }
1116}
static getFileInfo(int $objectId, bool $checkRights=true, bool $copyInLocalStorage=false)
Definition disk.php:72
static addToBlock(int $blockId, $fileId, bool $temp=false)
Definition file.php:305
static deleteFromBlock($blockId, $fileId=array())
Definition file.php:363
static getFilesFromBlockContent($blockId, $content)
Definition file.php:374
static setEditMode(bool $mode=true)
Definition hook.php:232
static setEditMode($mode=true)
Definition landing.php:423
static createInstance($id, array $params=array())
Definition landing.php:534
static sanitize($value, &$bad=false, $splitter=' ')
Definition manager.php:1255
static savePicture($file, $ext=false, $params=array())
Definition manager.php:585
static getById($block, array $params=array())
Definition block.php:898
static cloneCard($lid, $block, $selector, bool $preventHistory=false)
Definition block.php:99
static publication(int $block)
Definition block.php:798
static addCard($lid, $block, $selector, $content, bool $preventHistory=false)
Definition block.php:116
static removeCard($lid, $block, $selector, bool $preventHistory=false)
Definition block.php:140
static getContentFromRepository($code)
Definition block.php:1004
static uploadFile($block, $picture, $ext=false, array $params=[], $temp=false)
Definition block.php:1049
static updateCards($lid, $block, array $data)
Definition block.php:155
static updateStyles($lid, $block, array $data, bool $preventHistory=false)
Definition block.php:593
static getFileDisk(int $fileId)
Definition block.php:1099
static getContent($lid, $block, $editMode=false, array $params=array())
Definition block.php:641
static getRepository($section=null, $withManifest=false)
Definition block.php:1021
static getManifest($lid, $block, array $params=array())
Definition block.php:936
static updateAttrs($lid, $block, array $data)
Definition block.php:612
static changeNodeName($lid, $block, array $data, bool $preventHistory=false)
Definition block.php:202
static updateContent($lid, $block, $content, $designed=false, bool $preventHistory=false)
Definition block.php:697
static getList($lid, array $params=array())
Definition block.php:822
static updateNodes($lid, $block, array $data, array $additional=array(), bool $preventHistory=false)
Definition block.php:328
static changeAnchor($lid, $block, $data, bool $preventHistory=false)
Definition block.php:279
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29