generated from alexplusde/blaupause
-
Notifications
You must be signed in to change notification settings - Fork 2
/
boot.php
77 lines (68 loc) · 2.22 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
namespace Alexplusde\Wsm;
use rex;
use rex_addon;
use rex_api_function;
use rex_be_controller;
use rex_extension;
use rex_yform_manager_dataset;
use function in_array;
use function is_array;
if (rex_addon::get('yform')->isAvailable() && !rex::isSafeMode()) {
rex_yform_manager_dataset::setModelClass(
'rex_wenns_sein_muss_service',
Service::class,
);
rex_yform_manager_dataset::setModelClass(
'rex_wenns_sein_muss_group',
Group::class,
);
rex_yform_manager_dataset::setModelClass(
'rex_wenns_sein_muss_entry',
Entry::class,
);
rex_yform_manager_dataset::setModelClass(
'rex_wenns_sein_muss_protocol',
Protocol::class,
);
rex_yform_manager_dataset::setModelClass(
'rex_wenns_sein_muss_iframe',
Iframe::class,
);
rex_yform_manager_dataset::setModelClass(
'rex_wenns_sein_muss_domain',
Domain::class,
);
}
if (!rex_addon::get('yrewrite')->isAvailable()) {
$addon = rex_addon::get('wenns_sein_muss');
$pages = $addon->getProperty('pages');
if (is_array($pages) && isset($pages['domain']['hidden'])) {
$pages['domain']['hidden'] = true;
}
$addon->setProperty('pages', $pages);
}
rex_extension::register('YFORM_DATA_ADDED', Wsm::yformDataChanged(...));
rex_extension::register('YFORM_DATA_UPDATED', Wsm::yformDataChanged(...));
rex_extension::register('YFORM_DATA_DELETED', Wsm::yformDataChanged(...));
/**
* nur im Frontend.
*/
if (rex::isFrontend()) {
rex_api_function::register('wsm', ApiWsm::class);
rex_api_function::register('wsm_im_thumbnail', ImThumbnail::class);
return;
}
/**
* nur im Backend.
*/
if (in_array(rex_be_controller::getCurrentPagePart(1), ['yform', 'wenns_sein_muss'], true)) {
rex_extension::register('YFORM_DATA_LIST', Service::epYformDataList(...));
rex_extension::register('YFORM_DATA_LIST', Group::epYformDataList(...));
rex_extension::register('YFORM_DATA_LIST', Protocol::epYformDataList(...));
rex_extension::register('YFORM_DATA_LIST', Iframe::epYformDataList(...));
rex_extension::register('YFORM_DATA_LIST', Domain::epYformDataList(...));
}
if (Wsm::getConfig('first_run', 'bool', true)) {
Wsm::InitOnFirstBoot();
}