1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
ChangeNodeNameAction.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Landing\History\Action;
4
5
use Bitrix\Landing\Block;
6
use Bitrix\Landing\Landing;
7
use Bitrix\Main\Web\Json;
8
9
class
ChangeNodeNameAction
extends
BaseAction
10
{
11
protected
const
JS_COMMAND
=
'cnangeNodeName'
;
12
13
public
function
execute
(
bool
$undo =
true
): bool
14
{
15
$block =
new
Block
((
int
)$this->params[
'block'
]);
16
$value = $undo ? $this->params[
'valueBefore'
] : $this->params[
'valueAfter'
];
17
if
($value)
18
{
19
if
($block->changeNodeName($value))
20
{
21
return
$block->save();
22
}
23
}
24
25
return
false
;
26
}
27
28
public
static
function
enrichParams
(
array
$params
):
array
29
{
33
$block =
$params
[
'block'
];
34
35
return
[
36
'block'
=> $block->getId(),
37
'lid'
=> $block->getLandingId(),
38
'valueBefore'
=>
$params
[
'valueBefore'
] ?? [],
39
'valueAfter'
=>
$params
[
'valueAfter'
] ?? [],
40
];
41
}
42
47
public
function
getJsCommand
(
bool
$undo =
true
):
array
48
{
49
$params
= parent::getJsCommand($undo);
50
$value = $undo ?
$params
[
'params'
][
'valueBefore'
] :
$params
[
'params'
][
'valueAfter'
];
51
52
foreach
($value as $sel => $valueItem)
53
{
54
foreach
($valueItem as $pos => $tag)
55
{
56
$selector = $sel .
'@'
. $pos;
57
$params
[
'params'
][
'selector'
] = $selector;
58
$params
[
'params'
][
'value'
] = $tag;
59
break
;
60
}
61
break
;
62
}
63
64
unset(
65
$params
[
'params'
][
'valueAfter'
],
66
$params
[
'params'
][
'valueBefore'
],
67
);
68
69
return
$params
;
70
}
71
}
Bitrix\Landing\History\Action\BaseAction
Определения
BaseAction.php:5
Bitrix\Landing\History\Action\BaseAction\$params
array $params
Определения
BaseAction.php:7
Bitrix\Landing\History\Action\BaseAction\enrichParams
static enrichParams(array $params)
Bitrix\Landing\History\Action\ChangeNodeNameAction
Определения
ChangeNodeNameAction.php:10
Bitrix\Landing\History\Action\ChangeNodeNameAction\getJsCommand
getJsCommand(bool $undo=true)
Определения
ChangeNodeNameAction.php:47
Bitrix\Landing\History\Action\ChangeNodeNameAction\execute
execute(bool $undo=true)
Определения
ChangeNodeNameAction.php:13
Bitrix\Landing\History\Action\ChangeNodeNameAction\JS_COMMAND
const JS_COMMAND
Определения
ChangeNodeNameAction.php:11
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\Landing\Block
Определения
blockrepo.php:3
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
landing
lib
History
Action
ChangeNodeNameAction.php
Создано системой
1.14.0