@@ -15,29 +15,31 @@ class Plugin extends Base
15
15
public function initialize ()
16
16
{
17
17
global $ customizer ;
18
-
18
+
19
+ $ plugin_folder = basename (PLUGINS_DIR );
20
+
19
21
// Themes
20
22
$ customizer ['themes ' ] = array (
21
- 'Default ' => ' plugins /Customizer/Assets/css/theme.css '
23
+ 'Default ' => $ plugin_folder . ' /Customizer/Assets/css/theme.css '
22
24
);
23
25
24
- $ scanned_temp_themes = array_diff (scandir (' plugins /Customizer/Assets/css/userthemes ' ), array ('.. ' , '. ' ));
25
- $ scanned_preset_themes = array_diff (scandir (' plugins /Customizer/Assets/css/themes ' ), array ('.. ' , '. ' ));
26
+ $ scanned_temp_themes = array_diff (scandir ($ plugin_folder . ' /Customizer/Assets/css/userthemes ' ), array ('.. ' , '. ' ));
27
+ $ scanned_preset_themes = array_diff (scandir ($ plugin_folder . ' /Customizer/Assets/css/themes ' ), array ('.. ' , '. ' ));
26
28
27
29
foreach ($ scanned_temp_themes as $ theme ) {
28
- unlink (' plugins /Customizer/Assets/css/userthemes/ ' . $ theme );
30
+ unlink ($ plugin_folder . ' /Customizer/Assets/css/userthemes/ ' . $ theme );
29
31
}
30
32
31
33
if (file_exists (DATA_DIR . '/files/customizer/themes ' )) {
32
34
$ scanned_user_themes = array_diff (scandir (DATA_DIR . '/files/customizer/themes ' ), array ('.. ' , '. ' ));
33
35
foreach ($ scanned_user_themes as $ theme ) {
34
- copy (DATA_DIR . '/files/customizer/themes/ ' . $ theme , ' plugins /Customizer/Assets/css/userthemes/ ' . $ theme );
35
- $ customizer ['themes ' ][rtrim ($ theme , '.css ' )] = ' plugins /Customizer/Assets/css/userthemes/ ' . $ theme ;
36
+ copy (DATA_DIR . '/files/customizer/themes/ ' . $ theme , $ plugin_folder . ' /Customizer/Assets/css/userthemes/ ' . $ theme );
37
+ $ customizer ['themes ' ][rtrim ($ theme , '.css ' )] = $ plugin_folder . ' /Customizer/Assets/css/userthemes/ ' . $ theme ;
36
38
}
37
39
} else { mkdir (DATA_DIR . '/files/customizer/themes ' , 0755 , true ); }
38
40
39
41
foreach ($ scanned_preset_themes as $ theme ) {
40
- $ customizer ['themes ' ][rtrim ($ theme , '.css ' )] = ' plugins /Customizer/Assets/css/themes/ ' . $ theme ;
42
+ $ customizer ['themes ' ][rtrim ($ theme , '.css ' )] = $ plugin_folder . ' /Customizer/Assets/css/themes/ ' . $ theme ;
41
43
}
42
44
43
45
@@ -79,10 +81,10 @@ public function initialize()
79
81
$ this ->template ->setTemplateOverride ('board/task_avatar ' , 'customizer:board/task_avatar ' );
80
82
$ this ->template ->setTemplateOverride ('layout ' , 'customizer:layout/layout ' );
81
83
$ this ->template ->setTemplateOverride ('auth/index ' , 'customizer:layout/index ' );
82
- $ this ->hook ->on ('template:layout:css ' , array ('template ' => ' plugins /Customizer/Assets/rgbaColorPicker/rgbaColorPicker.css ' ));
83
- $ this ->hook ->on ('template:layout:js ' , array ('template ' => ' plugins /Customizer/Assets/rgbaColorPicker/rgbaColorPicker.js ' ));
84
- $ this ->hook ->on ('template:layout:css ' , array ('template ' => ' plugins /Customizer/Assets/css/customizer.css ' ));
85
- $ this ->hook ->on ('template:layout:js ' , array ('template ' => ' plugins /Customizer/Assets/js/customizer.js ' ));
84
+ $ this ->hook ->on ('template:layout:css ' , array ('template ' => $ plugin_folder . ' /Customizer/Assets/rgbaColorPicker/rgbaColorPicker.css ' ));
85
+ $ this ->hook ->on ('template:layout:js ' , array ('template ' => $ plugin_folder . ' /Customizer/Assets/rgbaColorPicker/rgbaColorPicker.js ' ));
86
+ $ this ->hook ->on ('template:layout:css ' , array ('template ' => $ plugin_folder . ' /Customizer/Assets/css/customizer.css ' ));
87
+ $ this ->hook ->on ('template:layout:js ' , array ('template ' => $ plugin_folder . ' /Customizer/Assets/js/customizer.js ' ));
86
88
$ this ->template ->hook ->attach ('customizer:config:themecreator ' , 'customizer:config/themecreator ' );
87
89
88
90
if ($ customizer ['login_note ' ] != '' ) {
@@ -123,8 +125,8 @@ public function onStartup()
123
125
{
124
126
Translator::load ($ this ->languageModel ->getCurrentLanguage (), __DIR__ .'/Locale ' );
125
127
$ user_id = $ this ->customizerFileModel ->getUserSessionId ();
126
- $ user_theme = $ this ->userMetadataModel ->get ($ user_id , 'themeSelection ' , $ this ->configModel ->get ('themeSelection ' , ' plugins /Customizer/Assets/css/theme.css ' ));
127
- $ default_theme = $ this ->configModel ->get ('themeSelection ' , ' plugins /Customizer/Assets/css/theme.css ' );
128
+ $ user_theme = $ this ->userMetadataModel ->get ($ user_id , 'themeSelection ' , $ this ->configModel ->get ('themeSelection ' , $ plugin_folder . ' /Customizer/Assets/css/theme.css ' ));
129
+ $ default_theme = $ this ->configModel ->get ('themeSelection ' , $ plugin_folder . ' /Customizer/Assets/css/theme.css ' );
128
130
if ($ this ->configModel ->get ('toggle_user_themes ' , 'disable ' ) == 'enable ' ) {
129
131
$ this ->hook ->on ('template:layout:css ' , array ('template ' => $ user_theme ));
130
132
} else {
0 commit comments