forked from yakamara/ycom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.php
27 lines (22 loc) · 904 Bytes
/
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
<?php
if (rex::isBackend()) {
rex_extension::register('PACKAGES_INCLUDED', function ($params) {
$plugin = rex_plugin::get('yform', 'manager');
if ($plugin) {
$pages = $plugin->getProperty('pages');
$ycom_tables = rex_ycom::getTables();
if (isset($pages) && is_array($pages)) {
foreach ($pages as $page) {
if (in_array($page->getKey(), $ycom_tables)) {
$page->setBlock('ycom');
}
}
}
}
});
}
rex_ycom::addTable('rex_ycom_user');
rex_yform_manager_dataset::setModelClass('rex_ycom_user', rex_ycom_user::class);
if(rex::isBackend() && (rex_url::currentBackendPage() == "index.php?page=content/edit" || rex_be_controller::getCurrentPagePart(1) == "mediapool")) {
rex_view::addJsFile($this->getAssetsUrl('ycom_backend.js'));
}