forked from FriendsOfREDAXO/slice_columns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.php
41 lines (32 loc) · 1.66 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
<?php
rex_perm::register('slice_columns[edit]');
if (rex::isBackend() && rex::getUser()) {
$addon = rex_addon::get('slice_columns');
rex_view::setJsProperty('slicesteps', (int)$addon->getConfig('number_steps'));
rex_view::setJsProperty('min_width_column', (int)$addon->getConfig('min_width_column'));
rex_view::setJsProperty('number_columns', (int)$addon->getConfig('number_columns'));
// Load assets only on content pages
switch (\rex_be_controller::getCurrentPagePart(1)) {
case 'content':
rex_view::addCssFile($addon->getAssetsUrl('columns.css'));
rex_view::addJsFile($addon->getAssetsUrl('sortable.min.js'));
rex_view::addJsFile($addon->getAssetsUrl('columns_sortablejs.js'));
default:
break;
}
// templates ausschließen
$templates = [];
$templates = explode("|", $addon->getConfig('templates',''));
if (rex_article::getCurrent() && in_array(rex_article::getCurrent()->getTemplateId(), $templates)) {
} else {
// add buttons to slice menu
rex_extension::register('SLICE_MENU', ['columns', 'addButtons']);
}
rex_extension::register('SLICE_SHOW', array('columns', 'show'));
} else {
// rex_extension::register('ART_CONTENT', array('columns', 'frontend'));
// rex_extension::register('STRUCTURE_CONTENT_BEFORE_SLICES', array('columns', 'frontend'));
// rex_extension::register('STRUCTURE_CONTENT_AFTER_SLICES', array('columns', 'frontend'));
// rex_extension::register('SLICE_OUTPUT', array('columns', 'frontend'));
rex_extension::register('SLICE_SHOW', array('columns', 'frontend'), rex_extension::LATE);
}