1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
SortBlockAction.php
См. документацию.
1<?php
2
3namespace Bitrix\Landing\History\Action;
4
5use Bitrix\Landing\Landing;
6
8{
9 protected const JS_COMMAND = 'sortBlock';
10
11 public function execute(bool $undo = true): bool
12 {
13 $up = (bool)$this->params['up'];
14 $blockId = (int)$this->params['block'];
15 $landing = Landing::createInstance($this->params['lid']);
16 if ($landing->exist())
17 {
18 return ($up === $undo)
19 ? $landing->downBlock($blockId)
20 : $landing->upBlock($blockId)
21 ;
22 }
23
24 return false;
25 }
26
27 public static function enrichParams(array $params): array
28 {
29 return [
30 'block' => (int)$params['block'],
31 'lid' => (int)$params['lid'],
32 'up' => (bool)$params['up'],
33 ];
34 }
35
40 public function getJsCommand(bool $undo = true): array
41 {
42 $params = parent::getJsCommand($undo);
43 $params['params']['direction'] =
44 ($params['params']['up'] === $undo)
45 ? 'moveDown'
46 : 'moveUp'
47 ;
48 unset(
49 $params['params']['lid'],
50 $params['params']['up'],
51 );
52
53 return $params;
54 }
55}
static enrichParams(array $params)
Определения SortBlockAction.php:27
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804