diff --git a/boot.php b/boot.php index 505d949..c0639c2 100644 --- a/boot.php +++ b/boot.php @@ -11,6 +11,7 @@ use rex_csrf_token; use rex_extension; use rex_extension_point; +use rex_package; use rex_plugin; use rex_url; use rex_yform_manager_dataset; @@ -107,3 +108,22 @@ static function ($a) { ); } }); + +if (rex::isBackend() && \rex_addon::get('neues') && \rex_addon::get('neues')->isAvailable() && !rex::isSafeMode()) { + $addon = rex_addon::get('neues'); + $pages = $addon->getProperty('pages'); + + $_csrf_key = rex_yform_manager_table::get('rex_neues_entry')->getCSRFKey(); + $token = rex_csrf_token::factory($_csrf_key)->getUrlParams(); + + $params = []; + $params['table_name'] = 'rex_neues_entry'; // Tabellenname anpassen + $params['rex_yform_manager_popup'] = '0'; + $params['_csrf_token'] = $token['_csrf_token']; + $params['func'] = 'add'; + + $href = rex_url::backendPage('neues/entry', $params); + + $pages['neues']['title'] .= ' +'; + $addon->setProperty('pages', $pages); +}