diff --git a/boot.php b/boot.php index 09d39fc..eec5079 100644 --- a/boot.php +++ b/boot.php @@ -49,19 +49,24 @@ static function ($a) { } }); -if (rex::isBackend()) { +if (rex::isBackend() && \rex_addon::get('qanda') && \rex_addon::get('qanda')->isAvailable() && !rex::isSafeMode()) { $addon = rex_addon::get('qanda'); $pages = $addon->getProperty('pages'); - $_csrf_key = rex_yform_manager_table::get('rex_qanda')->getCSRFKey(); - $token = rex_csrf_token::factory($_csrf_key)->getUrlParams(); + if($_REQUEST) { + $_csrf_key = rex_yform_manager_table::get('rex_qanda')->getCSRFKey(); + + $token = rex_csrf_token::factory($_csrf_key)->getUrlParams(); - $params = []; - $params['table_name'] = 'rex_qanda'; // Tabellenname anpassen - $params['rex_yform_manager_popup'] = '0'; - $params['_csrf_token'] = $token['_csrf_token']; - $params['func'] = 'add'; + $params = []; + $params['table_name'] = 'rex_qanda'; // Tabellenname anpassen + $params['rex_yform_manager_popup'] = '0'; + $params['_csrf_token'] = $token['_csrf_token']; + $params['func'] = 'add'; - $pages['qanda']['title'] .= ' +'; - $addon->setProperty('pages', $pages); + $href = rex_url::backendPage('qanda/entry', $params); + + $pages['qanda']['title'] .= ' +'; + $addon->setProperty('pages', $pages); + } }