Skip to content

Commit

Permalink
ActionButton - Eigene URLs und Attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Jan 27, 2023
1 parent 72c9c24 commit ced8f14
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions plugins/manager/fragments/yform/manager/page/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,24 @@ static function ($params) {
$actionButtonsLoaded = $this->getVar('actionButtons') ?? [];

foreach ($actionButtonsLoaded as $actionButtonKey => $actionButton) {
$actionButtons[$actionButtonKey] = '<a href="'.$list->getUrl(
array_merge($actionButtonParams, ['data_id' => '___id___', 'func' => $actionButtonKey], $actionButton['params']),
false
).'">'.$actionButton['content'].'</a>';
$url = null;
if (isset($actionButton['url']) && is_string($actionButton['url'])) {
$url = $actionButton['url'];
}
if (!$url) {
$url = $list->getUrl(
array_merge($actionButtonParams, ['data_id' => '___id___', 'func' => $actionButtonKey], $actionButton['params']),
false
);
}

$attributes = [];
if (isset($actionButton['attributes'])) {
$attributes = $actionButton['attributes'];
}
$attributes['href'] = $url;

$actionButtons[$actionButtonKey] = '<a '.rex_string::buildAttributes($attributes).'>'.$actionButton['content'].'</a>';
}

$fragment = new rex_fragment();
Expand Down

0 comments on commit ced8f14

Please sign in to comment.