1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
SortBlockAction.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Landing\History\Action;
4
5
use Bitrix\Landing\Landing;
6
7
class
SortBlockAction
extends
BaseAction
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
}
Bitrix\Landing\History\Action\BaseAction
Определения
BaseAction.php:5
Bitrix\Landing\History\Action\BaseAction\$params
array $params
Определения
BaseAction.php:7
Bitrix\Landing\History\Action\SortBlockAction
Определения
SortBlockAction.php:8
Bitrix\Landing\History\Action\SortBlockAction\getJsCommand
getJsCommand(bool $undo=true)
Определения
SortBlockAction.php:40
Bitrix\Landing\History\Action\SortBlockAction\enrichParams
static enrichParams(array $params)
Определения
SortBlockAction.php:27
Bitrix\Landing\History\Action\SortBlockAction\execute
execute(bool $undo=true)
Определения
SortBlockAction.php:11
Bitrix\Landing\History\Action\SortBlockAction\JS_COMMAND
const JS_COMMAND
Определения
SortBlockAction.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
bitrix
modules
landing
lib
History
Action
SortBlockAction.php
Создано системой
1.14.0