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 | * wgSitenotice module for xoops |
||||||
13 | * |
||||||
14 | * @copyright XOOPS Project (https://xoops.org) |
||||||
15 | * @license GPL 2.0 or later |
||||||
16 | * @package wgsitenotice |
||||||
17 | * @since 1.0 |
||||||
18 | * @min_xoops 2.5.11 |
||||||
19 | * @author Goffy (xoops.wedega.com) - Email:<[email protected]> - Website:<https://xoops.wedega.com> |
||||||
20 | */ |
||||||
21 | \defined('XOOPS_ROOT_PATH') || exit('Restricted access'); |
||||||
22 | |||||||
23 | use XoopsModules\Wgsitenotice\Helper; |
||||||
24 | |||||||
25 | // |
||||||
26 | $dirname = \basename(__DIR__); |
||||||
27 | // ------------------- Informations ------------------- // |
||||||
28 | $modversion = [ |
||||||
29 | 'name' => \_MI_WGSITENOTICE_NAME, |
||||||
30 | 'version' => '1.4.2', |
||||||
31 | 'module_status' => 'Stable', |
||||||
32 | 'release' => '2025/06/07', |
||||||
33 | 'release_date' => '2025/06/07', // format: yyyy/mm/dd |
||||||
34 | 'description' => \_MI_WGSITENOTICE_DESC, |
||||||
35 | 'author' => 'Goffy (xoops.wedega.com)', |
||||||
36 | 'author_mail' => '[email protected]', |
||||||
37 | 'author_website_url' => 'https://xoops.wedega.com', |
||||||
38 | 'author_website_name' => 'WEDEGA Webdesign Gabor', |
||||||
39 | 'credits' => 'Goffy / xoops.wedega.com / XOOPS Development Team', |
||||||
40 | 'license' => 'GPL 2.0 or later', |
||||||
41 | 'help' => 'page=help', |
||||||
42 | 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
||||||
43 | 'release_info' => '', |
||||||
44 | 'release_file' => \XOOPS_URL."/modules/{$dirname}/docs/release_info file", |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
45 | 'manual' => 'link to manual file', |
||||||
46 | 'manual_file' => \XOOPS_URL."/modules/{$dirname}/docs/install.txt", |
||||||
47 | 'min_php' => '7.4', |
||||||
48 | 'min_xoops' => '2.5.11 Stable', |
||||||
49 | 'min_admin' => '1.1', |
||||||
50 | 'min_db' => ['mysql' => '5.0.7', 'mysqli' => '5.0.7'], |
||||||
51 | 'image' => 'assets/images/wgsitenotice_logo.png', |
||||||
52 | 'dirname' => "{$dirname}", |
||||||
53 | 'dirmoduleadmin' => 'Frameworks/moduleclasses/moduleadmin', |
||||||
54 | 'sysicons16' => '../../Frameworks/moduleclasses/icons/16', |
||||||
55 | 'sysicons32' => '../../Frameworks/moduleclasses/icons/32', |
||||||
56 | 'modicons16' => 'assets/icons/16', |
||||||
57 | 'modicons32' => 'assets/icons/32', |
||||||
58 | 'demo_site_url' => 'https://xoops.wedega.com', |
||||||
59 | 'demo_site_name' => 'Wedega Demo Site', |
||||||
60 | 'support_url' => 'http://', |
||||||
61 | 'support_name' => 'Support Forum', |
||||||
62 | 'module_website_url' => 'xoops.wedega.com', |
||||||
63 | 'module_website_name' => 'WEDEGA Webdesign Gabor (powered by XOOPS Project)', |
||||||
64 | 'system_menu' => 1, |
||||||
65 | 'hasAdmin' => 1, |
||||||
66 | 'adminindex' => 'admin/index.php', |
||||||
67 | 'adminmenu' => 'admin/menu.php', |
||||||
68 | 'hasMain' => 1, |
||||||
69 | 'onInstall' => 'include/install.php', |
||||||
70 | 'onUninstall' => 'include/uninstall.php', |
||||||
71 | 'onUpdate' => 'include/update.php' |
||||||
72 | ]; |
||||||
73 | // ------------------- Templates ------------------- // |
||||||
74 | // Admin |
||||||
75 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_about.tpl', 'description' => '', 'type' => 'admin']; |
||||||
76 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_header.tpl', 'description' => '', 'type' => 'admin']; |
||||||
77 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_index.tpl', 'description' => '', 'type' => 'admin']; |
||||||
78 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_versions.tpl', 'description' => '', 'type' => 'admin']; |
||||||
79 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_contents.tpl', 'description' => '', 'type' => 'admin']; |
||||||
80 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_checkonline.tpl', 'description' => '', 'type' => 'admin']; |
||||||
81 | $modversion['templates'][] = ['file' => 'wgsitenotice_admin_footer.tpl', 'description' => '', 'type' => 'admin']; |
||||||
82 | // User |
||||||
83 | $modversion['templates'][] = ['file' => 'wgsitenotice_header.tpl', 'description' => '']; |
||||||
84 | $modversion['templates'][] = ['file' => 'wgsitenotice_footer.tpl', 'description' => '']; |
||||||
85 | |||||||
86 | //if you create a new template in wgsitenotice/templates/user/ then add here the folder name and modversion['templates'] |
||||||
87 | $arr_templates = ['default' => 'default', 'table' => 'table-style', 'block' => 'block-style', 'xbootstrap' => 'xbootstrap']; |
||||||
88 | $modversion['config'][] = [ |
||||||
89 | 'name' => 'wgsitenotice_template', |
||||||
90 | 'title' => '_MI_WGSITENOTICE_TEMPLATE', |
||||||
91 | 'description' => '_MI_WGSITENOTICE_TEMPLATE_DESC', |
||||||
92 | 'formtype' => 'select', |
||||||
93 | 'valuetype' => 'text', |
||||||
94 | 'options' => \array_flip($arr_templates), |
||||||
95 | 'default' => 'default' |
||||||
96 | ]; |
||||||
97 | $modversion['templates'][] = ['file' => 'user/default/wgsitenotice_index_default.tpl', 'description' => '']; |
||||||
98 | $modversion['templates'][] = ['file' => 'user/table/wgsitenotice_index_table.tpl', 'description' => '']; |
||||||
99 | $modversion['templates'][] = ['file' => 'user/block/wgsitenotice_index_block.tpl', 'description' => '']; |
||||||
100 | $modversion['templates'][] = ['file' => 'user/xbootstrap/wgsitenotice_index_xbootstrap.tpl', 'description' => '']; |
||||||
101 | |||||||
102 | // ------------------- Mysql ------------------- // |
||||||
103 | $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
||||||
104 | // Tables |
||||||
105 | $modversion['tables'][1] = 'wgsitenotice_versions'; |
||||||
106 | $modversion['tables'][2] = 'wgsitenotice_contents'; |
||||||
107 | |||||||
108 | // Blocks |
||||||
109 | $modversion['blocks'][] = [ |
||||||
110 | 'file' => 'versions.php', |
||||||
111 | 'name' => \_MI_WGSITENOTICE_NAME, |
||||||
112 | 'description' => \_MI_WGSITENOTICE_B_ALL_VERSIONS, |
||||||
113 | 'show_func' => 'b_wgsitenotice_versions_show', |
||||||
114 | 'edit_func' => 'b_wgsitenotice_versions_edit', |
||||||
115 | 'template' => "{$dirname}_block_versions.tpl", |
||||||
116 | 'options' => '5|0', |
||||||
117 | ]; |
||||||
118 | $modversion['blocks'][] = [ |
||||||
119 | 'file' => 'cookie-reg.php', |
||||||
120 | 'name' => \_MI_WGSITENOTICE_COOKIE_REG, |
||||||
121 | 'description' => \_MI_WGSITENOTICE_COOKIE_REG_DESC, |
||||||
122 | 'show_func' => 'b_wgsitenotice_cookie_reg_show', |
||||||
123 | 'edit_func' => 'b_wgsitenotice_cookie_reg_edit', |
||||||
124 | 'template' => "{$dirname}_block_cookie_reg.tpl", |
||||||
125 | 'options' => 'cookiesregmarker_' . \md5(\mt_rand()) . '|no-data|no-cookiereg|smarty|0.9|#d6e0eb|#f2f6f9|#000000|30|top|cookiesregsmarty_' . \md5(\mt_rand()), |
||||||
126 | ]; |
||||||
127 | // ------------------- Config ------------------- // |
||||||
128 | // Editor |
||||||
129 | \xoops_load('xoopseditorhandler'); |
||||||
0 ignored issues
–
show
The function
xoops_load was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
130 | $editorHandler = XoopsEditorHandler::getInstance(); |
||||||
0 ignored issues
–
show
The type
XoopsEditorHandler was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
131 | $modversion['config'][] = [ |
||||||
132 | 'name' => 'wgsitenotice_editor', |
||||||
133 | 'title' => '_MI_WGSITENOTICE_EDITOR', |
||||||
134 | 'description' => '_MI_WGSITENOTICE_EDITOR_DESC', |
||||||
135 | 'formtype' => 'select', |
||||||
136 | 'valuetype' => 'text', |
||||||
137 | 'options' => \array_flip($editorHandler->getList()), |
||||||
138 | 'default' => 'dhtmltextarea' |
||||||
139 | ]; |
||||||
140 | |||||||
141 | $modversion['config'][] = [ |
||||||
142 | 'name' => 'wgsitenotice_oc_server', |
||||||
143 | 'title' => '_MI_WGSITENOTICE_OC_SERVER', |
||||||
144 | 'description' => '_MI_WGSITENOTICE_OC_SERVER_DESC', |
||||||
145 | 'formtype' => 'textbox', |
||||||
146 | 'valuetype' => 'text', |
||||||
147 | 'default' => 'https://xoops.wedega.com/modules/wgsitenotice/' |
||||||
148 | ]; |
||||||
149 | |||||||
150 | $modversion['config'][] = [ |
||||||
151 | 'name' => 'wgsitenotice_oc_allowed', |
||||||
152 | 'title' => '_MI_WGSITENOTICE_OC_ALLOWED', |
||||||
153 | 'description' => '_MI_WGSITENOTICE_OC_ALLOWED_DESC', |
||||||
154 | 'formtype' => 'yesno', |
||||||
155 | 'valuetype' => 'int', |
||||||
156 | 'default' => 0 |
||||||
157 | ]; |
||||||
158 | |||||||
159 | $modversion['config'][] = [ |
||||||
160 | 'name' => 'keywords', |
||||||
161 | 'title' => '_MI_WGSITENOTICE_KEYWORDS', |
||||||
162 | 'description' => '_MI_WGSITENOTICE_KEYWORDS_DESC', |
||||||
163 | 'formtype' => 'textbox', |
||||||
164 | 'valuetype' => 'text', |
||||||
165 | 'default' => 'wgsitenotice, versions, contents, checkonline' |
||||||
166 | ]; |
||||||
167 | |||||||
168 | $modversion['config'][] = [ |
||||||
169 | 'name' => 'adminpager', |
||||||
170 | 'title' => '_MI_WGSITENOTICE_ADMINPAGER', |
||||||
171 | 'description' => '_MI_WGSITENOTICE_ADMINPAGER_DESC', |
||||||
172 | 'formtype' => 'textbox', |
||||||
173 | 'valuetype' => 'int', |
||||||
174 | 'default' => 10 |
||||||
175 | ]; |
||||||
176 | |||||||
177 | // Show copyright |
||||||
178 | $modversion['config'][] = [ |
||||||
179 | 'name' => 'show_copyright', |
||||||
180 | 'title' => '_MI_WGSITENOTICE_SHOWCOPYRIGHT', |
||||||
181 | 'description' => '_MI_WGSITENOTICE_SHOWCOPYRIGHT_DESC', |
||||||
182 | 'formtype' => 'yesno', |
||||||
183 | 'valuetype' => 'int', |
||||||
184 | 'default' => 1, |
||||||
185 | ]; |
||||||
186 | |||||||
187 | $currdirname = isset($GLOBALS['xoopsModule'])&& \is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system'; |
||||||
188 | if ($dirname == $currdirname) { |
||||||
189 | $submenu = new \XoopsModules\Wgsitenotice\Modulemenu; |
||||||
190 | $menuItems = $submenu->getMenuitemsDefault(); |
||||||
191 | foreach ($menuItems as $key => $menuItem) { |
||||||
192 | $modversion['sub'][$key]['name'] = $menuItem['name']; |
||||||
193 | $modversion['sub'][$key]['url'] = $menuItem['url']; |
||||||
194 | } |
||||||
195 | } |
||||||
196 |