-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathboot.php
More file actions
78 lines (66 loc) · 3.23 KB
/
Copy pathboot.php
File metadata and controls
78 lines (66 loc) · 3.23 KB
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
78
<?php
/**
* This file is part of the yform/usability package.
*
* @author Friends Of REDAXO
* @author Kreatif GmbH
* @author a.platter@kreatif.it
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/** TODO: Umstellen auf den korrekten FOR-Namespace */
namespace yform\usability;
use rex;
use rex_addon;
use rex_be_controller;
use rex_csrf_token;
use rex_extension;
use rex_file;
use rex_scss_compiler;
use rex_url;
use rex_view;
use rex_yform;
$addon = rex_addon::get('yform_usability');
// init all extension points
Extensions::init();
if (rex::isBackend() && rex::getUser()) {
if ($addon->getProperty('compile')) {
$compiler = new rex_scss_compiler();
$scss_files = [$addon->getPath('assets/scss/styles.scss')];
$compiler->setRootDir($addon->getPath('assets/'));
$compiler->setScssFile($scss_files);
$compiler->setCssFile($addon->getPath('assets/styles.css'));
$compiler->compile();
rex_file::copy($addon->getPath('assets/styles.css'), $addon->getAssetsPath('styles.css'));
//\rex_file::delete($addon->getPath('assets/styles.css'));
rex_file::copy($addon->getPath('assets/vendor/Sortable.min.js'), $addon->getAssetsPath('vendor/Sortable.min.js'));
rex_file::copy($addon->getPath('assets/script.js'), $addon->getAssetsPath('script.js'));
rex_file::copy($addon->getPath('assets/yform-usability.css'), $addon->getAssetsPath('yform-usability.css'));
}
rex_view::setJsProperty('ajax_url', rex_url::frontendController(
rex_csrf_token::factory('rex_api_yform_usability_api')->getUrlParams()));
rex_view::addCssFile($addon->getAssetsUrl('styles.css?mtime=' . filemtime($addon->getAssetsPath('styles.css'))));
rex_view::addCssFile($addon->getAssetsUrl('yform-usability.css?mtime=' . filemtime($addon->getAssetsPath('yform-usability.css'))));
switch (rex_be_controller::getCurrentPagePart(1)) {
case 'content':
break;
default:
rex_view::addJsFile($addon->getAssetsUrl('vendor/Sortable.min.js?mtime=' . filemtime($addon->getAssetsPath('script.js'))));
rex_view::addJsFile($addon->getAssetsUrl('script.js?mtime=' . filemtime($addon->getAssetsPath('script.js'))));
break;
}
rex_yform::addTemplatePath($addon->getPath('ytemplates'));
rex_extension::register('PACKAGES_INCLUDED', Usability::init(...));
rex_extension::register('YFORM_MANAGER_DATA_PAGE', Extensions::ext_yformManagerDataPage(...));
rex_extension::register('YFORM_DATA_LIST', Extensions::ext_yformDataList(...));
rex_extension::register('YFORM_MANAGER_REX_INFO', Extensions::ext_yformManagerRexInfo(...));
rex_extension::register('YFORM_DATA_LIST_QUERY', Extensions::ext_yformDataListSql(...));
rex_extension::register('REX_LIST_GET', Extensions::ext_rexListGet(...));
rex_extension::register('PAGE_CHECKED', Extensions::ext_tableFieldFunc(...));
rex_extension::register('YFORM_DATA_LIST_ACTION_BUTTONS', Extensions::yform_data_list_action_buttons(...));
}
// includes ytemplates in cli environment(for cronjob tasks)
if ('cli' === PHP_SAPI && !rex::isSetup()) {
rex_yform::addTemplatePath($addon->getPath('ytemplates'));
}