-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathboot.php
42 lines (34 loc) · 1.68 KB
/
boot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
if (rex_addon::get('yform')->isAvailable() && !rex::isSafeMode()) {
rex_yform_manager_dataset::setModelClass(
'rex_staff',
staff::class,
);
rex_yform_manager_dataset::setModelClass(
'rex_staff_category',
staff_category::class,
);
}
if (rex::isBackend() && 'staff/person' == rex_be_controller::getCurrentPage() || 'yform/manager/data_edit' == rex_be_controller::getCurrentPage()) {
rex_extension::register('OUTPUT_FILTER', static function (rex_extension_point $ep) {
$suchmuster = 'class="###staff-settings-editor###"';
$ersetzen = rex_config::get('staff', 'editor');
$ep->setSubject(str_replace($suchmuster, $ersetzen, $ep->getSubject()));
});
}
if (rex::isBackend() && rex_addon::get('staff') && rex_addon::get('staff')->isAvailable() && !rex::isSafeMode()) {
$addon = rex_addon::get('staff');
$page = $addon->getProperty('page');
if (rex::isBackend() && !empty($_REQUEST)) {
$_csrf_key = rex_yform_manager_table::get('rex_staff')->getCSRFKey();
$token = rex_csrf_token::factory($_csrf_key)->getUrlParams();
$params = [];
$params['table_name'] = 'rex_staff'; // Tabellenname anpassen
$params['rex_yform_manager_popup'] = '0';
$params['_csrf_token'] = $token['_csrf_token'];
$params['func'] = 'add';
$href = rex_url::backendPage('staff/person', $params);
$page['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('page', $page);
}
}