1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
AddCardAction.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Landing\History\Action;
4
5
use Bitrix\Landing\Block;
6
use Bitrix\Main\Web\DOM;
7
8
class
AddCardAction
extends
BaseAction
9
{
10
protected
const
JS_COMMAND
=
'addCard'
;
11
12
public
function
execute
(
bool
$undo =
true
): bool
13
{
14
$block =
new
Block
((
int
)$this->params[
'block'
]);
15
$block->cloneCard($this->params[
'selector'
], $this->params[
'position'
] - 1, $this->params[
'content'
]);
16
17
return
$block->save();
18
}
19
20
public
static
function
enrichParams
(
array
$params
):
array
21
{
25
$block =
$params
[
'block'
];
26
$selector =
$params
[
'selector'
] ?:
''
;
27
$position = (int)
$params
[
'position'
] ?: 0;
28
$content
=
''
;
29
if
($selector)
30
{
31
$doc =
new
DOM\Document
();
32
$doc->loadHTML($block->getContent());
33
$resultList = $doc->querySelectorAll($selector);
34
if
(isset($resultList[$position]))
35
{
36
$content
= $resultList[$position]->getOuterHTML();
37
}
38
}
39
40
return
[
41
'block'
=> $block->getId(),
42
'selector'
=> $selector,
43
'lid'
=> $block->getLandingId(),
44
'position'
=> $position,
45
'content'
=>
$content
,
46
];
47
}
48
}
Bitrix\Landing\History\Action\AddCardAction
Определения
AddCardAction.php:9
Bitrix\Landing\History\Action\AddCardAction\execute
execute(bool $undo=true)
Определения
AddCardAction.php:12
Bitrix\Landing\History\Action\AddCardAction\JS_COMMAND
const JS_COMMAND
Определения
AddCardAction.php:10
Bitrix\Landing\History\Action\BaseAction
Определения
BaseAction.php:5
Bitrix\Landing\History\Action\BaseAction\enrichParams
static enrichParams(array $params)
Bitrix\Main\Web\DOM\Document
Определения
document.php:6
$content
$content
Определения
commerceml.php:144
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
AddCardAction.php
Создано системой
1.14.0