12 public function execute(
bool $undo =
true): bool
14 $block =
new Block((
int)$this->params[
'block']);
15 $block->cloneCard($this->params[
'selector'], $this->params[
'position'] - 1, $this->params[
'content']);
17 return $block->save();
26 $selector =
$params[
'selector'] ?:
'';
27 $position = (int)
$params[
'position'] ?: 0;
31 $doc =
new DOM\Document();
32 $doc->loadHTML($block->getContent());
33 $resultList = $doc->querySelectorAll($selector);
34 if (isset($resultList[$position]))
36 $content = $resultList[$position]->getOuterHTML();
41 'block' => $block->getId(),
42 'selector' => $selector,
43 'lid' => $block->getLandingId(),
44 'position' => $position,
45 'content' => $content,
static enrichParams(array $params)