Issues (964)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

testdata/mymodule3/xoops_version.php (1 issue)

Labels
Severity
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * My Module 3 module for xoops
14
 *
15
 * @copyright     2020 XOOPS Project (https://xooops.org)
16
 * @license        GPL 2.0 or later
17
 * @package        mymodule3
18
 * @since          1.0
19
 * @min_xoops      2.5.9
20
 * @author         TDM XOOPS - Email:<[email protected]> - Website:<http://xoops.org>
21
 */
22
23
// 
24
$moduleDirName      = basename(__DIR__);
25
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
26
// ------------------- Informations ------------------- //
27
$modversion = [
28
	'name'                => _MI_MYMODULE3_NAME,
29
	'version'             => 1.0,
30
	'description'         => _MI_MYMODULE3_DESC,
31
	'author'              => 'TDM XOOPS',
32
	'author_mail'         => '[email protected]',
33
	'author_website_url'  => 'http://xoops.org',
34
	'author_website_name' => 'XOOPS Project',
35
	'credits'             => 'XOOPS Development Team',
36
	'license'             => 'GPL 2.0 or later',
37
	'license_url'         => 'http://www.gnu.org/licenses/gpl-3.0.en.html',
38
	'help'                => 'page=help',
39
	'release_info'        => 'release_info',
40
	'release_file'        => XOOPS_URL . '/modules/mymodule3/docs/release_info file',
41
	'release_date'        => '2020/04/28',
42
	'manual'              => 'link to manual file',
43
	'manual_file'         => XOOPS_URL . '/modules/mymodule3/docs/install.txt',
44
	'min_php'             => '7.0',
45
	'min_xoops'           => '2.5.9',
46
	'min_admin'           => '1.2',
47
	'min_db'              => array('mysql' => '5.6', 'mysqli' => '5.6'),
48
	'image'               => 'assets/images/logoModule.png',
49
	'dirname'             => basename(__DIR__),
50
	'dirmoduleadmin'      => 'Frameworks/moduleclasses/moduleadmin',
51
	'sysicons16'          => '../../Frameworks/moduleclasses/icons/16',
52
	'sysicons32'          => '../../Frameworks/moduleclasses/icons/32',
53
	'modicons16'          => 'assets/icons/16',
54
	'modicons32'          => 'assets/icons/32',
55
	'demo_site_url'       => 'https://xoops.org',
56
	'demo_site_name'      => 'XOOPS Demo Site',
57
	'support_url'         => 'https://xoops.org/modules/newbb',
58
	'support_name'        => 'Support Forum',
59
	'module_website_url'  => 'www.xoops.org',
60
	'module_website_name' => 'XOOPS Project',
61
	'release'             => '2017-12-02',
62
	'module_status'       => 'Beta 1',
63
	'system_menu'         => 1,
64
	'hasAdmin'            => 1,
65
	'hasMain'             => 1,
66
	'adminindex'          => 'admin/index.php',
67
	'adminmenu'           => 'admin/menu.php',
68
	'onInstall'           => 'include/install.php',
69
	'onUninstall'         => 'include/uninstall.php',
70
	'onUpdate'            => 'include/update.php',
71
];
72
// ------------------- Templates ------------------- //
73
$modversion['templates'] = [
74
	// Admin templates
75
	['file' => 'mymodule3_admin_about.tpl', 'description' => '', 'type' => 'admin'],
76
	['file' => 'mymodule3_admin_header.tpl', 'description' => '', 'type' => 'admin'],
77
	['file' => 'mymodule3_admin_index.tpl', 'description' => '', 'type' => 'admin'],
78
	['file' => 'mymodule3_admin_categories.tpl', 'description' => '', 'type' => 'admin'],
79
	['file' => 'mymodule3_admin_articles.tpl', 'description' => '', 'type' => 'admin'],
80
	['file' => 'mymodule3_admin_testfields.tpl', 'description' => '', 'type' => 'admin'],
81
	['file' => 'mymodule3_admin_permissions.tpl', 'description' => '', 'type' => 'admin'],
82
	['file' => 'mymodule3_admin_footer.tpl', 'description' => '', 'type' => 'admin'],
83
	// User templates
84
	['file' => 'mymodule3_header.tpl', 'description' => ''],
85
	['file' => 'mymodule3_index.tpl', 'description' => ''],
86
	['file' => 'mymodule3_categories.tpl', 'description' => ''],
87
	['file' => 'mymodule3_categories_list.tpl', 'description' => ''],
88
	['file' => 'mymodule3_articles.tpl', 'description' => ''],
89
	['file' => 'mymodule3_articles_list.tpl', 'description' => ''],
90
	['file' => 'mymodule3_testfields.tpl', 'description' => ''],
91
	['file' => 'mymodule3_testfields_list.tpl', 'description' => ''],
92
	['file' => 'mymodule3_breadcrumbs.tpl', 'description' => ''],
93
	['file' => 'mymodule3_broken.tpl', 'description' => ''],
94
	['file' => 'mymodule3_pdf.tpl', 'description' => ''],
95
	['file' => 'mymodule3_print.tpl', 'description' => ''],
96
	['file' => 'mymodule3_rate.tpl', 'description' => ''],
97
	['file' => 'mymodule3_rss.tpl', 'description' => ''],
98
	['file' => 'mymodule3_search.tpl', 'description' => ''],
99
	['file' => 'mymodule3_single.tpl', 'description' => ''],
100
	['file' => 'mymodule3_submit.tpl', 'description' => ''],
101
	['file' => 'mymodule3_footer.tpl', 'description' => ''],
102
];
103
// ------------------- Mysql ------------------- //
104
$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
105
// Tables
106
$modversion['tables'] = [
107
	'mymodule3_categories',
108
	'mymodule3_articles',
109
	'mymodule3_testfields',
110
];
111
// ------------------- Search ------------------- //
112
$modversion['hasSearch'] = 1;
113
$modversion['search'] = [
114
	'file' => 'include/search.inc.php',
115
	'func' => 'mymodule3_search',
116
];
117
// ------------------- Comments ------------------- //
118
$modversion['comments']['pageName'] = 'comments.php';
119
$modversion['comments']['itemName'] = 'com_id';
120
// Comment callback functions
121
$modversion['comments']['callbackFile'] = 'include/comment_functions.php';
122
$modversion['comments']['callback'] = [
123
	'approve' => 'mymodule3CommentsApprove',
124
	'update'  => 'mymodule3CommentsUpdate',
125
];
126
// ------------------- Menu ------------------- //
127
$currdirname  = isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system';
128
if ($moduleDirName == $currdirname) {
129
	$modversion['sub'][] = [
130
		'name' => _MI_MYMODULE3_SMNAME1,
131
		'url'  => 'index.php',
132
	];
133
	// Sub articles
134
	$modversion['sub'][] = [
135
		'name' => _MI_MYMODULE3_SMNAME2,
136
		'url'  => 'articles.php',
137
	];
138
	// Sub testfields
139
	$modversion['sub'][] = [
140
		'name' => _MI_MYMODULE3_SMNAME3,
141
		'url'  => 'testfields.php',
142
	];
143
	// Sub Submit
144
	$modversion['sub'][] = [
145
		'name' => _MI_MYMODULE3_SMNAME4,
146
		'url'  => 'submit.php',
147
	];
148
}
149
// ------------------- Blocks ------------------- //
150
// Articles last
151
$modversion['blocks'][] = [
152
	'file'        => 'articles.php',
153
	'name'        => _MI_MYMODULE3_ARTICLES_BLOCK_LAST,
154
	'description' => _MI_MYMODULE3_ARTICLES_BLOCK_LAST_DESC,
155
	'show_func'   => 'b_mymodule3_articles_show',
156
	'edit_func'   => 'b_mymodule3_articles_edit',
157
	'template'    => 'mymodule3_block_articles.tpl',
158
	'options'     => 'last|5|25|0',
159
];
160
// Articles new
161
$modversion['blocks'][] = [
162
	'file'        => 'articles.php',
163
	'name'        => _MI_MYMODULE3_ARTICLES_BLOCK_NEW,
164
	'description' => _MI_MYMODULE3_ARTICLES_BLOCK_NEW_DESC,
165
	'show_func'   => 'b_mymodule3_articles_show',
166
	'edit_func'   => 'b_mymodule3_articles_edit',
167
	'template'    => 'mymodule3_block_articles.tpl',
168
	'options'     => 'new|5|25|0',
169
];
170
// Articles hits
171
$modversion['blocks'][] = [
172
	'file'        => 'articles.php',
173
	'name'        => _MI_MYMODULE3_ARTICLES_BLOCK_HITS,
174
	'description' => _MI_MYMODULE3_ARTICLES_BLOCK_HITS_DESC,
175
	'show_func'   => 'b_mymodule3_articles_show',
176
	'edit_func'   => 'b_mymodule3_articles_edit',
177
	'template'    => 'mymodule3_block_articles.tpl',
178
	'options'     => 'hits|5|25|0',
179
];
180
// Articles top
181
$modversion['blocks'][] = [
182
	'file'        => 'articles.php',
183
	'name'        => _MI_MYMODULE3_ARTICLES_BLOCK_TOP,
184
	'description' => _MI_MYMODULE3_ARTICLES_BLOCK_TOP_DESC,
185
	'show_func'   => 'b_mymodule3_articles_show',
186
	'edit_func'   => 'b_mymodule3_articles_edit',
187
	'template'    => 'mymodule3_block_articles.tpl',
188
	'options'     => 'top|5|25|0',
189
];
190
// Articles random
191
$modversion['blocks'][] = [
192
	'file'        => 'articles.php',
193
	'name'        => _MI_MYMODULE3_ARTICLES_BLOCK_RANDOM,
194
	'description' => _MI_MYMODULE3_ARTICLES_BLOCK_RANDOM_DESC,
195
	'show_func'   => 'b_mymodule3_articles_show',
196
	'edit_func'   => 'b_mymodule3_articles_edit',
197
	'template'    => 'mymodule3_block_articles.tpl',
198
	'options'     => 'random|5|25|0',
199
];
200
// Testfields last
201
$modversion['blocks'][] = [
202
	'file'        => 'testfields.php',
203
	'name'        => _MI_MYMODULE3_TESTFIELDS_BLOCK_LAST,
204
	'description' => _MI_MYMODULE3_TESTFIELDS_BLOCK_LAST_DESC,
205
	'show_func'   => 'b_mymodule3_testfields_show',
206
	'edit_func'   => 'b_mymodule3_testfields_edit',
207
	'template'    => 'mymodule3_block_testfields.tpl',
208
	'options'     => 'last|5|25|0',
209
];
210
// Testfields new
211
$modversion['blocks'][] = [
212
	'file'        => 'testfields.php',
213
	'name'        => _MI_MYMODULE3_TESTFIELDS_BLOCK_NEW,
214
	'description' => _MI_MYMODULE3_TESTFIELDS_BLOCK_NEW_DESC,
215
	'show_func'   => 'b_mymodule3_testfields_show',
216
	'edit_func'   => 'b_mymodule3_testfields_edit',
217
	'template'    => 'mymodule3_block_testfields.tpl',
218
	'options'     => 'new|5|25|0',
219
];
220
// Testfields hits
221
$modversion['blocks'][] = [
222
	'file'        => 'testfields.php',
223
	'name'        => _MI_MYMODULE3_TESTFIELDS_BLOCK_HITS,
224
	'description' => _MI_MYMODULE3_TESTFIELDS_BLOCK_HITS_DESC,
225
	'show_func'   => 'b_mymodule3_testfields_show',
226
	'edit_func'   => 'b_mymodule3_testfields_edit',
227
	'template'    => 'mymodule3_block_testfields.tpl',
228
	'options'     => 'hits|5|25|0',
229
];
230
// Testfields top
231
$modversion['blocks'][] = [
232
	'file'        => 'testfields.php',
233
	'name'        => _MI_MYMODULE3_TESTFIELDS_BLOCK_TOP,
234
	'description' => _MI_MYMODULE3_TESTFIELDS_BLOCK_TOP_DESC,
235
	'show_func'   => 'b_mymodule3_testfields_show',
236
	'edit_func'   => 'b_mymodule3_testfields_edit',
237
	'template'    => 'mymodule3_block_testfields.tpl',
238
	'options'     => 'top|5|25|0',
239
];
240
// Testfields random
241
$modversion['blocks'][] = [
242
	'file'        => 'testfields.php',
243
	'name'        => _MI_MYMODULE3_TESTFIELDS_BLOCK_RANDOM,
244
	'description' => _MI_MYMODULE3_TESTFIELDS_BLOCK_RANDOM_DESC,
245
	'show_func'   => 'b_mymodule3_testfields_show',
246
	'edit_func'   => 'b_mymodule3_testfields_edit',
247
	'template'    => 'mymodule3_block_testfields.tpl',
248
	'options'     => 'random|5|25|0',
249
];
250
// ------------------- Config ------------------- //
251
// Editor descr
252
xoops_load('xoopseditorhandler');
253
$editorHandlerDescr = XoopsEditorHandler::getInstance();
254
$modversion['config'][] = [
255
	'name'        => 'editor_descr',
256
	'title'       => '_MI_MYMODULE3_EDITOR_DESCR',
257
	'description' => '_MI_MYMODULE3_EDITOR_DESCR_DESC',
258
	'formtype'    => 'select',
259
	'valuetype'   => 'text',
260
	'default'     => 'dhtml',
261
	'options'     => array_flip($editorHandlerDescr->getList()),
262
];
263
// Editor textarea
264
xoops_load('xoopseditorhandler');
265
$editorHandlerTextarea = XoopsEditorHandler::getInstance();
266
$modversion['config'][] = [
267
	'name'        => 'editor_textarea',
268
	'title'       => '_MI_MYMODULE3_EDITOR_TEXTAREA',
269
	'description' => '_MI_MYMODULE3_EDITOR_TEXTAREA_DESC',
270
	'formtype'    => 'select',
271
	'valuetype'   => 'text',
272
	'default'     => 'dhtml',
273
	'options'     => array_flip($editorHandlerTextarea->getList()),
274
];
275
// Editor dhtml
276
xoops_load('xoopseditorhandler');
277
$editorHandlerDhtml = XoopsEditorHandler::getInstance();
278
$modversion['config'][] = [
279
	'name'        => 'editor_dhtml',
280
	'title'       => '_MI_MYMODULE3_EDITOR_DHTML',
281
	'description' => '_MI_MYMODULE3_EDITOR_DHTML_DESC',
282
	'formtype'    => 'select',
283
	'valuetype'   => 'text',
284
	'default'     => 'dhtml',
285
	'options'     => array_flip($editorHandlerDhtml->getList()),
286
];
287
// Get groups
288
$memberHandler = xoops_getHandler('member');
289
$xoopsGroups  = $memberHandler->getGroupList();
0 ignored issues
show
The method getGroupList() 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 ignore-call  annotation

289
$xoopsGroups  = $memberHandler->/** @scrutinizer ignore-call */ getGroupList();
Loading history...
290
$groups = [];
291
foreach($xoopsGroups as $key => $group) {
292
	$groups[$group]  = $key;
293
}
294
// General access groups
295
$modversion['config'][] = [
296
	'name'        => 'groups',
297
	'title'       => '_MI_MYMODULE3_GROUPS',
298
	'description' => '_MI_MYMODULE3_GROUPS_DESC',
299
	'formtype'    => 'select_multi',
300
	'valuetype'   => 'array',
301
	'default'     => $groups,
302
	'options'     => $groups,
303
];
304
// Upload groups
305
$modversion['config'][] = [
306
	'name'        => 'upload_groups',
307
	'title'       => '_MI_MYMODULE3_UPLOAD_GROUPS',
308
	'description' => '_MI_MYMODULE3_UPLOAD_GROUPS_DESC',
309
	'formtype'    => 'select_multi',
310
	'valuetype'   => 'array',
311
	'default'     => $groups,
312
	'options'     => $groups,
313
];
314
// Get Admin groups
315
$criteria  = new \CriteriaCompo();
316
$criteria->add( new \Criteria( 'group_type', 'Admin' ) );
317
$memberHandler = xoops_getHandler('member');
318
$adminXoopsGroups  = $memberHandler->getGroupList($criteria);
319
$adminGroups = [];
320
foreach($adminXoopsGroups as $key => $adminGroup) {
321
	$adminGroups[$adminGroup]  = $key;
322
}
323
$modversion['config'][] = [
324
	'name'        => 'admin_groups',
325
	'title'       => '_MI_MYMODULE3_ADMIN_GROUPS',
326
	'description' => '_MI_MYMODULE3_ADMIN_GROUPS_DESC',
327
	'formtype'    => 'select_multi',
328
	'valuetype'   => 'array',
329
	'default'     => $adminGroups,
330
	'options'     => $adminGroups,
331
];
332
// Keywords
333
$modversion['config'][] = [
334
	'name'        => 'keywords',
335
	'title'       => '_MI_MYMODULE3_KEYWORDS',
336
	'description' => '_MI_MYMODULE3_KEYWORDS_DESC',
337
	'formtype'    => 'textbox',
338
	'valuetype'   => 'text',
339
	'default'     => 'mymodule3, categories, articles, testfields',
340
];
341
// create increment steps for file size
342
include_once __DIR__ . '/include/xoops_version.inc.php';
343
$iniPostMaxSize       = mymodule3ReturnBytes(ini_get('post_max_size'));
344
$iniUploadMaxFileSize = mymodule3ReturnBytes(ini_get('upload_max_filesize'));
345
$maxSize              = min($iniPostMaxSize, $iniUploadMaxFileSize);
346
if ($maxSize > 10000 * 1048576) {
347
	$increment = 500;
348
}
349
if ($maxSize <= 10000 * 1048576) {
350
	$increment = 200;
351
}
352
if ($maxSize <= 5000 * 1048576) {
353
	$increment = 100;
354
}
355
if ($maxSize <= 2500 * 1048576) {
356
	$increment = 50;
357
}
358
if ($maxSize <= 1000 * 1048576) {
359
	$increment = 10;
360
}
361
if ($maxSize <= 500 * 1048576) {
362
	$increment = 5;
363
}
364
if ($maxSize <= 100 * 1048576) {
365
	$increment = 2;
366
}
367
if ($maxSize <= 50 * 1048576) {
368
	$increment = 1;
369
}
370
if ($maxSize <= 25 * 1048576) {
371
	$increment = 0.5;
372
}
373
$optionMaxsize = [];
374
$i = $increment;
375
while ($i * 1048576  <=  $maxSize) {
376
	$optionMaxsize[$i . ' ' . _MI_MYMODULE3_SIZE_MB] = $i * 1048576;
377
	$i += $increment;
378
}
379
// Uploads : maxsize of image
380
$modversion['config'][] = [
381
	'name'        => 'maxsize_image',
382
	'title'       => '_MI_MYMODULE3_MAXSIZE_IMAGE',
383
	'description' => '_MI_MYMODULE3_MAXSIZE_IMAGE_DESC',
384
	'formtype'    => 'select',
385
	'valuetype'   => 'int',
386
	'default'     => 3145728,
387
	'options'     => $optionMaxsize,
388
];
389
// Uploads : mimetypes of image
390
$modversion['config'][] = [
391
	'name'        => 'mimetypes_image',
392
	'title'       => '_MI_MYMODULE3_MIMETYPES_IMAGE',
393
	'description' => '_MI_MYMODULE3_MIMETYPES_IMAGE_DESC',
394
	'formtype'    => 'select_multi',
395
	'valuetype'   => 'array',
396
	'default'     => ['image/gif', 'image/jpeg', 'image/png'],
397
	'options'     => ['bmp' => 'image/bmp','gif' => 'image/gif','pjpeg' => 'image/pjpeg', 'jpeg' => 'image/jpeg','jpg' => 'image/jpg','jpe' => 'image/jpe', 'png' => 'image/png'],
398
];
399
$modversion['config'][] = [
400
	'name'        => 'maxwidth_image',
401
	'title'       => '_MI_MYMODULE3_MAXWIDTH_IMAGE',
402
	'description' => '_MI_MYMODULE3_MAXWIDTH_IMAGE_DESC',
403
	'formtype'    => 'textbox',
404
	'valuetype'   => 'int',
405
	'default'     => 8000,
406
];
407
$modversion['config'][] = [
408
	'name'        => 'maxheight_image',
409
	'title'       => '_MI_MYMODULE3_MAXHEIGHT_IMAGE',
410
	'description' => '_MI_MYMODULE3_MAXHEIGHT_IMAGE_DESC',
411
	'formtype'    => 'textbox',
412
	'valuetype'   => 'int',
413
	'default'     => 8000,
414
];
415
// Uploads : maxsize of file
416
$modversion['config'][] = [
417
	'name'        => 'maxsize_file',
418
	'title'       => '_MI_MYMODULE3_MAXSIZE_FILE',
419
	'description' => '_MI_MYMODULE3_MAXSIZE_FILE_DESC',
420
	'formtype'    => 'select',
421
	'valuetype'   => 'int',
422
	'default'     => 3145728,
423
	'options'     => $optionMaxsize,
424
];
425
// Uploads : mimetypes of file
426
$modversion['config'][] = [
427
	'name'        => 'mimetypes_file',
428
	'title'       => '_MI_MYMODULE3_MIMETYPES_FILE',
429
	'description' => '_MI_MYMODULE3_MIMETYPES_FILE_DESC',
430
	'formtype'    => 'select_multi',
431
	'valuetype'   => 'array',
432
	'default'     => ['application/pdf', 'application/zip', 'text/comma-separated-values', 'text/plain', 'image/gif', 'image/jpeg', 'image/png'],
433
	'options'     => ['gif' => 'image/gif','pjpeg' => 'image/pjpeg', 'jpeg' => 'image/jpeg','jpg' => 'image/jpg','jpe' => 'image/jpe', 'png' => 'image/png', 'pdf' => 'application/pdf','zip' => 'application/zip','csv' => 'text/comma-separated-values', 'txt' => 'text/plain', 'xml' => 'application/xml', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
434
];
435
// Admin pager
436
$modversion['config'][] = [
437
	'name'        => 'adminpager',
438
	'title'       => '_MI_MYMODULE3_ADMIN_PAGER',
439
	'description' => '_MI_MYMODULE3_ADMIN_PAGER_DESC',
440
	'formtype'    => 'textbox',
441
	'valuetype'   => 'int',
442
	'default'     => 10,
443
];
444
// User pager
445
$modversion['config'][] = [
446
	'name'        => 'userpager',
447
	'title'       => '_MI_MYMODULE3_USER_PAGER',
448
	'description' => '_MI_MYMODULE3_USER_PAGER_DESC',
449
	'formtype'    => 'textbox',
450
	'valuetype'   => 'int',
451
	'default'     => 10,
452
];
453
// Use tag
454
$modversion['config'][] = [
455
	'name'        => 'usetag',
456
	'title'       => '_MI_MYMODULE3_USE_TAG',
457
	'description' => '_MI_MYMODULE3_USE_TAG_DESC',
458
	'formtype'    => 'yesno',
459
	'valuetype'   => 'int',
460
	'default'     => 0,
461
];
462
// Number column
463
$modversion['config'][] = [
464
	'name'        => 'numb_col',
465
	'title'       => '_MI_MYMODULE3_NUMB_COL',
466
	'description' => '_MI_MYMODULE3_NUMB_COL_DESC',
467
	'formtype'    => 'select',
468
	'valuetype'   => 'int',
469
	'default'     => 1,
470
	'options'     => [1 => '1', 2 => '2', 3 => '3', 4 => '4'],
471
];
472
// Divide by
473
$modversion['config'][] = [
474
	'name'        => 'divideby',
475
	'title'       => '_MI_MYMODULE3_DIVIDEBY',
476
	'description' => '_MI_MYMODULE3_DIVIDEBY_DESC',
477
	'formtype'    => 'select',
478
	'valuetype'   => 'int',
479
	'default'     => 1,
480
	'options'     => [1 => '1', 2 => '2', 3 => '3', 4 => '4'],
481
];
482
// Table type
483
$modversion['config'][] = [
484
	'name'        => 'table_type',
485
	'title'       => '_MI_MYMODULE3_TABLE_TYPE',
486
	'description' => '_MI_MYMODULE3_DIVIDEBY_DESC',
487
	'formtype'    => 'select',
488
	'valuetype'   => 'int',
489
	'default'     => 'bordered',
490
	'options'     => ['bordered' => 'bordered', 'striped' => 'striped', 'hover' => 'hover', 'condensed' => 'condensed'],
491
];
492
// Panel by
493
$modversion['config'][] = [
494
	'name'        => 'panel_type',
495
	'title'       => '_MI_MYMODULE3_PANEL_TYPE',
496
	'description' => '_MI_MYMODULE3_PANEL_TYPE_DESC',
497
	'formtype'    => 'select',
498
	'valuetype'   => 'text',
499
	'default'     => 'default',
500
	'options'     => ['default' => 'default', 'primary' => 'primary', 'success' => 'success', 'info' => 'info', 'warning' => 'warning', 'danger' => 'danger'],
501
];
502
// Advertise
503
$modversion['config'][] = [
504
	'name'        => 'advertise',
505
	'title'       => '_MI_MYMODULE3_ADVERTISE',
506
	'description' => '_MI_MYMODULE3_ADVERTISE_DESC',
507
	'formtype'    => 'textarea',
508
	'valuetype'   => 'text',
509
	'default'     => '',
510
];
511
// Bookmarks
512
$modversion['config'][] = [
513
	'name'        => 'bookmarks',
514
	'title'       => '_MI_MYMODULE3_BOOKMARKS',
515
	'description' => '_MI_MYMODULE3_BOOKMARKS_DESC',
516
	'formtype'    => 'yesno',
517
	'valuetype'   => 'int',
518
	'default'     => 0,
519
];
520
// Make Sample button visible?
521
$modversion['config'][] = [
522
	'name'        => 'displaySampleButton',
523
	'title'       => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON',
524
	'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC',
525
	'formtype'    => 'yesno',
526
	'valuetype'   => 'int',
527
	'default'     => 1,
528
];
529
// Maintained by
530
$modversion['config'][] = [
531
	'name'        => 'maintainedby',
532
	'title'       => '_MI_MYMODULE3_MAINTAINEDBY',
533
	'description' => '_MI_MYMODULE3_MAINTAINEDBY_DESC',
534
	'formtype'    => 'textbox',
535
	'valuetype'   => 'text',
536
	'default'     => 'https://xoops.org/modules/newbb',
537
];
538
// ------------------- Notifications ------------------- //
539
$modversion['hasNotification'] = 1;
540
$modversion['notification'] = [
541
	'lookup_file' => 'include/notification.inc.php',
542
	'lookup_func' => 'mymodule3_notify_iteminfo',
543
];
544
// Global Notify
545
$modversion['notification']['category'][1] = [
546
	'name'           => 'global',
547
	'title'          => _MI_MYMODULE3_GLOBAL_NOTIFY,
548
	'description'    => _MI_MYMODULE3_GLOBAL_NOTIFY_DESC,
549
	'subscribe_from' => ['index.php', 'articles.php', 'testfields.php'],
550
];
551
// Category Notify
552
$modversion['notification']['category'][2] = [
553
	'name'           => 'category',
554
	'title'          => _MI_MYMODULE3_CATEGORY_NOTIFY,
555
	'description'    => _MI_MYMODULE3_CATEGORY_NOTIFY_DESC,
556
	'subscribe_from' => ['articles.php', 'testfields.php'],
557
	'item_name'      => 'tf_combobox',
558
	'allow_bookmark' => 1,
559
];
560
// Testfield Notify
561
$modversion['notification']['category'][3] = [
562
	'name'           => 'testfield',
563
	'title'          => _MI_MYMODULE3_TESTFIELD_NOTIFY,
564
	'description'    => _MI_MYMODULE3_TESTFIELD_NOTIFY_DESC,
565
	'subscribe_from' => 'testfields.php',
566
	'item_name'      => 'tf_id',
567
	'allow_bookmark' => 1,
568
];
569
// GLOBAL_NEW_CATEGORY Notify
570
$modversion['notification']['event'][1] = [
571
	'name'          => 'new_category',
572
	'category'      => 'global',
573
	'admin_only'    => 0,
574
	'title'         => _MI_MYMODULE3_GLOBAL_NEW_CATEGORY_NOTIFY,
575
	'caption'       => _MI_MYMODULE3_GLOBAL_NEW_CATEGORY_NOTIFY_CAPTION,
576
	'description'   => _MI_MYMODULE3_GLOBAL_NEW_CATEGORY_NOTIFY_DESC,
577
	'mail_template' => 'global_newcategory_notify',
578
	'mail_subject'  => _MI_MYMODULE3_GLOBAL_NEW_CATEGORY_NOTIFY_SUBJECT,
579
];
580
// GLOBAL_MODIFY Notify
581
$modversion['notification']['event'][2] = [
582
	'name'          => 'modify',
583
	'category'      => 'global',
584
	'admin_only'    => 1,
585
	'title'         => _MI_MYMODULE3_GLOBAL_MODIFY_NOTIFY,
586
	'caption'       => _MI_MYMODULE3_GLOBAL_MODIFY_NOTIFY_CAPTION,
587
	'description'   => _MI_MYMODULE3_GLOBAL_MODIFY_NOTIFY_DESC,
588
	'mail_template' => 'global_modify_notify',
589
	'mail_subject'  => _MI_MYMODULE3_GLOBAL_MODIFY_NOTIFY_SUBJECT,
590
];
591
// GLOBAL_BROKEN Notify
592
$modversion['notification']['event'][3] = [
593
	'name'          => 'broken',
594
	'category'      => 'global',
595
	'admin_only'    => 1,
596
	'title'         => _MI_MYMODULE3_GLOBAL_BROKEN_NOTIFY,
597
	'caption'       => _MI_MYMODULE3_GLOBAL_BROKEN_NOTIFY_CAPTION,
598
	'description'   => _MI_MYMODULE3_GLOBAL_BROKEN_NOTIFY_DESC,
599
	'mail_template' => 'global_broken_notify',
600
	'mail_subject'  => _MI_MYMODULE3_GLOBAL_BROKEN_NOTIFY_SUBJECT,
601
];
602
// GLOBAL_SUBMIT Notify
603
$modversion['notification']['event'][4] = [
604
	'name'          => 'submit',
605
	'category'      => 'global',
606
	'admin_only'    => 1,
607
	'title'         => _MI_MYMODULE3_GLOBAL_SUBMIT_NOTIFY,
608
	'caption'       => _MI_MYMODULE3_GLOBAL_SUBMIT_NOTIFY_CAPTION,
609
	'description'   => _MI_MYMODULE3_GLOBAL_SUBMIT_NOTIFY_DESC,
610
	'mail_template' => 'global_submit_notify',
611
	'mail_subject'  => _MI_MYMODULE3_GLOBAL_SUBMIT_NOTIFY_SUBJECT,
612
];
613
// GLOBAL_NEW Notify
614
$modversion['notification']['event'][5] = [
615
	'name'          => 'new_testfield',
616
	'category'      => 'global',
617
	'admin_only'    => 0,
618
	'title'         => _MI_MYMODULE3_GLOBAL_NEW_NOTIFY,
619
	'caption'       => _MI_MYMODULE3_GLOBAL_NEW_NOTIFY_CAPTION,
620
	'description'   => _MI_MYMODULE3_GLOBAL_NEW_NOTIFY_DESC,
621
	'mail_template' => 'global_newtestfield_notify',
622
	'mail_subject'  => _MI_MYMODULE3_GLOBAL_NEW_NOTIFY_SUBJECT,
623
];
624
// CATEGORY_SUBMIT Notify
625
$modversion['notification']['event'][6] = [
626
	'name'          => 'submit',
627
	'category'      => 'category',
628
	'admin_only'    => 1,
629
	'title'         => _MI_MYMODULE3_CATEGORY_SUBMIT_NOTIFY,
630
	'caption'       => _MI_MYMODULE3_CATEGORY_SUBMIT_NOTIFY_CAPTION,
631
	'description'   => _MI_MYMODULE3_CATEGORY_SUBMIT_NOTIFY_DESC,
632
	'mail_template' => 'category_testfieldsubmit_notify',
633
	'mail_subject'  => _MI_MYMODULE3_CATEGORY_SUBMIT_NOTIFY_SUBJECT,
634
];
635
// CATEGORY Notify
636
$modversion['notification']['event'][7] = [
637
	'name'          => 'new_category',
638
	'category'      => 'category',
639
	'admin_only'    => 0,
640
	'title'         => _MI_MYMODULE3_CATEGORY_NOTIFY,
641
	'caption'       => _MI_MYMODULE3_CATEGORY_NOTIFY_CAPTION,
642
	'description'   => _MI_MYMODULE3_CATEGORY_NOTIFY_DESC,
643
	'mail_template' => 'category_newtestfield_notify',
644
	'mail_subject'  => _MI_MYMODULE3_CATEGORY_NOTIFY_SUBJECT,
645
];
646
// TESTFIELD Notify
647
$modversion['notification']['event'][8] = [
648
	'name'          => 'approve',
649
	'category'      => 'testfield',
650
	'admin_only'    => 1,
651
	'title'         => _MI_MYMODULE3_TESTFIELD_NOTIFY,
652
	'caption'       => _MI_MYMODULE3_TESTFIELD_NOTIFY_CAPTION,
653
	'description'   => _MI_MYMODULE3_TESTFIELD_NOTIFY_DESC,
654
	'mail_template' => 'testfield_approve_notify',
655
	'mail_subject'  => _MI_MYMODULE3_TESTFIELD_NOTIFY_SUBJECT,
656
];
657