Skip to content

Commit

Permalink
Merge pull request #60 from alexplusde/main-menu-add
Browse files Browse the repository at this point in the history
Add `+` Button (REDAXO main menu)
  • Loading branch information
alxndr-w authored Jul 27, 2024
2 parents 1e93452 + e995881 commit 1a121c9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,25 @@ function ($a) {
);
}
});

if (rex::isBackend() && \rex_addon::get('events') && \rex_addon::get('events')->isAvailable() && !rex::isSafeMode()) {
$addon = rex_addon::get('events');
$pages = $addon->getProperty('pages');

if(!rex::getConsole()) {
$_csrf_key = rex_yform_manager_table::get('rex_event_date')->getCSRFKey();

$token = rex_csrf_token::factory($_csrf_key)->getUrlParams();

$params = [];
$params['table_name'] = 'rex_event_date'; // Tabellenname anpassen
$params['rex_yform_manager_popup'] = '0';
$params['_csrf_token'] = $token['_csrf_token'];
$params['func'] = 'add';

$href = rex_url::backendPage('events/date', $params);

$pages['events']['title'] .= ' <a class="label label-primary tex-primary" style="position: absolute; right: 18px; top: 10px; padding: 0.2em 0.6em 0.3em; border-radius: 3px; color: white; display: inline; width: auto;" href="' . $href . '">+</a>';
$addon->setProperty('pages', $pages);
}
}

0 comments on commit 1a121c9

Please sign in to comment.