@@ -10,60 +10,60 @@ discard block |
||
10 | 10 | $xoops_url = parse_url(XOOPS_URL); |
11 | 11 | |
12 | 12 | $modversion = [ |
13 | - 'version' => 1.07, |
|
14 | - 'module_status' => 'RC1', |
|
15 | - 'release_date' => '2017/10/04', |
|
16 | - 'name' => _MI_INSTRUCTION_NAME, |
|
17 | - 'description' => _MI_INSTRUCTION_DESC, |
|
18 | - 'credits' => 'radio-hobby.org, www.shmel.org', |
|
19 | - 'author' => 'andrey3761, Mamba, Aerograf', |
|
20 | - 'nickname' => '', |
|
21 | - 'help' => 'page=help', |
|
22 | - 'license' => 'GNU GPL 2.0', |
|
23 | - 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
|
24 | - 'official' => 0, |
|
25 | - 'image' => 'assets/images/logoModule.png', |
|
26 | - 'dirname' => $moduleDirName, |
|
27 | - 'modicons16' => 'assets/images/icons/16', |
|
28 | - 'modicons32' => 'assets/images/icons/32', |
|
29 | - // О модуле |
|
30 | - 'module_website_url' => 'radio-hobby.org', |
|
31 | - 'module_website_name' => 'radio-hobby.org', |
|
13 | + 'version' => 1.07, |
|
14 | + 'module_status' => 'RC1', |
|
15 | + 'release_date' => '2017/10/04', |
|
16 | + 'name' => _MI_INSTRUCTION_NAME, |
|
17 | + 'description' => _MI_INSTRUCTION_DESC, |
|
18 | + 'credits' => 'radio-hobby.org, www.shmel.org', |
|
19 | + 'author' => 'andrey3761, Mamba, Aerograf', |
|
20 | + 'nickname' => '', |
|
21 | + 'help' => 'page=help', |
|
22 | + 'license' => 'GNU GPL 2.0', |
|
23 | + 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
|
24 | + 'official' => 0, |
|
25 | + 'image' => 'assets/images/logoModule.png', |
|
26 | + 'dirname' => $moduleDirName, |
|
27 | + 'modicons16' => 'assets/images/icons/16', |
|
28 | + 'modicons32' => 'assets/images/icons/32', |
|
29 | + // О модуле |
|
30 | + 'module_website_url' => 'radio-hobby.org', |
|
31 | + 'module_website_name' => 'radio-hobby.org', |
|
32 | 32 | |
33 | - 'author_website_url' => 'radio-hobby.org', |
|
34 | - 'author_website_name' => 'andrey3761', |
|
35 | - 'min_php' => '5.5', |
|
36 | - 'min_xoops' => '2.5.8', |
|
37 | - 'min_admin' => '1.1', |
|
38 | - 'min_db' => ['mysql' => '5.5'], |
|
39 | - // Файл базы данных |
|
40 | - 'sqlfile' => ['mysql' => 'sql/mysql.sql'], |
|
41 | - // Таблицы |
|
42 | - 'tables' => [ |
|
43 | - $moduleDirName . '_cat', |
|
44 | - $moduleDirName . '_instr', |
|
45 | - $moduleDirName . '_page' |
|
46 | - ], |
|
47 | - // Имеет админку |
|
48 | - 'hasAdmin' => 1, |
|
49 | - 'adminindex' => 'admin/index.php', |
|
50 | - 'adminmenu' => 'admin/menu.php', |
|
51 | - 'system_menu' => 1, |
|
52 | - // Меню |
|
53 | - 'hasMain' => 1, |
|
54 | - // Search |
|
55 | - 'hasSearch' => 1, |
|
56 | - 'search' => [ |
|
57 | - 'file' => 'include/search.inc.php', |
|
58 | - 'func' => $moduleDirName . '_search', |
|
59 | - ], |
|
33 | + 'author_website_url' => 'radio-hobby.org', |
|
34 | + 'author_website_name' => 'andrey3761', |
|
35 | + 'min_php' => '5.5', |
|
36 | + 'min_xoops' => '2.5.8', |
|
37 | + 'min_admin' => '1.1', |
|
38 | + 'min_db' => ['mysql' => '5.5'], |
|
39 | + // Файл базы данных |
|
40 | + 'sqlfile' => ['mysql' => 'sql/mysql.sql'], |
|
41 | + // Таблицы |
|
42 | + 'tables' => [ |
|
43 | + $moduleDirName . '_cat', |
|
44 | + $moduleDirName . '_instr', |
|
45 | + $moduleDirName . '_page' |
|
46 | + ], |
|
47 | + // Имеет админку |
|
48 | + 'hasAdmin' => 1, |
|
49 | + 'adminindex' => 'admin/index.php', |
|
50 | + 'adminmenu' => 'admin/menu.php', |
|
51 | + 'system_menu' => 1, |
|
52 | + // Меню |
|
53 | + 'hasMain' => 1, |
|
54 | + // Search |
|
55 | + 'hasSearch' => 1, |
|
56 | + 'search' => [ |
|
57 | + 'file' => 'include/search.inc.php', |
|
58 | + 'func' => $moduleDirName . '_search', |
|
59 | + ], |
|
60 | 60 | ]; |
61 | 61 | // Help files |
62 | 62 | $modversion['helpsection'] = [ |
63 | - ['name' => _MI_INSTRUCTION_HELP_OVERVIEW, 'link' => 'page=help'], |
|
64 | - ['name' => _MI_INSTRUCTION_DISCLAIMER, 'link' => 'page=disclaimer'], |
|
65 | - ['name' => _MI_INSTRUCTION_LICENSE, 'link' => 'page=license'], |
|
66 | - ['name' => _MI_INSTRUCTION_SUPPORT, 'link' => 'page=support'], |
|
63 | + ['name' => _MI_INSTRUCTION_HELP_OVERVIEW, 'link' => 'page=help'], |
|
64 | + ['name' => _MI_INSTRUCTION_DISCLAIMER, 'link' => 'page=disclaimer'], |
|
65 | + ['name' => _MI_INSTRUCTION_LICENSE, 'link' => 'page=license'], |
|
66 | + ['name' => _MI_INSTRUCTION_SUPPORT, 'link' => 'page=support'], |
|
67 | 67 | ]; |
68 | 68 | |
69 | 69 | // Comments |
@@ -76,144 +76,144 @@ discard block |
||
76 | 76 | |
77 | 77 | // Templates |
78 | 78 | $modversion['templates'] = [ |
79 | - [ |
|
80 | - 'file' => 'admin/' . $moduleDirName . '_admin_index.tpl', |
|
81 | - 'description' => '' |
|
82 | - ], |
|
83 | - [ |
|
84 | - 'file' => 'admin/' . $moduleDirName . '_admin_cat.tpl', |
|
85 | - 'description' => '' |
|
86 | - ], |
|
87 | - [ |
|
88 | - 'file' => 'admin/' . $moduleDirName . '_admin_editcat.tpl', |
|
89 | - 'description' => '' |
|
90 | - ], |
|
91 | - [ |
|
92 | - 'file' => 'admin/' . $moduleDirName . '_admin_savecat.tpl', |
|
93 | - 'description' => '' |
|
94 | - ], |
|
95 | - [ |
|
96 | - 'file' => 'admin/' . $moduleDirName . '_admin_viewcat.tpl', |
|
97 | - 'description' => '' |
|
98 | - ], |
|
99 | - [ |
|
100 | - 'file' => 'admin/' . $moduleDirName . '_admin_instr.tpl', |
|
101 | - 'description' => '' |
|
102 | - ], |
|
103 | - [ |
|
104 | - 'file' => 'admin/' . $moduleDirName . '_admin_editinstr.tpl', |
|
105 | - 'description' => '' |
|
106 | - ], |
|
107 | - [ |
|
108 | - 'file' => 'admin/' . $moduleDirName . '_admin_saveinstr.tpl', |
|
109 | - 'description' => '' |
|
110 | - ], |
|
111 | - [ |
|
112 | - 'file' => 'admin/' . $moduleDirName . '_admin_viewinstr.tpl', |
|
113 | - 'description' => '' |
|
114 | - ], |
|
115 | - [ |
|
116 | - 'file' => 'admin/' . $moduleDirName . '_admin_editpage.tpl', |
|
117 | - 'description' => '' |
|
118 | - ], |
|
119 | - [ |
|
120 | - 'file' => 'admin/' . $moduleDirName . '_admin_savepage.tpl', |
|
121 | - 'description' => '' |
|
122 | - ], |
|
123 | - [ |
|
124 | - 'file' => 'admin/' . $moduleDirName . '_admin_perm.tpl', |
|
125 | - 'description' => '' |
|
126 | - ], |
|
127 | - [ |
|
128 | - 'file' => 'admin/' . $moduleDirName . '_admin_about.tpl', |
|
129 | - 'description' => '' |
|
130 | - ], |
|
131 | - [ |
|
132 | - 'file' => $moduleDirName . '_page.tpl', |
|
133 | - 'description' => '' |
|
134 | - ], |
|
135 | - [ |
|
136 | - 'file' => $moduleDirName . '_instr.tpl', |
|
137 | - 'description' => '' |
|
138 | - ], |
|
139 | - [ |
|
140 | - 'file' => $moduleDirName . '_index.tpl', |
|
141 | - 'description' => '' |
|
142 | - ], |
|
143 | - [ |
|
144 | - 'file' => $moduleDirName . '_editpage.tpl', |
|
145 | - 'description' => '' |
|
146 | - ], |
|
147 | - [ |
|
148 | - 'file' => $moduleDirName . '_savepage.tpl', |
|
149 | - 'description' => '' |
|
150 | - ], |
|
79 | + [ |
|
80 | + 'file' => 'admin/' . $moduleDirName . '_admin_index.tpl', |
|
81 | + 'description' => '' |
|
82 | + ], |
|
83 | + [ |
|
84 | + 'file' => 'admin/' . $moduleDirName . '_admin_cat.tpl', |
|
85 | + 'description' => '' |
|
86 | + ], |
|
87 | + [ |
|
88 | + 'file' => 'admin/' . $moduleDirName . '_admin_editcat.tpl', |
|
89 | + 'description' => '' |
|
90 | + ], |
|
91 | + [ |
|
92 | + 'file' => 'admin/' . $moduleDirName . '_admin_savecat.tpl', |
|
93 | + 'description' => '' |
|
94 | + ], |
|
95 | + [ |
|
96 | + 'file' => 'admin/' . $moduleDirName . '_admin_viewcat.tpl', |
|
97 | + 'description' => '' |
|
98 | + ], |
|
99 | + [ |
|
100 | + 'file' => 'admin/' . $moduleDirName . '_admin_instr.tpl', |
|
101 | + 'description' => '' |
|
102 | + ], |
|
103 | + [ |
|
104 | + 'file' => 'admin/' . $moduleDirName . '_admin_editinstr.tpl', |
|
105 | + 'description' => '' |
|
106 | + ], |
|
107 | + [ |
|
108 | + 'file' => 'admin/' . $moduleDirName . '_admin_saveinstr.tpl', |
|
109 | + 'description' => '' |
|
110 | + ], |
|
111 | + [ |
|
112 | + 'file' => 'admin/' . $moduleDirName . '_admin_viewinstr.tpl', |
|
113 | + 'description' => '' |
|
114 | + ], |
|
115 | + [ |
|
116 | + 'file' => 'admin/' . $moduleDirName . '_admin_editpage.tpl', |
|
117 | + 'description' => '' |
|
118 | + ], |
|
119 | + [ |
|
120 | + 'file' => 'admin/' . $moduleDirName . '_admin_savepage.tpl', |
|
121 | + 'description' => '' |
|
122 | + ], |
|
123 | + [ |
|
124 | + 'file' => 'admin/' . $moduleDirName . '_admin_perm.tpl', |
|
125 | + 'description' => '' |
|
126 | + ], |
|
127 | + [ |
|
128 | + 'file' => 'admin/' . $moduleDirName . '_admin_about.tpl', |
|
129 | + 'description' => '' |
|
130 | + ], |
|
131 | + [ |
|
132 | + 'file' => $moduleDirName . '_page.tpl', |
|
133 | + 'description' => '' |
|
134 | + ], |
|
135 | + [ |
|
136 | + 'file' => $moduleDirName . '_instr.tpl', |
|
137 | + 'description' => '' |
|
138 | + ], |
|
139 | + [ |
|
140 | + 'file' => $moduleDirName . '_index.tpl', |
|
141 | + 'description' => '' |
|
142 | + ], |
|
143 | + [ |
|
144 | + 'file' => $moduleDirName . '_editpage.tpl', |
|
145 | + 'description' => '' |
|
146 | + ], |
|
147 | + [ |
|
148 | + 'file' => $moduleDirName . '_savepage.tpl', |
|
149 | + 'description' => '' |
|
150 | + ], |
|
151 | 151 | ]; |
152 | 152 | // Конфигурация |
153 | 153 | $modversion['config'][] = [ |
154 | - 'name' => 'form_options', |
|
155 | - 'title' => '_MI_INSTRUCTION_FORM_OPTIONS', |
|
156 | - 'description' => '_MI_INSTRUCTION_FORM_OPTIONS_DESC', |
|
157 | - 'formtype' => 'select', |
|
158 | - 'valuetype' => 'text', |
|
159 | - 'default' => 'dhtml', |
|
160 | - 'options' => array_flip($editorHandler->getList()) |
|
154 | + 'name' => 'form_options', |
|
155 | + 'title' => '_MI_INSTRUCTION_FORM_OPTIONS', |
|
156 | + 'description' => '_MI_INSTRUCTION_FORM_OPTIONS_DESC', |
|
157 | + 'formtype' => 'select', |
|
158 | + 'valuetype' => 'text', |
|
159 | + 'default' => 'dhtml', |
|
160 | + 'options' => array_flip($editorHandler->getList()) |
|
161 | 161 | ]; |
162 | 162 | $modversion['config'][] = [ |
163 | - 'name' => 'perpageadmin', |
|
164 | - 'title' => '_MI_INSTRUCTION_PERPAGEADMIN', |
|
165 | - 'description' => '_MI_INSTRUCTION_PERPAGEADMINDSC', |
|
166 | - 'formtype' => 'textbox', |
|
167 | - 'valuetype' => 'int', |
|
168 | - 'default' => 20 |
|
163 | + 'name' => 'perpageadmin', |
|
164 | + 'title' => '_MI_INSTRUCTION_PERPAGEADMIN', |
|
165 | + 'description' => '_MI_INSTRUCTION_PERPAGEADMINDSC', |
|
166 | + 'formtype' => 'textbox', |
|
167 | + 'valuetype' => 'int', |
|
168 | + 'default' => 20 |
|
169 | 169 | ]; |
170 | 170 | $modversion['config'][] = [ |
171 | - 'name' => 'perpagemain', |
|
172 | - 'title' => '_MI_INSTRUCTION_PERPAGEMAIN', |
|
173 | - 'description' => '_MI_INSTRUCTION_PERPAGEMAINDSC', |
|
174 | - 'formtype' => 'textbox', |
|
175 | - 'valuetype' => 'int', |
|
176 | - 'default' => 20 |
|
171 | + 'name' => 'perpagemain', |
|
172 | + 'title' => '_MI_INSTRUCTION_PERPAGEMAIN', |
|
173 | + 'description' => '_MI_INSTRUCTION_PERPAGEMAINDSC', |
|
174 | + 'formtype' => 'textbox', |
|
175 | + 'valuetype' => 'int', |
|
176 | + 'default' => 20 |
|
177 | 177 | ]; |
178 | 178 | // Теги |
179 | 179 | $modversion['config'][] = [ |
180 | - 'name' => 'usetag', |
|
181 | - 'title' => '_MI_INSTRUCTION_USETAG', |
|
182 | - 'description' => '_MI_INSTRUCTION_USETAGDSC', |
|
183 | - 'formtype' => 'yesno', |
|
184 | - 'valuetype' => 'int', |
|
185 | - 'default' => 0 |
|
180 | + 'name' => 'usetag', |
|
181 | + 'title' => '_MI_INSTRUCTION_USETAG', |
|
182 | + 'description' => '_MI_INSTRUCTION_USETAGDSC', |
|
183 | + 'formtype' => 'yesno', |
|
184 | + 'valuetype' => 'int', |
|
185 | + 'default' => 0 |
|
186 | 186 | ]; |
187 | 187 | // Оценки |
188 | 188 | $modversion['config'][] = [ |
189 | - 'name' => 'userat', |
|
190 | - 'title' => '_MI_INSTRUCTION_USERAT', |
|
191 | - 'description' => '_MI_INSTRUCTION_USERATDSC', |
|
192 | - 'formtype' => 'yesno', |
|
193 | - 'valuetype' => 'int', |
|
194 | - 'default' => 0 |
|
189 | + 'name' => 'userat', |
|
190 | + 'title' => '_MI_INSTRUCTION_USERAT', |
|
191 | + 'description' => '_MI_INSTRUCTION_USERATDSC', |
|
192 | + 'formtype' => 'yesno', |
|
193 | + 'valuetype' => 'int', |
|
194 | + 'default' => 0 |
|
195 | 195 | ]; |
196 | 196 | |
197 | 197 | // Блоки |
198 | 198 | // Блок последних страниц |
199 | 199 | $modversion['blocks'][] = [ |
200 | - 'file' => 'instr_lastpage.php', |
|
201 | - 'name' => _MI_INSTR_BLOCK_LASTPAGE, |
|
202 | - 'description' => _MI_INSTR_BLOCK_LASTPAGE_DESC, |
|
203 | - 'show_func' => 'b_instr_lastpage_show', |
|
204 | - 'edit_func' => 'b_instr_lastpage_edit', |
|
205 | - 'options' => '10|20', |
|
206 | - 'template' => $moduleDirName . '_block_lastpage.tpl' |
|
200 | + 'file' => 'instr_lastpage.php', |
|
201 | + 'name' => _MI_INSTR_BLOCK_LASTPAGE, |
|
202 | + 'description' => _MI_INSTR_BLOCK_LASTPAGE_DESC, |
|
203 | + 'show_func' => 'b_instr_lastpage_show', |
|
204 | + 'edit_func' => 'b_instr_lastpage_edit', |
|
205 | + 'options' => '10|20', |
|
206 | + 'template' => $moduleDirName . '_block_lastpage.tpl' |
|
207 | 207 | ]; |
208 | 208 | // Блок последних инструкций |
209 | 209 | $modversion['blocks'][] = [ |
210 | - 'file' => 'instr_lastinstr.php', |
|
211 | - 'name' => _MI_INSTR_BLOCK_LASTINSTR, |
|
212 | - 'description' => _MI_INSTR_BLOCK_LASTINSTR_DESC, |
|
213 | - 'show_func' => 'b_instr_lastinstr_show', |
|
214 | - 'edit_func' => 'b_instr_lastinstr_edit', |
|
215 | - 'options' => '10|20', |
|
216 | - 'template' => $moduleDirName . '_block_lastinstr.tpl' |
|
210 | + 'file' => 'instr_lastinstr.php', |
|
211 | + 'name' => _MI_INSTR_BLOCK_LASTINSTR, |
|
212 | + 'description' => _MI_INSTR_BLOCK_LASTINSTR_DESC, |
|
213 | + 'show_func' => 'b_instr_lastinstr_show', |
|
214 | + 'edit_func' => 'b_instr_lastinstr_edit', |
|
215 | + 'options' => '10|20', |
|
216 | + 'template' => $moduleDirName . '_block_lastinstr.tpl' |
|
217 | 217 | ]; |
218 | 218 | |
219 | 219 | // Notification |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | $configurator = include __DIR__ . '/../include/config.php'; |
13 | 13 | foreach (array_keys($configurator->uploadFolders) as $i) { |
14 | - $utility::createFolder($configurator->uploadFolders[$i]); |
|
15 | - $adminObject->addConfigBoxLine($configurator->uploadFolders[$i], 'folder'); |
|
14 | + $utility::createFolder($configurator->uploadFolders[$i]); |
|
15 | + $adminObject->addConfigBoxLine($configurator->uploadFolders[$i], 'folder'); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | //$instructionHandler = xoops_getModuleHandler('instruction', 'instruction'); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Xoopsmodules\instruction; |
4 | 4 | |
5 | 5 | if (!isset($moduleDirName)) { |
6 | - $moduleDirName = basename(dirname(__DIR__)); |
|
6 | + $moduleDirName = basename(dirname(__DIR__)); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | /** @var Xmf\Module\Helper $moduleHelper */ |
@@ -17,34 +17,34 @@ discard block |
||
17 | 17 | |
18 | 18 | // Административное меню |
19 | 19 | $adminmenu = [ |
20 | - [ |
|
21 | - 'title' => _MI_INSTRUCTION_ADMIN_HOME, |
|
22 | - 'link' => 'admin/index.php', |
|
23 | - 'desc' => _MI_INSTRUCTION_ADMIN_HOME_DESC, |
|
24 | - 'icon' => $pathIcon32 . '/home.png' |
|
25 | - ], |
|
26 | - [ |
|
27 | - 'title' => _MI_INSTRUCTION_ADMIN_CAT, |
|
28 | - 'link' => 'admin/cat.php', |
|
29 | - 'desc' => _MI_INSTRUCTION_ADMIN_CAT_DESC, |
|
30 | - 'icon' => $pathIcon32 . '/category.png' |
|
31 | - ], |
|
32 | - [ |
|
33 | - 'title' => _MI_INSTRUCTION_ADMIN_INSTR, |
|
34 | - 'link' => 'admin/instr.php', |
|
35 | - 'desc' => _MI_INSTRUCTION_ADMIN_INSTR_DESC, |
|
36 | - 'icon' => $pathModIcon32 . '/nav_book.png' |
|
37 | - ], |
|
38 | - [ |
|
39 | - 'title' => _MI_INSTRUCTION_ADMIN_PERM, |
|
40 | - 'link' => 'admin/perm.php', |
|
41 | - 'desc' => _MI_INSTRUCTION_ADMIN_PERM_DESC, |
|
42 | - 'icon' => $pathIcon32 . '/permissions.png' |
|
43 | - ], |
|
44 | - [ |
|
45 | - 'title' => _MI_INSTRUCTION_ADMIN_ABOUT, |
|
46 | - 'link' => 'admin/about.php', |
|
47 | - 'desc' => _MI_INSTRUCTION_ADMIN_ABOUT_DESC, |
|
48 | - 'icon' => $pathIcon32 . '/about.png' |
|
49 | - ] |
|
20 | + [ |
|
21 | + 'title' => _MI_INSTRUCTION_ADMIN_HOME, |
|
22 | + 'link' => 'admin/index.php', |
|
23 | + 'desc' => _MI_INSTRUCTION_ADMIN_HOME_DESC, |
|
24 | + 'icon' => $pathIcon32 . '/home.png' |
|
25 | + ], |
|
26 | + [ |
|
27 | + 'title' => _MI_INSTRUCTION_ADMIN_CAT, |
|
28 | + 'link' => 'admin/cat.php', |
|
29 | + 'desc' => _MI_INSTRUCTION_ADMIN_CAT_DESC, |
|
30 | + 'icon' => $pathIcon32 . '/category.png' |
|
31 | + ], |
|
32 | + [ |
|
33 | + 'title' => _MI_INSTRUCTION_ADMIN_INSTR, |
|
34 | + 'link' => 'admin/instr.php', |
|
35 | + 'desc' => _MI_INSTRUCTION_ADMIN_INSTR_DESC, |
|
36 | + 'icon' => $pathModIcon32 . '/nav_book.png' |
|
37 | + ], |
|
38 | + [ |
|
39 | + 'title' => _MI_INSTRUCTION_ADMIN_PERM, |
|
40 | + 'link' => 'admin/perm.php', |
|
41 | + 'desc' => _MI_INSTRUCTION_ADMIN_PERM_DESC, |
|
42 | + 'icon' => $pathIcon32 . '/permissions.png' |
|
43 | + ], |
|
44 | + [ |
|
45 | + 'title' => _MI_INSTRUCTION_ADMIN_ABOUT, |
|
46 | + 'link' => 'admin/about.php', |
|
47 | + 'desc' => _MI_INSTRUCTION_ADMIN_ABOUT_DESC, |
|
48 | + 'icon' => $pathIcon32 . '/about.png' |
|
49 | + ] |
|
50 | 50 | ]; |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Xoopsmodules\instruction; |
4 | 4 | |
5 | -if (!isset($moduleDirName)) { |
|
5 | +if ( ! isset($moduleDirName)) { |
|
6 | 6 | $moduleDirName = basename(dirname(__DIR__)); |
7 | 7 | } |
8 | 8 |
@@ -22,12 +22,12 @@ |
||
22 | 22 | */ |
23 | 23 | class InstructionCorePreload extends XoopsPreloadItem |
24 | 24 | { |
25 | - // to add PSR-4 autoloader |
|
26 | - /** |
|
27 | - * @param $args |
|
28 | - */ |
|
29 | - public static function eventCoreIncludeCommonEnd($args) |
|
30 | - { |
|
31 | - include __DIR__ . '/autoloader.php'; |
|
32 | - } |
|
25 | + // to add PSR-4 autoloader |
|
26 | + /** |
|
27 | + * @param $args |
|
28 | + */ |
|
29 | + public static function eventCoreIncludeCommonEnd($args) |
|
30 | + { |
|
31 | + include __DIR__ . '/autoloader.php'; |
|
32 | + } |
|
33 | 33 | } |
@@ -4,29 +4,29 @@ |
||
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register(function ($class) { |
7 | - // project-specific namespace prefix |
|
8 | - $prefix = 'Xoopsmodules\\instruction\\'; |
|
7 | + // project-specific namespace prefix |
|
8 | + $prefix = 'Xoopsmodules\\instruction\\'; |
|
9 | 9 | |
10 | - // base directory for the namespace prefix |
|
11 | - $base_dir = __DIR__ . '/../class/'; |
|
10 | + // base directory for the namespace prefix |
|
11 | + $base_dir = __DIR__ . '/../class/'; |
|
12 | 12 | |
13 | - // does the class use the namespace prefix? |
|
14 | - $len = strlen($prefix); |
|
13 | + // does the class use the namespace prefix? |
|
14 | + $len = strlen($prefix); |
|
15 | 15 | |
16 | - if (0 !== strncmp($prefix, $class, $len)) { |
|
17 | - return; |
|
18 | - } |
|
16 | + if (0 !== strncmp($prefix, $class, $len)) { |
|
17 | + return; |
|
18 | + } |
|
19 | 19 | |
20 | - // get the relative class name |
|
21 | - $relative_class = substr($class, $len); |
|
20 | + // get the relative class name |
|
21 | + $relative_class = substr($class, $len); |
|
22 | 22 | |
23 | - // replace the namespace prefix with the base directory, replace namespace |
|
24 | - // separators with directory separators in the relative class name, append |
|
25 | - // with .php |
|
26 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
23 | + // replace the namespace prefix with the base directory, replace namespace |
|
24 | + // separators with directory separators in the relative class name, append |
|
25 | + // with .php |
|
26 | + $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
27 | 27 | |
28 | - // if the file exists, require it |
|
29 | - if (file_exists($file)) { |
|
30 | - require $file; |
|
31 | - } |
|
28 | + // if the file exists, require it |
|
29 | + if (file_exists($file)) { |
|
30 | + require $file; |
|
31 | + } |
|
32 | 32 | }); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | /** |
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | -spl_autoload_register(function ($class) { |
|
6 | +spl_autoload_register(function($class) { |
|
7 | 7 | // project-specific namespace prefix |
8 | 8 | $prefix = 'Xoopsmodules\\instruction\\'; |
9 | 9 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | break; |
52 | 52 | } |
53 | 53 | } else { |
54 | - if ((int)$v > 0) { // handles versions like x.x.x.0_RC2 |
|
54 | + if ((int) $v > 0) { // handles versions like x.x.x.0_RC2 |
|
55 | 55 | $success = false; |
56 | 56 | break; |
57 | 57 | } |
@@ -17,77 +17,77 @@ |
||
17 | 17 | */ |
18 | 18 | trait VersionChecks |
19 | 19 | { |
20 | - /** |
|
21 | - * |
|
22 | - * Verifies XOOPS version meets minimum requirements for this module |
|
23 | - * @static |
|
24 | - * @param \XoopsModule|null $module |
|
25 | - * |
|
26 | - * @param null|string $requiredVer |
|
27 | - * @return bool true if meets requirements, false if not |
|
28 | - */ |
|
29 | - public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null) |
|
30 | - { |
|
31 | - $moduleDirName = basename(dirname(dirname(__DIR__))); |
|
32 | - if (null === $module) { |
|
33 | - $module = \XoopsModule::getByDirname($moduleDirName); |
|
34 | - } |
|
35 | - xoops_loadLanguage('admin', $moduleDirName); |
|
36 | - //check for minimum XOOPS version |
|
37 | - $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
|
38 | - $currArray = explode('.', $currentVer); |
|
39 | - if (null === $requiredVer) { |
|
40 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
41 | - } |
|
42 | - $reqArray = explode('.', $requiredVer); |
|
43 | - $success = true; |
|
44 | - foreach ($reqArray as $k => $v) { |
|
45 | - if (isset($currArray[$k])) { |
|
46 | - if ($currArray[$k] > $v) { |
|
47 | - break; |
|
48 | - } elseif ($currArray[$k] == $v) { |
|
49 | - continue; |
|
50 | - } else { |
|
51 | - $success = false; |
|
52 | - break; |
|
53 | - } |
|
54 | - } else { |
|
55 | - if ((int)$v > 0) { // handles versions like x.x.x.0_RC2 |
|
56 | - $success = false; |
|
57 | - break; |
|
58 | - } |
|
59 | - } |
|
60 | - } |
|
20 | + /** |
|
21 | + * |
|
22 | + * Verifies XOOPS version meets minimum requirements for this module |
|
23 | + * @static |
|
24 | + * @param \XoopsModule|null $module |
|
25 | + * |
|
26 | + * @param null|string $requiredVer |
|
27 | + * @return bool true if meets requirements, false if not |
|
28 | + */ |
|
29 | + public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null) |
|
30 | + { |
|
31 | + $moduleDirName = basename(dirname(dirname(__DIR__))); |
|
32 | + if (null === $module) { |
|
33 | + $module = \XoopsModule::getByDirname($moduleDirName); |
|
34 | + } |
|
35 | + xoops_loadLanguage('admin', $moduleDirName); |
|
36 | + //check for minimum XOOPS version |
|
37 | + $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
|
38 | + $currArray = explode('.', $currentVer); |
|
39 | + if (null === $requiredVer) { |
|
40 | + $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
41 | + } |
|
42 | + $reqArray = explode('.', $requiredVer); |
|
43 | + $success = true; |
|
44 | + foreach ($reqArray as $k => $v) { |
|
45 | + if (isset($currArray[$k])) { |
|
46 | + if ($currArray[$k] > $v) { |
|
47 | + break; |
|
48 | + } elseif ($currArray[$k] == $v) { |
|
49 | + continue; |
|
50 | + } else { |
|
51 | + $success = false; |
|
52 | + break; |
|
53 | + } |
|
54 | + } else { |
|
55 | + if ((int)$v > 0) { // handles versions like x.x.x.0_RC2 |
|
56 | + $success = false; |
|
57 | + break; |
|
58 | + } |
|
59 | + } |
|
60 | + } |
|
61 | 61 | |
62 | - if (false === $success) { |
|
63 | - $module->setErrors(sprintf(_AM_INSTRUCTION_ERROR_BAD_XOOPS, $requiredVer, $currentVer)); |
|
64 | - } |
|
62 | + if (false === $success) { |
|
63 | + $module->setErrors(sprintf(_AM_INSTRUCTION_ERROR_BAD_XOOPS, $requiredVer, $currentVer)); |
|
64 | + } |
|
65 | 65 | |
66 | - return $success; |
|
67 | - } |
|
66 | + return $success; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * |
|
71 | - * Verifies PHP version meets minimum requirements for this module |
|
72 | - * @static |
|
73 | - * @param \XoopsModule $module |
|
74 | - * |
|
75 | - * @return bool true if meets requirements, false if not |
|
76 | - */ |
|
77 | - public static function checkVerPhp(\XoopsModule $module) |
|
78 | - { |
|
79 | - xoops_loadLanguage('admin', $module->dirname()); |
|
80 | - // check for minimum PHP version |
|
81 | - $success = true; |
|
82 | - $verNum = PHP_VERSION; |
|
83 | - $reqVer = $module->getInfo('min_php'); |
|
84 | - if (false !== $reqVer && '' !== $reqVer) { |
|
85 | - if (version_compare($verNum, $reqVer, '<')) { |
|
86 | - $module->setErrors(sprintf(_AM_INSTRUCTION_ERROR_BAD_PHP, $reqVer, $verNum)); |
|
87 | - $success = false; |
|
88 | - } |
|
89 | - } |
|
69 | + /** |
|
70 | + * |
|
71 | + * Verifies PHP version meets minimum requirements for this module |
|
72 | + * @static |
|
73 | + * @param \XoopsModule $module |
|
74 | + * |
|
75 | + * @return bool true if meets requirements, false if not |
|
76 | + */ |
|
77 | + public static function checkVerPhp(\XoopsModule $module) |
|
78 | + { |
|
79 | + xoops_loadLanguage('admin', $module->dirname()); |
|
80 | + // check for minimum PHP version |
|
81 | + $success = true; |
|
82 | + $verNum = PHP_VERSION; |
|
83 | + $reqVer = $module->getInfo('min_php'); |
|
84 | + if (false !== $reqVer && '' !== $reqVer) { |
|
85 | + if (version_compare($verNum, $reqVer, '<')) { |
|
86 | + $module->setErrors(sprintf(_AM_INSTRUCTION_ERROR_BAD_PHP, $reqVer, $verNum)); |
|
87 | + $success = false; |
|
88 | + } |
|
89 | + } |
|
90 | 90 | |
91 | - return $success; |
|
92 | - } |
|
91 | + return $success; |
|
92 | + } |
|
93 | 93 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | public function render() |
65 | 65 | { |
66 | - if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) { |
|
66 | + if ( ! isset($GLOBALS['xoTheme']) || ! is_object($GLOBALS['xoTheme'])) { |
|
67 | 67 | require_once $GLOBALS['xoops']->path('class/theme.php'); |
68 | 68 | $GLOBALS['xoTheme'] = new xos_opal_Theme(); |
69 | 69 | } |
@@ -33,48 +33,48 @@ |
||
33 | 33 | */ |
34 | 34 | class Breadcrumb |
35 | 35 | { |
36 | - public $dirname; |
|
37 | - private $bread = []; |
|
36 | + public $dirname; |
|
37 | + private $bread = []; |
|
38 | 38 | |
39 | - /** |
|
40 | - * |
|
41 | - */ |
|
42 | - public function __construct() |
|
43 | - { |
|
44 | - $this->dirname = basename(dirname(dirname(__DIR__))); |
|
45 | - } |
|
39 | + /** |
|
40 | + * |
|
41 | + */ |
|
42 | + public function __construct() |
|
43 | + { |
|
44 | + $this->dirname = basename(dirname(dirname(__DIR__))); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Add link to breadcrumb |
|
49 | - * |
|
50 | - * @param string $title |
|
51 | - * @param string $link |
|
52 | - */ |
|
53 | - public function addLink($title = '', $link = '') |
|
54 | - { |
|
55 | - $this->bread[] = [ |
|
56 | - 'link' => $link, |
|
57 | - 'title' => $title |
|
58 | - ]; |
|
59 | - } |
|
47 | + /** |
|
48 | + * Add link to breadcrumb |
|
49 | + * |
|
50 | + * @param string $title |
|
51 | + * @param string $link |
|
52 | + */ |
|
53 | + public function addLink($title = '', $link = '') |
|
54 | + { |
|
55 | + $this->bread[] = [ |
|
56 | + 'link' => $link, |
|
57 | + 'title' => $title |
|
58 | + ]; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Render BreadCrumb |
|
63 | - * |
|
64 | - */ |
|
65 | - public function render() |
|
66 | - { |
|
67 | - if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) { |
|
68 | - require_once $GLOBALS['xoops']->path('class/theme.php'); |
|
69 | - $GLOBALS['xoTheme'] = new xos_opal_Theme(); |
|
70 | - } |
|
61 | + /** |
|
62 | + * Render BreadCrumb |
|
63 | + * |
|
64 | + */ |
|
65 | + public function render() |
|
66 | + { |
|
67 | + if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) { |
|
68 | + require_once $GLOBALS['xoops']->path('class/theme.php'); |
|
69 | + $GLOBALS['xoTheme'] = new xos_opal_Theme(); |
|
70 | + } |
|
71 | 71 | |
72 | - require_once $GLOBALS['xoops']->path('class/template.php'); |
|
73 | - $breadcrumbTpl = new \XoopsTpl(); |
|
74 | - $breadcrumbTpl->assign('breadcrumb', $this->bread); |
|
75 | - $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); |
|
76 | - unset($breadcrumbTpl); |
|
72 | + require_once $GLOBALS['xoops']->path('class/template.php'); |
|
73 | + $breadcrumbTpl = new \XoopsTpl(); |
|
74 | + $breadcrumbTpl->assign('breadcrumb', $this->bread); |
|
75 | + $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); |
|
76 | + unset($breadcrumbTpl); |
|
77 | 77 | |
78 | - return $html; |
|
79 | - } |
|
78 | + return $html; |
|
79 | + } |
|
80 | 80 | } |
@@ -24,38 +24,38 @@ |
||
24 | 24 | */ |
25 | 25 | class Helper extends \Xmf\Module\Helper |
26 | 26 | { |
27 | - public $debug; |
|
27 | + public $debug; |
|
28 | 28 | |
29 | - /** |
|
30 | - * @internal param $debug |
|
31 | - * @param bool $debug |
|
32 | - */ |
|
33 | - protected function __construct($debug = false) |
|
34 | - { |
|
35 | - $this->debug = $debug; |
|
36 | - $this->dirname = basename(dirname(__DIR__)); |
|
37 | - } |
|
29 | + /** |
|
30 | + * @internal param $debug |
|
31 | + * @param bool $debug |
|
32 | + */ |
|
33 | + protected function __construct($debug = false) |
|
34 | + { |
|
35 | + $this->debug = $debug; |
|
36 | + $this->dirname = basename(dirname(__DIR__)); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @param bool $debug |
|
41 | - * |
|
42 | - * @return \Xoopsmodules\instruction\Helper |
|
43 | - */ |
|
44 | - public static function getInstance($debug = false) |
|
45 | - { |
|
46 | - static $instance; |
|
47 | - if (null === $instance) { |
|
48 | - $instance = new static($debug); |
|
49 | - } |
|
39 | + /** |
|
40 | + * @param bool $debug |
|
41 | + * |
|
42 | + * @return \Xoopsmodules\instruction\Helper |
|
43 | + */ |
|
44 | + public static function getInstance($debug = false) |
|
45 | + { |
|
46 | + static $instance; |
|
47 | + if (null === $instance) { |
|
48 | + $instance = new static($debug); |
|
49 | + } |
|
50 | 50 | |
51 | - return $instance; |
|
52 | - } |
|
51 | + return $instance; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return string |
|
56 | - */ |
|
57 | - public function getDirname() |
|
58 | - { |
|
59 | - return $this->dirname; |
|
60 | - } |
|
54 | + /** |
|
55 | + * @return string |
|
56 | + */ |
|
57 | + public function getDirname() |
|
58 | + { |
|
59 | + return $this->dirname; |
|
60 | + } |
|
61 | 61 | } |
@@ -12,60 +12,60 @@ |
||
12 | 12 | */ |
13 | 13 | class PageHandler extends \XoopsPersistableObjectHandler |
14 | 14 | { |
15 | - /** |
|
16 | - * @param null|mixed $db |
|
17 | - */ |
|
18 | - public function __construct(\XoopsDatabase $db = null) |
|
19 | - { |
|
20 | - parent::__construct($db, 'instruction_page', Page::class, 'pageid', 'title'); |
|
21 | - } |
|
15 | + /** |
|
16 | + * @param null|mixed $db |
|
17 | + */ |
|
18 | + public function __construct(\XoopsDatabase $db = null) |
|
19 | + { |
|
20 | + parent::__construct($db, 'instruction_page', Page::class, 'pageid', 'title'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Generate function for update user post |
|
25 | - * |
|
26 | - * @ Update user post count after send approve content |
|
27 | - * @ Update user post count after change status content |
|
28 | - * @ Update user post count after delete content |
|
29 | - * @param $uid |
|
30 | - * @param $status |
|
31 | - * @param $action |
|
32 | - */ |
|
33 | - public function updateposts($uid, $status, $action) |
|
34 | - { |
|
35 | - // |
|
36 | - switch ($action) { |
|
37 | - // Добавление страницы |
|
38 | - case 'add': |
|
39 | - if ($uid && $status) { |
|
40 | - $user = new \XoopsUser($uid); |
|
41 | - $memberHandler = xoops_getHandler('member'); |
|
42 | - // Добавялем +1 к комментам |
|
43 | - $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') + 1); |
|
44 | - } |
|
45 | - break; |
|
46 | - // Удаление страницы |
|
47 | - case 'delete': |
|
48 | - if ($uid && $status) { |
|
49 | - $user = new \XoopsUser($uid); |
|
50 | - $memberHandler = xoops_getHandler('member'); |
|
51 | - // Декримент комментов |
|
52 | - //$user->setVar( 'posts', $user->getVar( 'posts' ) - 1 ); |
|
53 | - // Сохраняем |
|
54 | - $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') - 1); |
|
55 | - } |
|
56 | - break; |
|
23 | + /** |
|
24 | + * Generate function for update user post |
|
25 | + * |
|
26 | + * @ Update user post count after send approve content |
|
27 | + * @ Update user post count after change status content |
|
28 | + * @ Update user post count after delete content |
|
29 | + * @param $uid |
|
30 | + * @param $status |
|
31 | + * @param $action |
|
32 | + */ |
|
33 | + public function updateposts($uid, $status, $action) |
|
34 | + { |
|
35 | + // |
|
36 | + switch ($action) { |
|
37 | + // Добавление страницы |
|
38 | + case 'add': |
|
39 | + if ($uid && $status) { |
|
40 | + $user = new \XoopsUser($uid); |
|
41 | + $memberHandler = xoops_getHandler('member'); |
|
42 | + // Добавялем +1 к комментам |
|
43 | + $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') + 1); |
|
44 | + } |
|
45 | + break; |
|
46 | + // Удаление страницы |
|
47 | + case 'delete': |
|
48 | + if ($uid && $status) { |
|
49 | + $user = new \XoopsUser($uid); |
|
50 | + $memberHandler = xoops_getHandler('member'); |
|
51 | + // Декримент комментов |
|
52 | + //$user->setVar( 'posts', $user->getVar( 'posts' ) - 1 ); |
|
53 | + // Сохраняем |
|
54 | + $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') - 1); |
|
55 | + } |
|
56 | + break; |
|
57 | 57 | |
58 | - case 'status': |
|
59 | - if ($uid) { |
|
60 | - $user = new \XoopsUser($uid); |
|
61 | - $memberHandler = xoops_getHandler('member'); |
|
62 | - if ($status) { |
|
63 | - $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') - 1); |
|
64 | - } else { |
|
65 | - $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') + 1); |
|
66 | - } |
|
67 | - } |
|
68 | - break; |
|
69 | - } |
|
70 | - } |
|
58 | + case 'status': |
|
59 | + if ($uid) { |
|
60 | + $user = new \XoopsUser($uid); |
|
61 | + $memberHandler = xoops_getHandler('member'); |
|
62 | + if ($status) { |
|
63 | + $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') - 1); |
|
64 | + } else { |
|
65 | + $memberHandler->updateUserByField($user, 'posts', $user->getVar('posts') + 1); |
|
66 | + } |
|
67 | + } |
|
68 | + break; |
|
69 | + } |
|
70 | + } |
|
71 | 71 | } |