-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
boot.php
26 lines (20 loc) · 844 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
<?php
use rexstan\RexStan;
$addon = rex_addon::get('rexstan');
if (rex::isBackend() && is_object(rex::getUser())) {
rex_extension::register('OUTPUT_FILTER', static function (rex_extension_point $ep) use ($addon) {
$svg = \rex_file::get($addon->getAssetsPath('rexstan-dino.min.svg'));
$ep->setSubject(str_replace(
'<i class="rexstan-navigation-icon"></i>',
'<i class="rexstan-navigation-icon">'.$svg.'</i>',
$ep->getSubject()
));
});
rex_view::addCssFile($addon->getAssetsUrl('rexstan.css'));
if (rex_be_controller::getCurrentPagePart(1) === 'rexstan') {
rex_view::addJsFile($addon->getAssetsUrl('confetti.min.js'));
}
}
rex_extension::register('PACKAGE_CACHE_DELETED', static function (rex_extension_point $ep) {
RexStan::clearResultCache();
});