-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathxoops_version.php
More file actions
203 lines (178 loc) · 6.66 KB
/
xoops_version.php
File metadata and controls
203 lines (178 loc) · 6.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?php declare(strict_types=1);
/*
You may not change or alter any portion of this comment or credits of
supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit
authors.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* Module: XoopsFaq
*
* Module Configuration file
*
* @author John Neill
* @author XOOPS Module Development Team
* @copyright https://xoops.org 2001-2017 © XOOPS Project
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU Public License
*/
defined('XOOPS_ROOT_PATH') || exit('Restricted access');
require_once __DIR__ . '/preloads/autoloader.php';
$moduleDirName = basename(__DIR__);
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
// Module configs
$modversion = [
'version' => '2.1.0',
'module_status' => 'beta.1',
'release_date' => '2023/05/25',
'name' => _MI_XOOPSFAQ_NAME,
'description' => _MI_XOOPSFAQ_DESC,
'author' => 'John Neill, Kazumi Ono',
'credits' => 'The Xoops Module Development Team, ZySpec, Mamba, Geekwright',
'license' => 'GNU GPL 2.0',
'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/',
'official' => 0,
'image' => 'assets/images/logoModule.png',
'dirname' => basename(__DIR__),
// Local path icons
'modicons16' => 'assets/images/icons/16',
'modicons32' => 'assets/images/icons/32',
//about
'author_website_url' => 'https://xoops.org',
'author_website_name' => 'XOOPS',
'module_website_url' => 'https://xoops.org',
'module_website_name' => 'XOOPS',
'min_php' => '7.4',
'min_xoops' => '2.5.10',
'min_db' => ['mysql' => '5.5'],
'min_admin' => '1.2',
];
// ------------------- Help files ------------------- //
$modversion['help'] = 'page=help';
$modversion['helpsection'] = [
['name' => _MI_XOOPSFAQ_HELP_OVERVIEW, 'link' => 'page=help'],
['name' => _MI_XOOPSFAQ_HELP_TIPS, 'link' => 'page=tips'],
['name' => _MI_XOOPSFAQ_DISCLAIMER, 'link' => 'page=disclaimer'],
['name' => _MI_XOOPSFAQ_LICENSE, 'link' => 'page=license'],
['name' => _MI_XOOPSFAQ_SUPPORT, 'link' => 'page=support'],
];
// ------------------- Mysql -----------------------------
$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
// ------------------- Tables ----------------------------
$modversion['tables'] = [
'xoopsfaq_contents',
'xoopsfaq_categories',
];
// ------------------- Install/Update -------------------
// Scripts to run upon installation or update
$modversion['onInstall'] = 'include/oninstall.php';
$modversion['onUpdate'] = 'include/onupdate.php';
// Module Admin
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = 'admin/index.php';
$modversion['adminmenu'] = 'admin/menu.php';
/*
* Admin Menu
* Set to:
* 0 if you do not want to display menu generated by system module
* 1 if you want to display menu generated by system module
*/
$modversion['system_menu'] = 1;
// Module Main
$modversion['hasMain'] = 1;
// ------------------- Blocks ------------------- //
$modversion['blocks'] = [
[
'file' => 'xoopsfaq_rand.php',
'name' => _MI_XOOPSFAQ_BNAME1,
'description' => _MI_XOOPSFAQ_BNAME1_DESC,
'show_func' => 'b_xoopsfaq_random_show',
'edit_func' => 'b_xoopsfaq_rand_edit',
'options' => '100|0',
'template' => 'xoopsfaq_block_rand.tpl',
],
[
'file' => 'xoopsfaq_recent.php',
'name' => _MI_XOOPSFAQ_BNAME2,
'description' => _MI_XOOPSFAQ_BNAME2_DESC,
'show_func' => 'b_xoopsfaq_recent_show',
'edit_func' => 'b_xoopsfaq_recent_edit',
'options' => '10|100|1|0',
'template' => 'xoopsfaq_block_recent.tpl',
],
[
'file' => 'xoopsfaq_category.php',
'name' => _MI_XOOPSFAQ_BNAME3,
'description' => _MI_XOOPSFAQ_BNAME3_DESC,
'show_func' => 'b_xoopsfaq_category_show',
'edit_func' => 'b_xoopsfaq_category_edit',
'options' => '1',
'template' => 'xoopsfaq_block_category.tpl',
],
];
// Module Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = 'include/search.inc.php';
$modversion['search']['func'] = 'xoopsfaq_search';
// Module Templates
$modversion['templates'] = [
[
'file' => "{$moduleDirName}_index.tpl",
'description' => _MI_XOOPSFAQ_TPL_INDEX_DESC,
],
[
'file' => "{$moduleDirName}_category.tpl",
'description' => _MI_XOOPSFAQ_TPL_CATEGORY_DESC,
],
];
// Module Comments
$modversion['hasComments'] = 1;
$modversion['comments'] = [
'itemName' => 'cat_id',
'pageName' => 'index.php',
];
// Module Configs
xoops_load('XoopsEditorHandler');
$editorHandler = XoopsEditorHandler::getInstance();
$editorList = array_flip($editorHandler->getList());
$modversion['config'][] = [
'name' => 'use_wysiwyg',
'title' => '_MI_XOOPSFAQ_EDITORS',
'description' => '_MI_XOOPSFAQ_EDITORS_DESC',
'formtype' => 'select',
'valuetype' => 'text',
'options' => $editorList,
'default' => 'dhtmltextarea',
];
$modversion['config'][] = [
'name' => 'generate_jsonld',
'title' => 'CO_' . $moduleDirNameUpper . '_' . 'GENERATE_JSONLD',
'description' => 'CO_' . $moduleDirNameUpper . '_' . 'GENERATE_JSONLD_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Make Sample button visible?
*/
$modversion['config'][] = [
'name' => 'displaySampleButton',
'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON',
'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Show Developer Tools?
*/
$modversion['config'][] = [
'name' => 'displayDeveloperTools',
'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS',
'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];