This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
1 | <?php |
||||||
2 | /** |
||||||
3 | * Module: Soapbox |
||||||
4 | * Author: hsalazar |
||||||
5 | * Licence: GNU |
||||||
6 | */ |
||||||
7 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
||||||
8 | |||||||
9 | defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
||||||
10 | |||||||
11 | $moduleDirName = basename(__DIR__); |
||||||
12 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
||||||
13 | |||||||
14 | xoops_load('xoopseditorhandler'); |
||||||
15 | $editorHandler = \XoopsEditorHandler::getInstance(); |
||||||
16 | //$xoopsUrl = parse_url(XOOPS_URL); |
||||||
17 | |||||||
18 | // ------------------- Informations ------------------- // |
||||||
19 | $modversion = [ |
||||||
20 | 'version' => 1.70, |
||||||
21 | 'module_status' => 'Beta 2', |
||||||
22 | 'release_date' => '2019/02/18', |
||||||
23 | 'name' => _MI_SOAPBOX_NAME, |
||||||
24 | 'description' => _MI_SOAPBOX_DESC, |
||||||
25 | 'official' => 0, |
||||||
26 | //1 indicates official XOOPS module supported by XOOPS Dev Team, 0 means 3rd party supported |
||||||
27 | 'author' => 'hsalazar, domifara', |
||||||
28 | 'credits' => 'XOOPS Development Team, Catzwolf, Mamba, Aerograf', |
||||||
29 | 'author_mail' => '[email protected]', |
||||||
30 | 'author_website_url' => 'https://xoops.org', |
||||||
31 | 'author_website_name' => 'XOOPS', |
||||||
32 | 'license' => 'GPL 2.0 or later', |
||||||
33 | 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
||||||
34 | 'help' => 'page=help', |
||||||
35 | // ------------------- Folders & Files ------------------- |
||||||
36 | 'release_info' => 'Changelog', |
||||||
37 | 'release_file' => XOOPS_URL . "/modules/$moduleDirName/docs/changelog.txt", |
||||||
38 | 'manual' => 'link to manual file', |
||||||
39 | 'manual_file' => XOOPS_URL . "/modules/$moduleDirName/docs/install.txt", |
||||||
40 | // images |
||||||
41 | 'image' => 'assets/images/logoModule.png', |
||||||
42 | 'iconsmall' => 'assets/images/iconsmall.png', |
||||||
43 | 'iconbig' => 'assets/images/iconbig.png', |
||||||
44 | 'dirname' => $moduleDirName, |
||||||
45 | // Local path icons |
||||||
46 | 'modicons16' => 'assets/images/icons/16', |
||||||
47 | 'modicons32' => 'assets/images/icons/32', |
||||||
48 | // --------------------About ---------------------------- |
||||||
49 | 'demo_site_url' => 'https://xoops.org', |
||||||
50 | 'demo_site_name' => 'XOOPS Demo Site', |
||||||
51 | 'support_url' => 'https://xoops.org/modules/newbb/viewforum.php?forum=28/', |
||||||
52 | 'support_name' => 'Support Forum', |
||||||
53 | 'submit_bug' => 'https://github.com/XoopsModules25x/' . $moduleDirName . '/issues', |
||||||
54 | 'module_website_url' => 'www.xoops.org', |
||||||
55 | 'module_website_name' => 'XOOPS Project', |
||||||
56 | 'author_realname' => 'Horacio Salazar, domifara', |
||||||
57 | 'author_email' => '[email protected]', |
||||||
58 | 'warning' => _MI_SOAPBOX_WARNING, |
||||||
59 | 'author_word' => _MI_SOAPBOX_AUTHORMSG, |
||||||
60 | // ------------------- Min Requirements ------------------- |
||||||
61 | 'min_php' => '5.5', |
||||||
62 | 'min_xoops' => '2.5.9', |
||||||
63 | 'min_admin' => '1.2', |
||||||
64 | 'min_db' => ['mysql' => '5.5'], |
||||||
65 | // ------------------- Admin Menu ------------------- |
||||||
66 | 'system_menu' => 1, |
||||||
67 | 'hasAdmin' => 1, |
||||||
68 | 'adminindex' => 'admin/index.php', |
||||||
69 | 'adminmenu' => 'admin/menu.php', |
||||||
70 | // ------------------- Main Menu ------------------- |
||||||
71 | 'hasMain' => 1, |
||||||
72 | // 'sub' => [ |
||||||
73 | // [ |
||||||
74 | // 'name' => _MI_SOAPBOX_VIEW_SEARCH, |
||||||
75 | // 'url' => 'index.php' |
||||||
76 | // ], |
||||||
77 | // ], |
||||||
78 | |||||||
79 | // ------------------- Install/Update ------------------- |
||||||
80 | 'onInstall' => 'include/oninstall.php', |
||||||
81 | 'onUpdate' => 'include/onupdate.php', |
||||||
82 | // 'onUninstall' => 'include/onuninstall.php', |
||||||
83 | // ------------------- PayPal --------------------------- |
||||||
84 | 'paypal' => [ |
||||||
85 | 'business' => '[email protected]', |
||||||
86 | 'item_name' => 'Donation : ' . _MI_SOAPBOX_NAME, |
||||||
87 | 'amount' => 0, |
||||||
88 | 'currency_code' => 'USD', |
||||||
89 | ], |
||||||
90 | // ------------------- Search --------------------------- |
||||||
91 | 'hasSearch' => 1, |
||||||
92 | 'search' => [ |
||||||
93 | 'file' => 'include/search.inc.php', |
||||||
94 | 'func' => 'sb_search', |
||||||
95 | ], |
||||||
96 | |||||||
97 | // ------------------- Mysql ----------------------------- |
||||||
98 | 'sqlfile' => ['mysql' => 'sql/mysql.sql'], |
||||||
99 | // ------------------- Tables ---------------------------- |
||||||
100 | // 'tables' => [ |
||||||
101 | // $moduleDirName . '_' . 'XXX', |
||||||
102 | // $moduleDirName . '_' . 'XXX', |
||||||
103 | // $moduleDirName . '_' . 'XXX', |
||||||
104 | // $moduleDirName . '_' . 'XXX', |
||||||
105 | // $moduleDirName . '_' . 'XXX', |
||||||
106 | // $moduleDirName . '_' . 'XXX', |
||||||
107 | // ], |
||||||
108 | ]; |
||||||
109 | |||||||
110 | // Tables created by sql file (without prefix!) |
||||||
111 | $modversion['tables'][0] = 'sbcolumns'; |
||||||
112 | $modversion['tables'][1] = 'sbarticles'; |
||||||
113 | $modversion['tables'][2] = 'sbvotedata'; |
||||||
114 | |||||||
115 | // Menu |
||||||
116 | $modversion['hasMain'] = 1; |
||||||
117 | |||||||
118 | // ------------------- Help files ------------------- // |
||||||
119 | $modversion['helpsection'] = [ |
||||||
120 | ['name' => _MI_SOAPBOX_OVERVIEW, 'link' => 'page=help'], |
||||||
121 | ['name' => _MI_SOAPBOX_DISCLAIMER, 'link' => 'page=disclaimer'], |
||||||
122 | ['name' => _MI_SOAPBOX_LICENSE, 'link' => 'page=license'], |
||||||
123 | ['name' => _MI_SOAPBOX_SUPPORT, 'link' => 'page=support'], |
||||||
124 | ]; |
||||||
125 | |||||||
126 | //Install/Uninstall Functions |
||||||
127 | $modversion['onInstall'] = 'include/oninstall.php'; |
||||||
128 | $modversion['onUpdate'] = 'include/onupdate.php'; |
||||||
129 | $modversion['onUninstall'] = 'include/onuninstall.php'; |
||||||
130 | |||||||
131 | global $xoopsDB, $xoopsUser; |
||||||
132 | $moduleHandler = xoops_getHandler('module'); |
||||||
133 | $i = 0; |
||||||
134 | if ($soapModule = $moduleHandler->getByDirname('soapbox')) { |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
135 | $grouppermHandler = xoops_getHandler('groupperm'); |
||||||
136 | $hModConfig = xoops_getHandler('config'); |
||||||
137 | |||||||
138 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
||||||
139 | |||||||
140 | if (is_object($xoopsUser)) { |
||||||
141 | $user = $xoopsUser->getVar('uid'); |
||||||
142 | $query = $xoopsDB->query('SELECT author FROM ' . $xoopsDB->prefix('sbcolumns') . ' WHERE author = ' . $xoopsUser->getVar('uid')); |
||||||
143 | if ($query) { |
||||||
144 | $isauthor = $xoopsDB->getRowsNum($query); |
||||||
145 | if ($isauthor >= 1 || $xoopsUser->isAdmin($soapModule->getVar('mid'))) { |
||||||
146 | ++$i; |
||||||
147 | $modversion['sub'][$i]['name'] = _MI_SOAPBOX_SUB_SMNAME1; |
||||||
148 | $modversion['sub'][$i]['url'] = 'submit.php?op=add'; |
||||||
149 | } |
||||||
150 | } |
||||||
151 | } |
||||||
152 | unset($isauthor); |
||||||
153 | $module_id = $soapModule->getVar('mid'); |
||||||
154 | $soapConfig = $hModConfig->getConfigsByCat(0, $soapModule->getVar('mid')); |
||||||
0 ignored issues
–
show
The method
getConfigsByCat() does not exist on XoopsObjectHandler . It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
155 | if (is_object($xoopsUser) && isset($soapConfig['colsinmenu']) && 1 === $soapConfig['colsinmenu']) { |
||||||
156 | $sql = $xoopsDB->query('SELECT columnID, name FROM ' . $xoopsDB->prefix('sbcolumns') . ' ORDER BY weight'); |
||||||
157 | if ($sql) { |
||||||
158 | while (false !== (list($columnID, $name) = $xoopsDB->fetchRow($sql))) { |
||||||
159 | if ($grouppermHandler->checkRight('Column Permissions', $columnID, $groups, $module_id)) { |
||||||
0 ignored issues
–
show
The method
checkRight() does not exist on XoopsObjectHandler . It seems like you code against a sub-type of XoopsObjectHandler such as XoopsGroupPermHandler or XoopsPersistableObjectHandler .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
160 | ++$i; |
||||||
161 | $modversion['sub'][$i]['name'] = $name; |
||||||
162 | $modversion['sub'][$i]['url'] = 'column.php?columnID=' . $columnID . ''; |
||||||
163 | } |
||||||
164 | } |
||||||
165 | } |
||||||
166 | } |
||||||
167 | } |
||||||
168 | |||||||
169 | $modversion['blocks'][] = [ |
||||||
170 | 'file' => 'arts_rated.php', |
||||||
171 | 'name' => _MI_SOAPBOX_ARTSRATED, |
||||||
172 | 'description' => _MI_SOAPBOX_ARTSRATED_DSC, |
||||||
173 | 'show_func' => 'b_arts_rated', |
||||||
174 | 'edit_func' => 'b_arts_rated_edit', |
||||||
175 | 'options' => 'rating|5|65', |
||||||
176 | 'template' => 'arts_rated.tpl', |
||||||
177 | 'can_clone' => true, |
||||||
178 | ]; |
||||||
179 | |||||||
180 | $modversion['blocks'][] = [ |
||||||
181 | 'file' => 'arts_new.php', |
||||||
182 | 'name' => _MI_SOAPBOX_ARTSNEW, |
||||||
183 | 'description' => _MI_SOAPBOX_ARTSNEW_DSC, |
||||||
184 | 'show_func' => 'b_arts_new_show', |
||||||
185 | 'edit_func' => 'b_arts_new_edit', |
||||||
186 | 'options' => 'datesub|5|65', |
||||||
187 | 'template' => 'arts_new.tpl', |
||||||
188 | 'can_clone' => true, |
||||||
189 | ]; |
||||||
190 | |||||||
191 | $modversion['blocks'][] = [ |
||||||
192 | 'file' => 'arts_top.php', |
||||||
193 | 'name' => _MI_SOAPBOX_ARTSTOP, |
||||||
194 | 'description' => _MI_SOAPBOX_ARTSTOP_DSC, |
||||||
195 | 'show_func' => 'b_arts_top_show', |
||||||
196 | 'edit_func' => 'b_arts_top_edit', |
||||||
197 | 'options' => 'counter|5|65', |
||||||
198 | 'template' => 'arts_top.tpl', |
||||||
199 | 'can_clone' => true, |
||||||
200 | ]; |
||||||
201 | |||||||
202 | $modversion['blocks'][] = [ |
||||||
203 | 'file' => 'arts_spot.php', |
||||||
204 | 'name' => _MI_SOAPBOX_ARTSPOTLIGHT, |
||||||
205 | 'description' => _MI_SOAPBOX_ARTSPOTLIGHT_DSC, |
||||||
206 | 'show_func' => 'b_arts_spot_show', |
||||||
207 | 'edit_func' => 'b_arts_spot_edit', |
||||||
208 | 'options' => '1|5|1|1|1|ver|1|datesub|65|0', |
||||||
209 | 'template' => 'arts_spot.tpl', |
||||||
210 | 'can_clone' => true, |
||||||
211 | ]; |
||||||
212 | |||||||
213 | $modversion['blocks'][] = [ |
||||||
214 | 'file' => 'columns_spot.php', |
||||||
215 | 'name' => _MI_SOAPBOX_ARTSPOTLIGHT2, |
||||||
216 | 'description' => _MI_SOAPBOX_ARTSPOTLIGHT2_DSC, |
||||||
217 | 'show_func' => 'b_columns_spot_show', |
||||||
218 | 'edit_func' => 'b_columns_spot_edit', |
||||||
219 | 'options' => '1|5|1|1|1|ver|1|datesub|65|0', |
||||||
220 | 'template' => 'columns_spot.tpl', |
||||||
221 | 'can_clone' => true, |
||||||
222 | ]; |
||||||
223 | |||||||
224 | // Templates |
||||||
225 | |||||||
226 | $modversion['templates'] = [ |
||||||
227 | ['file' => 'sb_column.tpl', 'description' => 'Display columns'], |
||||||
228 | ['file' => 'sb_index.tpl', 'description' => 'Display index'], |
||||||
229 | ['file' => 'sb_article.tpl', 'description' => 'Display article'], |
||||||
230 | ]; |
||||||
231 | |||||||
232 | // Config Settings (only for modules that need config settings generated automatically) |
||||||
233 | |||||||
234 | $modversion['config'][] = [ |
||||||
235 | 'name' => 'allowsubmit', |
||||||
236 | 'title' => '_MI_SOAPBOX_ALLOWSUBMIT', |
||||||
237 | 'description' => '_MI_SOAPBOX_ALLOWSUBMITDSC', |
||||||
238 | 'formtype' => 'yesno', |
||||||
239 | 'valuetype' => 'int', |
||||||
240 | 'default' => 1, |
||||||
241 | ]; |
||||||
242 | |||||||
243 | $modversion['config'][] = [ |
||||||
244 | 'name' => 'autoapprove', |
||||||
245 | 'title' => '_MI_SOAPBOX_AUTOAPPROVE', |
||||||
246 | 'description' => '_MI_SOAPBOX_AUTOAPPROVEDSC', |
||||||
247 | 'formtype' => 'yesno', |
||||||
248 | 'valuetype' => 'int', |
||||||
249 | 'default' => 0, |
||||||
250 | ]; |
||||||
251 | |||||||
252 | $modversion['config'][] = [ |
||||||
253 | 'name' => 'adminhits', |
||||||
254 | 'title' => '_MI_SOAPBOX_ALLOWADMINHITS', |
||||||
255 | 'description' => '_MI_SOAPBOX_ALLOWADMINHITSDSC', |
||||||
256 | 'formtype' => 'yesno', |
||||||
257 | 'valuetype' => 'int', |
||||||
258 | 'default' => 0, |
||||||
259 | ]; |
||||||
260 | |||||||
261 | $modversion['config'][] = [ |
||||||
262 | 'name' => 'perpage', |
||||||
263 | 'title' => '_MI_SOAPBOX_PERPAGE', |
||||||
264 | 'description' => '_MI_SOAPBOX_PERPAGEDSC', |
||||||
265 | 'formtype' => 'select', |
||||||
266 | 'valuetype' => 'int', |
||||||
267 | 'default' => 5, |
||||||
268 | 'options' => [ |
||||||
269 | '5' => 5, |
||||||
270 | '10' => 10, |
||||||
271 | '15' => 15, |
||||||
272 | '20' => 20, |
||||||
273 | '25' => 25, |
||||||
274 | '30' => 30, |
||||||
275 | '50' => 50, |
||||||
276 | ], |
||||||
277 | ]; |
||||||
278 | |||||||
279 | $modversion['config'][] = [ |
||||||
280 | 'name' => 'indexperpage', |
||||||
281 | 'title' => '_MI_SOAPBOX_PERPAGEINDEX', |
||||||
282 | 'description' => '_MI_SOAPBOX_PERPAGEINDEXDSC', |
||||||
283 | 'formtype' => 'select', |
||||||
284 | 'valuetype' => 'int', |
||||||
285 | 'default' => 5, |
||||||
286 | 'options' => [ |
||||||
287 | '5' => 5, |
||||||
288 | '10' => 10, |
||||||
289 | '15' => 15, |
||||||
290 | '20' => 20, |
||||||
291 | '25' => 25, |
||||||
292 | '30' => 30, |
||||||
293 | '50' => 50, |
||||||
294 | ], |
||||||
295 | ]; |
||||||
296 | |||||||
297 | $modversion['config'][] = [ |
||||||
298 | 'name' => 'sbimgdir', |
||||||
299 | 'title' => '_MI_SOAPBOX_IMGDIR', |
||||||
300 | 'description' => '_MI_SOAPBOX_IMGDIRDSC', |
||||||
301 | 'formtype' => 'textbox', |
||||||
302 | 'valuetype' => 'text', |
||||||
303 | 'default' => "modules/$moduleDirName/assets/images", |
||||||
304 | ]; |
||||||
305 | |||||||
306 | $modversion['config'][] = [ |
||||||
307 | 'name' => 'sbuploaddir', |
||||||
308 | 'title' => '_MI_SOAPBOX_UPLOADDIR', |
||||||
309 | 'description' => '_MI_SOAPBOX_UPLOADDIRDSC', |
||||||
310 | 'formtype' => 'textbox', |
||||||
311 | 'valuetype' => 'text', |
||||||
312 | // 'default' => 'modules/soapbox/assets/images/uploads', |
||||||
313 | 'default' => 'uploads/' . $moduleDirName . '/images', |
||||||
314 | ]; |
||||||
315 | |||||||
316 | $modversion['config'][] = [ |
||||||
317 | 'name' => 'maximgwidth', |
||||||
318 | 'title' => '_MI_SOAPBOX_IMGWIDTH', |
||||||
319 | 'description' => '_MI_SOAPBOX_IMGWIDTHDSC', |
||||||
320 | 'formtype' => 'textbox', |
||||||
321 | 'valuetype' => 'int', |
||||||
322 | 'default' => 800, |
||||||
323 | ]; |
||||||
324 | |||||||
325 | $modversion['config'][] = [ |
||||||
326 | 'name' => 'maximgheight', |
||||||
327 | 'title' => '_MI_SOAPBOX_IMGHEIGHT', |
||||||
328 | 'description' => '_MI_SOAPBOX_IMGHEIGHTDSC', |
||||||
329 | 'formtype' => 'textbox', |
||||||
330 | 'valuetype' => 'int', |
||||||
331 | 'default' => 800, |
||||||
332 | ]; |
||||||
333 | |||||||
334 | $modversion['config'][] = [ |
||||||
335 | 'name' => 'maxfilesize', |
||||||
336 | 'title' => '_MI_SOAPBOX_MAXFILESIZE', |
||||||
337 | 'description' => '_MI_SOAPBOX_MAXFILESIZEDSC', |
||||||
338 | 'formtype' => 'textbox', |
||||||
339 | 'valuetype' => 'int', |
||||||
340 | 'default' => 250000, |
||||||
341 | ]; |
||||||
342 | |||||||
343 | $modversion['config'][] = [ |
||||||
344 | 'name' => 'dateformat', |
||||||
345 | 'title' => '_MI_SOAPBOX_DATEFORMAT', |
||||||
346 | 'description' => '_MI_SOAPBOX_DATEFORMATDSC', |
||||||
347 | 'formtype' => 'textbox', |
||||||
348 | 'valuetype' => 'text', |
||||||
349 | 'default' => _SHORTDATESTRING, //'d M Y', |
||||||
350 | ]; |
||||||
351 | |||||||
352 | $modversion['config'][] = [ |
||||||
353 | 'name' => 'globaldisplaycomments', |
||||||
354 | 'title' => '_MI_SOAPBOX_ALLOWCOMMENTS', |
||||||
355 | 'description' => '_MI_SOAPBOX_ALLOWCOMMENTSDSC', |
||||||
356 | 'formtype' => 'yesno', |
||||||
357 | 'valuetype' => 'int', |
||||||
358 | 'default' => 1, |
||||||
359 | ]; |
||||||
360 | |||||||
361 | $modversion['config'][] = [ |
||||||
362 | 'name' => 'morearts', |
||||||
363 | 'title' => '_MI_SOAPBOX_MOREARTS', |
||||||
364 | 'description' => '_MI_SOAPBOX_MOREARTSDSC', |
||||||
365 | 'formtype' => 'select', |
||||||
366 | 'valuetype' => 'int', |
||||||
367 | 'default' => 3, |
||||||
368 | 'options' => ['3' => 3, '5' => 5, '10' => 10, '15' => 15, '20' => 20], |
||||||
369 | ]; |
||||||
370 | |||||||
371 | $modversion['config'][] = [ |
||||||
372 | 'name' => 'colsinmenu', |
||||||
373 | 'title' => '_MI_SOAPBOX_COLSINMENU', |
||||||
374 | 'description' => '_MI_SOAPBOX_COLSINMENUDSC', |
||||||
375 | 'formtype' => 'yesno', |
||||||
376 | 'valuetype' => 'int', |
||||||
377 | 'default' => 0, |
||||||
378 | ]; |
||||||
379 | |||||||
380 | $modversion['config'][] = [ |
||||||
381 | 'name' => 'colsperindex', |
||||||
382 | 'title' => '_MI_SOAPBOX_COLSPERINDEX', |
||||||
383 | 'description' => '_MI_SOAPBOX_COLSPERINDEXDSC', |
||||||
384 | 'formtype' => 'select', |
||||||
385 | 'valuetype' => 'int', |
||||||
386 | 'default' => 3, |
||||||
387 | 'options' => [ |
||||||
388 | '3' => 3, |
||||||
389 | '5' => 5, |
||||||
390 | '10' => 10, |
||||||
391 | '15' => 15, |
||||||
392 | '20' => 20, |
||||||
393 | '25' => 25, |
||||||
394 | '30' => 30, |
||||||
395 | '50' => 50, |
||||||
396 | ], |
||||||
397 | ]; |
||||||
398 | |||||||
399 | $modversion['config'][] = [ |
||||||
400 | 'name' => 'includerating', |
||||||
401 | 'title' => '_MI_SOAPBOX_ALLOWRATING', |
||||||
402 | 'description' => '_MI_SOAPBOX_ALLOWRATINGDSC', |
||||||
403 | 'formtype' => 'yesno', |
||||||
404 | 'valuetype' => 'int', |
||||||
405 | 'default' => 1, |
||||||
406 | ]; |
||||||
407 | |||||||
408 | $modversion['config'][] = [ |
||||||
409 | 'name' => 'introtitle', |
||||||
410 | 'title' => '_MI_SOAPBOX_INTROTIT', |
||||||
411 | 'description' => '_MI_SOAPBOX_INTROTITDSC', |
||||||
412 | 'formtype' => 'textbox', |
||||||
413 | 'valuetype' => 'text', |
||||||
414 | 'default' => _MI_SOAPBOX_INTROTITDFLT, |
||||||
415 | ]; |
||||||
416 | |||||||
417 | $modversion['config'][] = [ |
||||||
418 | 'name' => 'introtext', |
||||||
419 | 'title' => '_MI_SOAPBOX_INTROTEXT', |
||||||
420 | 'description' => '_MI_SOAPBOX_INTROTEXTDSC', |
||||||
421 | 'formtype' => 'textarea', |
||||||
422 | 'valuetype' => 'text', |
||||||
423 | 'default' => _MI_SOAPBOX_INTROTEXTDFLT, |
||||||
424 | ]; |
||||||
425 | |||||||
426 | $modversion['config'][] = [ |
||||||
427 | 'name' => 'buttonsadmin', |
||||||
428 | 'title' => '_MI_SOAPBOX_BUTTSTXT', |
||||||
429 | 'description' => '_MI_SOAPBOX_BUTTSTXTDSC', |
||||||
430 | 'formtype' => 'yesno', |
||||||
431 | 'valuetype' => 'int', |
||||||
432 | 'default' => 0, |
||||||
433 | ]; |
||||||
434 | |||||||
435 | xoops_load('xoopseditorhandler'); |
||||||
436 | $editorHandler = XoopsEditorHandler::getInstance(); |
||||||
437 | |||||||
438 | $modversion['config'][] = [ |
||||||
439 | 'name' => 'editorAdmin', |
||||||
440 | 'title' => 'MI_SOAPBOX_EDITOR_ADMIN', |
||||||
441 | 'description' => 'MI_SOAPBOX_EDITOR_DESC_ADMIN', |
||||||
442 | 'formtype' => 'select', |
||||||
443 | 'valuetype' => 'text', |
||||||
444 | 'options' => array_flip($editorHandler->getList()), |
||||||
445 | 'default' => 'tinymce', |
||||||
446 | ]; |
||||||
447 | |||||||
448 | $modversion['config'][] = [ |
||||||
449 | 'name' => 'editorUser', |
||||||
450 | 'title' => 'MI_SOAPBOX_EDITOR_USER', |
||||||
451 | 'description' => 'MI_SOAPBOX_EDITOR_DESC_USER', |
||||||
452 | 'formtype' => 'select', |
||||||
453 | 'valuetype' => 'text', |
||||||
454 | 'options' => array_flip($editorHandler->getList()), |
||||||
455 | 'default' => 'dhtmltextarea', |
||||||
456 | ]; |
||||||
457 | |||||||
458 | // Теги |
||||||
459 | $modversion['config'][] = [ |
||||||
460 | 'name' => 'usetag', |
||||||
461 | 'title' => '_MI_SOAPBOX_USETAG', |
||||||
462 | 'description' => '_MI_SOAPBOX_USETAGDSC', |
||||||
463 | 'formtype' => 'yesno', |
||||||
464 | 'valuetype' => 'int', |
||||||
465 | 'default' => 0, |
||||||
466 | ]; |
||||||
467 | |||||||
468 | /** |
||||||
469 | * Make Sample button visible? |
||||||
470 | */ |
||||||
471 | //$modversion['config'][] = [ |
||||||
472 | // 'name' => 'displaySampleButton', |
||||||
473 | // 'title' => '_MI_SOAPBOX_SHOW_SAMPLE_BUTTON', |
||||||
474 | // 'description' => '_MI_SOAPBOX_SHOW_SAMPLE_BUTTON_DESC', |
||||||
475 | // 'formtype' => 'yesno', |
||||||
476 | // 'valuetype' => 'int', |
||||||
477 | // 'default' => 0, |
||||||
478 | //]; |
||||||
479 | |||||||
480 | /** |
||||||
481 | * Make Sample button visible? |
||||||
482 | */ |
||||||
483 | $modversion['config'][] = [ |
||||||
484 | 'name' => 'displaySampleButton', |
||||||
485 | 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
||||||
486 | 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
||||||
487 | 'formtype' => 'yesno', |
||||||
488 | 'valuetype' => 'int', |
||||||
489 | 'default' => 1, |
||||||
490 | ]; |
||||||
491 | |||||||
492 | /** |
||||||
493 | * Show Developer Tools? |
||||||
494 | */ |
||||||
495 | $modversion['config'][] = [ |
||||||
496 | 'name' => 'displayDeveloperTools', |
||||||
497 | 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS', |
||||||
498 | 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS_DESC', |
||||||
499 | 'formtype' => 'yesno', |
||||||
500 | 'valuetype' => 'int', |
||||||
501 | 'default' => 0, |
||||||
502 | ]; |
||||||
503 | |||||||
504 | // -------------------- Comments ----------------------------- |
||||||
505 | |||||||
506 | $modversion['hasComments'] = 1; |
||||||
507 | $modversion['comments']['itemName'] = 'articleID'; |
||||||
508 | $modversion['comments']['pageName'] = 'article.php'; |
||||||
509 | |||||||
510 | // Comment callback functions |
||||||
511 | $modversion['comments']['callbackFile'] = 'include/comment_functions.php'; |
||||||
512 | $modversion['comments']['callback']['approve'] = 'sb_com_approve'; |
||||||
513 | $modversion['comments']['callback']['update'] = 'sb_com_update'; |
||||||
514 | |||||||
515 | // Notification |
||||||
516 | $modversion['hasNotification'] = 1; |
||||||
517 | $modversion['notification']['lookup_file'] = 'include/notification.inc.php'; |
||||||
518 | $modversion['notification']['lookup_func'] = 'sb_notify_iteminfo'; |
||||||
519 | |||||||
520 | $modversion['notification']['category'][] = [ |
||||||
521 | 'name' => 'global', |
||||||
522 | 'title' => _MI_SOAPBOX_GLOBAL_NOTIFY, |
||||||
523 | 'description' => _MI_SOAPBOX_GLOBAL_NOTIFYDSC, |
||||||
524 | 'subscribe_from' => ['index.php', 'column.php', 'article.php'], |
||||||
525 | ]; |
||||||
526 | |||||||
527 | $modversion['notification']['category'][] = [ |
||||||
528 | 'name' => 'column', |
||||||
529 | 'title' => _MI_SOAPBOX_COLUMN_NOTIFY, |
||||||
530 | 'description' => _MI_SOAPBOX_COLUMN_NOTIFYDSC, |
||||||
531 | 'subscribe_from' => ['index.php'], |
||||||
532 | 'item_name' => 'columnID', |
||||||
533 | 'allow_bookmark' => 1, |
||||||
534 | ]; |
||||||
535 | |||||||
536 | $modversion['notification']['category'][] = [ |
||||||
537 | 'name' => 'article', |
||||||
538 | 'title' => _MI_SOAPBOX_ARTICLE_NOTIFY, |
||||||
539 | 'description' => _MI_SOAPBOX_ARTICLE_NOTIFYDSC, |
||||||
540 | 'subscribe_from' => 'article.php', |
||||||
541 | 'item_name' => 'articleID', |
||||||
542 | 'allow_bookmark' => 1, |
||||||
543 | ]; |
||||||
544 | |||||||
545 | $modversion['notification']['event'][] = [ |
||||||
546 | 'name' => 'new_column', |
||||||
547 | 'category' => 'global', |
||||||
548 | 'title' => _MI_SOAPBOX_GLOBAL_NEWCOLUMN_NOTIFY, |
||||||
549 | 'caption' => _MI_SOAPBOX_GLOBAL_NEWCOLUMN_NOTIFYCAP, |
||||||
550 | 'description' => _MI_SOAPBOX_GLOBAL_NEWCOLUMN_NOTIFYDSC, |
||||||
551 | 'mail_template' => 'global_newcolumn_notify', |
||||||
552 | 'mail_subject' => _MI_SOAPBOX_GLOBAL_NEWCOLUMN_NOTIFYSBJ, |
||||||
553 | ]; |
||||||
554 | |||||||
555 | $modversion['notification']['event'][] = [ |
||||||
556 | 'name' => 'article_submit', |
||||||
557 | 'category' => 'global', |
||||||
558 | 'admin_only' => 1, |
||||||
559 | 'title' => _MI_SOAPBOX_GLOBAL_ARTICLESUBMIT_NOTIFY, |
||||||
560 | 'caption' => _MI_SOAPBOX_GLOBAL_ARTICLESUBMIT_NOTIFYCAP, |
||||||
561 | 'description' => _MI_SOAPBOX_GLOBAL_ARTICLESUBMIT_NOTIFYDSC, |
||||||
562 | 'mail_template' => 'global_articlesubmit_notify', |
||||||
563 | 'mail_subject' => _MI_SOAPBOX_GLOBAL_ARTICLESUBMIT_NOTIFYSBJ, |
||||||
564 | ]; |
||||||
565 | |||||||
566 | $modversion['notification']['event'][] = [ |
||||||
567 | 'name' => 'new_article', |
||||||
568 | 'category' => 'global', |
||||||
569 | 'title' => _MI_SOAPBOX_GLOBAL_NEWARTICLE_NOTIFY, |
||||||
570 | 'caption' => _MI_SOAPBOX_GLOBAL_NEWARTICLE_NOTIFYCAP, |
||||||
571 | 'description' => _MI_SOAPBOX_GLOBAL_NEWARTICLE_NOTIFYDSC, |
||||||
572 | 'mail_template' => 'global_newarticle_notify', |
||||||
573 | 'mail_subject' => _MI_SOAPBOX_GLOBAL_NEWARTICLE_NOTIFYSBJ, |
||||||
574 | ]; |
||||||
575 | |||||||
576 | $modversion['notification']['event'][] = [ |
||||||
577 | 'name' => 'article_submit', |
||||||
578 | 'category' => 'column', |
||||||
579 | 'admin_only' => 1, |
||||||
580 | 'title' => _MI_SOAPBOX_COLUMN_ARTICLESUBMIT_NOTIFY, |
||||||
581 | 'caption' => _MI_SOAPBOX_COLUMN_ARTICLESUBMIT_NOTIFYCAP, |
||||||
582 | 'description' => _MI_SOAPBOX_COLUMN_ARTICLESUBMIT_NOTIFYDSC, |
||||||
583 | 'mail_template' => 'column_articlesubmit_notify', |
||||||
584 | 'mail_subject' => _MI_SOAPBOX_COLUMN_ARTICLESUBMIT_NOTIFYSBJ, |
||||||
585 | ]; |
||||||
586 | |||||||
587 | $modversion['notification']['event'][] = [ |
||||||
588 | 'name' => 'new_article', |
||||||
589 | 'category' => 'column', |
||||||
590 | 'title' => _MI_SOAPBOX_COLUMN_NEWARTICLE_NOTIFY, |
||||||
591 | 'caption' => _MI_SOAPBOX_COLUMN_NEWARTICLE_NOTIFYCAP, |
||||||
592 | 'description' => _MI_SOAPBOX_COLUMN_NEWARTICLE_NOTIFYDSC, |
||||||
593 | 'mail_template' => 'column_newarticle_notify', |
||||||
594 | 'mail_subject' => _MI_SOAPBOX_COLUMN_NEWARTICLE_NOTIFYSBJ, |
||||||
595 | ]; |
||||||
596 | |||||||
597 | $modversion['notification']['event'][] = [ |
||||||
598 | 'name' => 'approve', |
||||||
599 | 'category' => 'article', |
||||||
600 | 'invisible' => 1, |
||||||
601 | 'title' => _MI_SOAPBOX_ARTICLE_APPROVE_NOTIFY, |
||||||
602 | 'caption' => _MI_SOAPBOX_ARTICLE_APPROVE_NOTIFYCAP, |
||||||
603 | 'description' => _MI_SOAPBOX_ARTICLE_APPROVE_NOTIFYDSC, |
||||||
604 | 'mail_template' => 'article_approve_notify', |
||||||
605 | 'mail_subject' => _MI_SOAPBOX_ARTICLE_APPROVE_NOTIFYSBJ, |
||||||
606 | ]; |
||||||
607 | |||||||
608 | // On Update |
||||||
609 | if (!empty($_POST['fct']) && !empty($_POST['op']) && !empty($_POST['diranme']) && 'modulesadmin' === $_POST['fct'] |
||||||
610 | && 'update_ok' === $_POST['op'] |
||||||
611 | && $_POST['dirname'] === $modversion['dirname']) { |
||||||
612 | require __DIR__ . '/include/onupdate.inc.php'; |
||||||
613 | } |
||||||
614 |