txmodxoops /
tdmcreate
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 | 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 2 module for xoops |
||
| 14 | * |
||
| 15 | * @copyright 2020 XOOPS Project (https://xooops.org) |
||
| 16 | * @license GPL 2.0 or later |
||
| 17 | * @package mymodule2 |
||
| 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_MYMODULE2_NAME, |
||
| 29 | 'version' => 1.0, |
||
| 30 | 'description' => _MI_MYMODULE2_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/mymodule2/docs/release_info file', |
||
| 41 | 'release_date' => '2020/04/16', |
||
| 42 | 'manual' => 'link to manual file', |
||
| 43 | 'manual_file' => XOOPS_URL . '/modules/mymodule2/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' => 'mymodule2_admin_about.tpl', 'description' => '', 'type' => 'admin'], |
||
| 76 | ['file' => 'mymodule2_admin_header.tpl', 'description' => '', 'type' => 'admin'], |
||
| 77 | ['file' => 'mymodule2_admin_index.tpl', 'description' => '', 'type' => 'admin'], |
||
| 78 | ['file' => 'mymodule2_admin_categories.tpl', 'description' => '', 'type' => 'admin'], |
||
| 79 | ['file' => 'mymodule2_admin_articles.tpl', 'description' => '', 'type' => 'admin'], |
||
| 80 | ['file' => 'mymodule2_admin_testfields.tpl', 'description' => '', 'type' => 'admin'], |
||
| 81 | ['file' => 'mymodule2_admin_permissions.tpl', 'description' => '', 'type' => 'admin'], |
||
| 82 | ['file' => 'mymodule2_admin_footer.tpl', 'description' => '', 'type' => 'admin'], |
||
| 83 | // User templates |
||
| 84 | ['file' => 'mymodule2_header.tpl', 'description' => ''], |
||
| 85 | ['file' => 'mymodule2_index.tpl', 'description' => ''], |
||
| 86 | ['file' => 'mymodule2_categories.tpl', 'description' => ''], |
||
| 87 | ['file' => 'mymodule2_categories_list.tpl', 'description' => ''], |
||
| 88 | ['file' => 'mymodule2_articles.tpl', 'description' => ''], |
||
| 89 | ['file' => 'mymodule2_articles_list.tpl', 'description' => ''], |
||
| 90 | ['file' => 'mymodule2_testfields.tpl', 'description' => ''], |
||
| 91 | ['file' => 'mymodule2_testfields_list.tpl', 'description' => ''], |
||
| 92 | ['file' => 'mymodule2_breadcrumbs.tpl', 'description' => ''], |
||
| 93 | ['file' => 'mymodule2_broken.tpl', 'description' => ''], |
||
| 94 | ['file' => 'mymodule2_pdf.tpl', 'description' => ''], |
||
| 95 | ['file' => 'mymodule2_print.tpl', 'description' => ''], |
||
| 96 | ['file' => 'mymodule2_rate.tpl', 'description' => ''], |
||
| 97 | ['file' => 'mymodule2_rss.tpl', 'description' => ''], |
||
| 98 | ['file' => 'mymodule2_search.tpl', 'description' => ''], |
||
| 99 | ['file' => 'mymodule2_single.tpl', 'description' => ''], |
||
| 100 | ['file' => 'mymodule2_submit.tpl', 'description' => ''], |
||
| 101 | ['file' => 'mymodule2_footer.tpl', 'description' => ''], |
||
| 102 | ]; |
||
| 103 | // ------------------- Mysql ------------------- // |
||
| 104 | $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
||
| 105 | // Tables |
||
| 106 | $modversion['tables'] = [ |
||
| 107 | 'mymodule2_categories', |
||
| 108 | 'mymodule2_articles', |
||
| 109 | 'mymodule2_testfields', |
||
| 110 | ]; |
||
| 111 | // ------------------- Search ------------------- // |
||
| 112 | $modversion['hasSearch'] = 1; |
||
| 113 | $modversion['search'] = [ |
||
| 114 | 'file' => 'include/search.inc.php', |
||
| 115 | 'func' => 'mymodule2_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' => 'mymodule2CommentsApprove', |
||
| 124 | 'update' => 'mymodule2CommentsUpdate', |
||
| 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_MYMODULE2_SMNAME1, |
||
| 131 | 'url' => 'index.php', |
||
| 132 | ]; |
||
| 133 | // Sub articles |
||
| 134 | $modversion['sub'][] = [ |
||
| 135 | 'name' => _MI_MYMODULE2_SMNAME2, |
||
| 136 | 'url' => 'articles.php', |
||
| 137 | ]; |
||
| 138 | // Sub testfields |
||
| 139 | $modversion['sub'][] = [ |
||
| 140 | 'name' => _MI_MYMODULE2_SMNAME3, |
||
| 141 | 'url' => 'testfields.php', |
||
| 142 | ]; |
||
| 143 | // Sub Submit |
||
| 144 | $modversion['sub'][] = [ |
||
| 145 | 'name' => _MI_MYMODULE2_SMNAME4, |
||
| 146 | 'url' => 'submit.php', |
||
| 147 | ]; |
||
| 148 | // Sub Search |
||
| 149 | $modversion['sub'][] = [ |
||
| 150 | 'name' => _MI_MYMODULE2_SMNAME5, |
||
| 151 | 'url' => 'search.php', |
||
| 152 | ]; |
||
| 153 | } |
||
| 154 | // ------------------- Blocks ------------------- // |
||
| 155 | // Articles last |
||
| 156 | $modversion['blocks'][] = [ |
||
| 157 | 'file' => 'articles.php', |
||
| 158 | 'name' => _MI_MYMODULE2_ARTICLES_BLOCK_LAST, |
||
| 159 | 'description' => _MI_MYMODULE2_ARTICLES_BLOCK_LAST_DESC, |
||
| 160 | 'show_func' => 'b_mymodule2_articles_show', |
||
| 161 | 'edit_func' => 'b_mymodule2_articles_edit', |
||
| 162 | 'template' => 'mymodule2_block_articles.tpl', |
||
| 163 | 'options' => 'last|5|25|0', |
||
| 164 | ]; |
||
| 165 | // Articles new |
||
| 166 | $modversion['blocks'][] = [ |
||
| 167 | 'file' => 'articles.php', |
||
| 168 | 'name' => _MI_MYMODULE2_ARTICLES_BLOCK_NEW, |
||
| 169 | 'description' => _MI_MYMODULE2_ARTICLES_BLOCK_NEW_DESC, |
||
| 170 | 'show_func' => 'b_mymodule2_articles_show', |
||
| 171 | 'edit_func' => 'b_mymodule2_articles_edit', |
||
| 172 | 'template' => 'mymodule2_block_articles.tpl', |
||
| 173 | 'options' => 'new|5|25|0', |
||
| 174 | ]; |
||
| 175 | // Articles hits |
||
| 176 | $modversion['blocks'][] = [ |
||
| 177 | 'file' => 'articles.php', |
||
| 178 | 'name' => _MI_MYMODULE2_ARTICLES_BLOCK_HITS, |
||
| 179 | 'description' => _MI_MYMODULE2_ARTICLES_BLOCK_HITS_DESC, |
||
| 180 | 'show_func' => 'b_mymodule2_articles_show', |
||
| 181 | 'edit_func' => 'b_mymodule2_articles_edit', |
||
| 182 | 'template' => 'mymodule2_block_articles.tpl', |
||
| 183 | 'options' => 'hits|5|25|0', |
||
| 184 | ]; |
||
| 185 | // Articles top |
||
| 186 | $modversion['blocks'][] = [ |
||
| 187 | 'file' => 'articles.php', |
||
| 188 | 'name' => _MI_MYMODULE2_ARTICLES_BLOCK_TOP, |
||
| 189 | 'description' => _MI_MYMODULE2_ARTICLES_BLOCK_TOP_DESC, |
||
| 190 | 'show_func' => 'b_mymodule2_articles_show', |
||
| 191 | 'edit_func' => 'b_mymodule2_articles_edit', |
||
| 192 | 'template' => 'mymodule2_block_articles.tpl', |
||
| 193 | 'options' => 'top|5|25|0', |
||
| 194 | ]; |
||
| 195 | // Articles random |
||
| 196 | $modversion['blocks'][] = [ |
||
| 197 | 'file' => 'articles.php', |
||
| 198 | 'name' => _MI_MYMODULE2_ARTICLES_BLOCK_RANDOM, |
||
| 199 | 'description' => _MI_MYMODULE2_ARTICLES_BLOCK_RANDOM_DESC, |
||
| 200 | 'show_func' => 'b_mymodule2_articles_show', |
||
| 201 | 'edit_func' => 'b_mymodule2_articles_edit', |
||
| 202 | 'template' => 'mymodule2_block_articles.tpl', |
||
| 203 | 'options' => 'random|5|25|0', |
||
| 204 | ]; |
||
| 205 | // Testfields last |
||
| 206 | $modversion['blocks'][] = [ |
||
| 207 | 'file' => 'testfields.php', |
||
| 208 | 'name' => _MI_MYMODULE2_TESTFIELDS_BLOCK_LAST, |
||
| 209 | 'description' => _MI_MYMODULE2_TESTFIELDS_BLOCK_LAST_DESC, |
||
| 210 | 'show_func' => 'b_mymodule2_testfields_show', |
||
| 211 | 'edit_func' => 'b_mymodule2_testfields_edit', |
||
| 212 | 'template' => 'mymodule2_block_testfields.tpl', |
||
| 213 | 'options' => 'last|5|25|0', |
||
| 214 | ]; |
||
| 215 | // Testfields new |
||
| 216 | $modversion['blocks'][] = [ |
||
| 217 | 'file' => 'testfields.php', |
||
| 218 | 'name' => _MI_MYMODULE2_TESTFIELDS_BLOCK_NEW, |
||
| 219 | 'description' => _MI_MYMODULE2_TESTFIELDS_BLOCK_NEW_DESC, |
||
| 220 | 'show_func' => 'b_mymodule2_testfields_show', |
||
| 221 | 'edit_func' => 'b_mymodule2_testfields_edit', |
||
| 222 | 'template' => 'mymodule2_block_testfields.tpl', |
||
| 223 | 'options' => 'new|5|25|0', |
||
| 224 | ]; |
||
| 225 | // Testfields hits |
||
| 226 | $modversion['blocks'][] = [ |
||
| 227 | 'file' => 'testfields.php', |
||
| 228 | 'name' => _MI_MYMODULE2_TESTFIELDS_BLOCK_HITS, |
||
| 229 | 'description' => _MI_MYMODULE2_TESTFIELDS_BLOCK_HITS_DESC, |
||
| 230 | 'show_func' => 'b_mymodule2_testfields_show', |
||
| 231 | 'edit_func' => 'b_mymodule2_testfields_edit', |
||
| 232 | 'template' => 'mymodule2_block_testfields.tpl', |
||
| 233 | 'options' => 'hits|5|25|0', |
||
| 234 | ]; |
||
| 235 | // Testfields top |
||
| 236 | $modversion['blocks'][] = [ |
||
| 237 | 'file' => 'testfields.php', |
||
| 238 | 'name' => _MI_MYMODULE2_TESTFIELDS_BLOCK_TOP, |
||
| 239 | 'description' => _MI_MYMODULE2_TESTFIELDS_BLOCK_TOP_DESC, |
||
| 240 | 'show_func' => 'b_mymodule2_testfields_show', |
||
| 241 | 'edit_func' => 'b_mymodule2_testfields_edit', |
||
| 242 | 'template' => 'mymodule2_block_testfields.tpl', |
||
| 243 | 'options' => 'top|5|25|0', |
||
| 244 | ]; |
||
| 245 | // Testfields random |
||
| 246 | $modversion['blocks'][] = [ |
||
| 247 | 'file' => 'testfields.php', |
||
| 248 | 'name' => _MI_MYMODULE2_TESTFIELDS_BLOCK_RANDOM, |
||
| 249 | 'description' => _MI_MYMODULE2_TESTFIELDS_BLOCK_RANDOM_DESC, |
||
| 250 | 'show_func' => 'b_mymodule2_testfields_show', |
||
| 251 | 'edit_func' => 'b_mymodule2_testfields_edit', |
||
| 252 | 'template' => 'mymodule2_block_testfields.tpl', |
||
| 253 | 'options' => 'random|5|25|0', |
||
| 254 | ]; |
||
| 255 | // ------------------- Config ------------------- // |
||
| 256 | // Editor descr |
||
| 257 | xoops_load('xoopseditorhandler'); |
||
| 258 | $editorHandlerDescr = XoopsEditorHandler::getInstance(); |
||
| 259 | $modversion['config'][] = [ |
||
| 260 | 'name' => 'editor_descr', |
||
| 261 | 'title' => '_MI_MYMODULE2_EDITOR_DESCR', |
||
| 262 | 'description' => '_MI_MYMODULE2_EDITOR_DESCR_DESC', |
||
| 263 | 'formtype' => 'select', |
||
| 264 | 'valuetype' => 'text', |
||
| 265 | 'default' => 'dhtml', |
||
| 266 | 'options' => array_flip($editorHandlerDescr->getList()), |
||
| 267 | ]; |
||
| 268 | // Editor textarea |
||
| 269 | xoops_load('xoopseditorhandler'); |
||
| 270 | $editorHandlerTextarea = XoopsEditorHandler::getInstance(); |
||
| 271 | $modversion['config'][] = [ |
||
| 272 | 'name' => 'editor_textarea', |
||
| 273 | 'title' => '_MI_MYMODULE2_EDITOR_TEXTAREA', |
||
| 274 | 'description' => '_MI_MYMODULE2_EDITOR_TEXTAREA_DESC', |
||
| 275 | 'formtype' => 'select', |
||
| 276 | 'valuetype' => 'text', |
||
| 277 | 'default' => 'dhtml', |
||
| 278 | 'options' => array_flip($editorHandlerTextarea->getList()), |
||
| 279 | ]; |
||
| 280 | // Editor dhtml |
||
| 281 | xoops_load('xoopseditorhandler'); |
||
| 282 | $editorHandlerDhtml = XoopsEditorHandler::getInstance(); |
||
| 283 | $modversion['config'][] = [ |
||
| 284 | 'name' => 'editor_dhtml', |
||
| 285 | 'title' => '_MI_MYMODULE2_EDITOR_DHTML', |
||
| 286 | 'description' => '_MI_MYMODULE2_EDITOR_DHTML_DESC', |
||
| 287 | 'formtype' => 'select', |
||
| 288 | 'valuetype' => 'text', |
||
| 289 | 'default' => 'dhtml', |
||
| 290 | 'options' => array_flip($editorHandlerDhtml->getList()), |
||
| 291 | ]; |
||
| 292 | // Get groups |
||
| 293 | $memberHandler = xoops_getHandler('member'); |
||
| 294 | $xoopsGroups = $memberHandler->getGroupList(); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 295 | foreach($xoopsGroups as $key => $group) { |
||
| 296 | $groups[$group] = $key; |
||
| 297 | } |
||
| 298 | // General access groups |
||
| 299 | $modversion['config'][] = [ |
||
| 300 | 'name' => 'groups', |
||
| 301 | 'title' => '_MI_MYMODULE2_GROUPS', |
||
| 302 | 'description' => '_MI_MYMODULE2_GROUPS_DESC', |
||
| 303 | 'formtype' => 'select_multi', |
||
| 304 | 'valuetype' => 'array', |
||
| 305 | 'default' => $groups, |
||
| 306 | 'options' => $groups, |
||
| 307 | ]; |
||
| 308 | // Upload groups |
||
| 309 | $modversion['config'][] = [ |
||
| 310 | 'name' => 'upload_groups', |
||
| 311 | 'title' => '_MI_MYMODULE2_UPLOAD_GROUPS', |
||
| 312 | 'description' => '_MI_MYMODULE2_UPLOAD_GROUPS_DESC', |
||
| 313 | 'formtype' => 'select_multi', |
||
| 314 | 'valuetype' => 'array', |
||
| 315 | 'default' => $groups, |
||
| 316 | 'options' => $groups, |
||
| 317 | ]; |
||
| 318 | // Get Admin groups |
||
| 319 | $criteria = new \CriteriaCompo(); |
||
| 320 | $criteria->add( new \Criteria( 'group_type', 'Admin' ) ); |
||
| 321 | $memberHandler = xoops_getHandler('member'); |
||
| 322 | $adminXoopsGroups = $memberHandler->getGroupList($criteria); |
||
| 323 | foreach($adminXoopsGroups as $key => $adminGroup) { |
||
| 324 | $adminGroups[$adminGroup] = $key; |
||
| 325 | } |
||
| 326 | $modversion['config'][] = [ |
||
| 327 | 'name' => 'admin_groups', |
||
| 328 | 'title' => '_MI_MYMODULE2_ADMIN_GROUPS', |
||
| 329 | 'description' => '_MI_MYMODULE2_ADMIN_GROUPS_DESC', |
||
| 330 | 'formtype' => 'select_multi', |
||
| 331 | 'valuetype' => 'array', |
||
| 332 | 'default' => $adminGroups, |
||
| 333 | 'options' => $adminGroups, |
||
| 334 | ]; |
||
| 335 | // Keywords |
||
| 336 | $modversion['config'][] = [ |
||
| 337 | 'name' => 'keywords', |
||
| 338 | 'title' => '_MI_MYMODULE2_KEYWORDS', |
||
| 339 | 'description' => '_MI_MYMODULE2_KEYWORDS_DESC', |
||
| 340 | 'formtype' => 'textbox', |
||
| 341 | 'valuetype' => 'text', |
||
| 342 | 'default' => 'mymodule2, categories, articles, testfields', |
||
| 343 | ]; |
||
| 344 | // create increment steps for file size |
||
| 345 | include_once __DIR__ . '/include/xoops_version.inc.php'; |
||
| 346 | $iniPostMaxSize = mymodule2ReturnBytes(ini_get('post_max_size')); |
||
| 347 | $iniUploadMaxFileSize = mymodule2ReturnBytes(ini_get('upload_max_filesize')); |
||
| 348 | $maxSize = min($iniPostMaxSize, $iniUploadMaxFileSize); |
||
| 349 | if ($maxSize > 10000 * 1048576) { |
||
| 350 | $increment = 500; |
||
| 351 | } |
||
| 352 | if ($maxSize <= 10000 * 1048576) { |
||
| 353 | $increment = 200; |
||
| 354 | } |
||
| 355 | if ($maxSize <= 5000 * 1048576) { |
||
| 356 | $increment = 100; |
||
| 357 | } |
||
| 358 | if ($maxSize <= 2500 * 1048576) { |
||
| 359 | $increment = 50; |
||
| 360 | } |
||
| 361 | if ($maxSize <= 1000 * 1048576) { |
||
| 362 | $increment = 10; |
||
| 363 | } |
||
| 364 | if ($maxSize <= 500 * 1048576) { |
||
| 365 | $increment = 5; |
||
| 366 | } |
||
| 367 | if ($maxSize <= 100 * 1048576) { |
||
| 368 | $increment = 2; |
||
| 369 | } |
||
| 370 | if ($maxSize <= 50 * 1048576) { |
||
| 371 | $increment = 1; |
||
| 372 | } |
||
| 373 | if ($maxSize <= 25 * 1048576) { |
||
| 374 | $increment = 0.5; |
||
| 375 | } |
||
| 376 | $optionMaxsize = []; |
||
| 377 | $i = $increment; |
||
| 378 | while ($i * 1048576 <= $maxSize) { |
||
| 379 | $optionMaxsize[$i . ' ' . _MI_MYMODULE2_SIZE_MB] = $i * 1048576; |
||
| 380 | $i += $increment; |
||
| 381 | } |
||
| 382 | // Uploads : maxsize of image |
||
| 383 | $modversion['config'][] = [ |
||
| 384 | 'name' => 'maxsize_image', |
||
| 385 | 'title' => '_MI_MYMODULE2_MAXSIZE_IMAGE', |
||
| 386 | 'description' => '_MI_MYMODULE2_MAXSIZE_IMAGE_DESC', |
||
| 387 | 'formtype' => 'select', |
||
| 388 | 'valuetype' => 'int', |
||
| 389 | 'default' => 3145728, |
||
| 390 | 'options' => $optionMaxsize, |
||
| 391 | ]; |
||
| 392 | // Uploads : mimetypes of image |
||
| 393 | $modversion['config'][] = [ |
||
| 394 | 'name' => 'mimetypes_image', |
||
| 395 | 'title' => '_MI_MYMODULE2_MIMETYPES_IMAGE', |
||
| 396 | 'description' => '_MI_MYMODULE2_MIMETYPES_IMAGE_DESC', |
||
| 397 | 'formtype' => 'select_multi', |
||
| 398 | 'valuetype' => 'array', |
||
| 399 | 'default' => ['image/gif', 'image/jpeg', 'image/png'], |
||
| 400 | 'options' => ['bmp' => 'image/bmp','gif' => 'image/gif','pjpeg' => 'image/pjpeg', 'jpeg' => 'image/jpeg','jpg' => 'image/jpg','jpe' => 'image/jpe', 'png' => 'image/png'], |
||
| 401 | ]; |
||
| 402 | $modversion['config'][] = [ |
||
| 403 | 'name' => 'maxwidth_image', |
||
| 404 | 'title' => '_MI_MYMODULE2_MAXWIDTH_IMAGE', |
||
| 405 | 'description' => '_MI_MYMODULE2_MAXWIDTH_IMAGE_DESC', |
||
| 406 | 'formtype' => 'textbox', |
||
| 407 | 'valuetype' => 'int', |
||
| 408 | 'default' => 8000, |
||
| 409 | ]; |
||
| 410 | $modversion['config'][] = [ |
||
| 411 | 'name' => 'maxheight_image', |
||
| 412 | 'title' => '_MI_MYMODULE2_MAXHEIGHT_IMAGE', |
||
| 413 | 'description' => '_MI_MYMODULE2_MAXHEIGHT_IMAGE_DESC', |
||
| 414 | 'formtype' => 'textbox', |
||
| 415 | 'valuetype' => 'int', |
||
| 416 | 'default' => 8000, |
||
| 417 | ]; |
||
| 418 | // Uploads : maxsize of file |
||
| 419 | $modversion['config'][] = [ |
||
| 420 | 'name' => 'maxsize_file', |
||
| 421 | 'title' => '_MI_MYMODULE2_MAXSIZE_FILE', |
||
| 422 | 'description' => '_MI_MYMODULE2_MAXSIZE_FILE_DESC', |
||
| 423 | 'formtype' => 'select', |
||
| 424 | 'valuetype' => 'int', |
||
| 425 | 'default' => 3145728, |
||
| 426 | 'options' => $optionMaxsize, |
||
| 427 | ]; |
||
| 428 | // Uploads : mimetypes of file |
||
| 429 | $modversion['config'][] = [ |
||
| 430 | 'name' => 'mimetypes_file', |
||
| 431 | 'title' => '_MI_MYMODULE2_MIMETYPES_FILE', |
||
| 432 | 'description' => '_MI_MYMODULE2_MIMETYPES_FILE_DESC', |
||
| 433 | 'formtype' => 'select_multi', |
||
| 434 | 'valuetype' => 'array', |
||
| 435 | 'default' => ['application/pdf', 'application/zip', 'text/comma-separated-values', 'text/plain', 'image/gif', 'image/jpeg', 'image/png'], |
||
| 436 | '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'], |
||
| 437 | ]; |
||
| 438 | // Admin pager |
||
| 439 | $modversion['config'][] = [ |
||
| 440 | 'name' => 'adminpager', |
||
| 441 | 'title' => '_MI_MYMODULE2_ADMIN_PAGER', |
||
| 442 | 'description' => '_MI_MYMODULE2_ADMIN_PAGER_DESC', |
||
| 443 | 'formtype' => 'textbox', |
||
| 444 | 'valuetype' => 'int', |
||
| 445 | 'default' => 10, |
||
| 446 | ]; |
||
| 447 | // User pager |
||
| 448 | $modversion['config'][] = [ |
||
| 449 | 'name' => 'userpager', |
||
| 450 | 'title' => '_MI_MYMODULE2_USER_PAGER', |
||
| 451 | 'description' => '_MI_MYMODULE2_USER_PAGER_DESC', |
||
| 452 | 'formtype' => 'textbox', |
||
| 453 | 'valuetype' => 'int', |
||
| 454 | 'default' => 10, |
||
| 455 | ]; |
||
| 456 | // Use tag |
||
| 457 | $modversion['config'][] = [ |
||
| 458 | 'name' => 'usetag', |
||
| 459 | 'title' => '_MI_MYMODULE2_USE_TAG', |
||
| 460 | 'description' => '_MI_MYMODULE2_USE_TAG_DESC', |
||
| 461 | 'formtype' => 'yesno', |
||
| 462 | 'valuetype' => 'int', |
||
| 463 | 'default' => 0, |
||
| 464 | ]; |
||
| 465 | // Number column |
||
| 466 | $modversion['config'][] = [ |
||
| 467 | 'name' => 'numb_col', |
||
| 468 | 'title' => '_MI_MYMODULE2_NUMB_COL', |
||
| 469 | 'description' => '_MI_MYMODULE2_NUMB_COL_DESC', |
||
| 470 | 'formtype' => 'select', |
||
| 471 | 'valuetype' => 'int', |
||
| 472 | 'default' => 1, |
||
| 473 | 'options' => [1 => '1', 2 => '2', 3 => '3', 4 => '4'], |
||
| 474 | ]; |
||
| 475 | // Divide by |
||
| 476 | $modversion['config'][] = [ |
||
| 477 | 'name' => 'divideby', |
||
| 478 | 'title' => '_MI_MYMODULE2_DIVIDEBY', |
||
| 479 | 'description' => '_MI_MYMODULE2_DIVIDEBY_DESC', |
||
| 480 | 'formtype' => 'select', |
||
| 481 | 'valuetype' => 'int', |
||
| 482 | 'default' => 1, |
||
| 483 | 'options' => [1 => '1', 2 => '2', 3 => '3', 4 => '4'], |
||
| 484 | ]; |
||
| 485 | // Table type |
||
| 486 | $modversion['config'][] = [ |
||
| 487 | 'name' => 'table_type', |
||
| 488 | 'title' => '_MI_MYMODULE2_TABLE_TYPE', |
||
| 489 | 'description' => '_MI_MYMODULE2_DIVIDEBY_DESC', |
||
| 490 | 'formtype' => 'select', |
||
| 491 | 'valuetype' => 'int', |
||
| 492 | 'default' => 'bordered', |
||
| 493 | 'options' => ['bordered' => 'bordered', 'striped' => 'striped', 'hover' => 'hover', 'condensed' => 'condensed'], |
||
| 494 | ]; |
||
| 495 | // Panel by |
||
| 496 | $modversion['config'][] = [ |
||
| 497 | 'name' => 'panel_type', |
||
| 498 | 'title' => '_MI_MYMODULE2_PANEL_TYPE', |
||
| 499 | 'description' => '_MI_MYMODULE2_PANEL_TYPE_DESC', |
||
| 500 | 'formtype' => 'select', |
||
| 501 | 'valuetype' => 'text', |
||
| 502 | 'default' => 'default', |
||
| 503 | 'options' => ['default' => 'default', 'primary' => 'primary', 'success' => 'success', 'info' => 'info', 'warning' => 'warning', 'danger' => 'danger'], |
||
| 504 | ]; |
||
| 505 | // Advertise |
||
| 506 | $modversion['config'][] = [ |
||
| 507 | 'name' => 'advertise', |
||
| 508 | 'title' => '_MI_MYMODULE2_ADVERTISE', |
||
| 509 | 'description' => '_MI_MYMODULE2_ADVERTISE_DESC', |
||
| 510 | 'formtype' => 'textarea', |
||
| 511 | 'valuetype' => 'text', |
||
| 512 | 'default' => '', |
||
| 513 | ]; |
||
| 514 | // Bookmarks |
||
| 515 | $modversion['config'][] = [ |
||
| 516 | 'name' => 'bookmarks', |
||
| 517 | 'title' => '_MI_MYMODULE2_BOOKMARKS', |
||
| 518 | 'description' => '_MI_MYMODULE2_BOOKMARKS_DESC', |
||
| 519 | 'formtype' => 'yesno', |
||
| 520 | 'valuetype' => 'int', |
||
| 521 | 'default' => 0, |
||
| 522 | ]; |
||
| 523 | // Make Sample button visible? |
||
| 524 | $modversion['config'][] = [ |
||
| 525 | 'name' => 'displaySampleButton', |
||
| 526 | 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
||
| 527 | 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
||
| 528 | 'formtype' => 'yesno', |
||
| 529 | 'valuetype' => 'int', |
||
| 530 | 'default' => 1, |
||
| 531 | ]; |
||
| 532 | // Maintained by |
||
| 533 | $modversion['config'][] = [ |
||
| 534 | 'name' => 'maintainedby', |
||
| 535 | 'title' => '_MI_MYMODULE2_MAINTAINEDBY', |
||
| 536 | 'description' => '_MI_MYMODULE2_MAINTAINEDBY_DESC', |
||
| 537 | 'formtype' => 'textbox', |
||
| 538 | 'valuetype' => 'text', |
||
| 539 | 'default' => 'https://xoops.org/modules/newbb', |
||
| 540 | ]; |
||
| 541 | // ------------------- Notifications ------------------- // |
||
| 542 | $modversion['hasNotification'] = 1; |
||
| 543 | $modversion['notification'] = [ |
||
| 544 | 'lookup_file' => 'include/notification.inc.php', |
||
| 545 | 'lookup_func' => 'mymodule2_notify_iteminfo', |
||
| 546 | ]; |
||
| 547 | // Global Notify |
||
| 548 | $modversion['notification']['category'][1] = [ |
||
| 549 | 'name' => 'global', |
||
| 550 | 'title' => _MI_MYMODULE2_GLOBAL_NOTIFY, |
||
| 551 | 'description' => _MI_MYMODULE2_GLOBAL_NOTIFY_DESC, |
||
| 552 | 'subscribe_from' => ['index.php', 'articles.php', 'testfields.php'], |
||
| 553 | ]; |
||
| 554 | // Category Notify |
||
| 555 | $modversion['notification']['category'][2] = [ |
||
| 556 | 'name' => 'category', |
||
| 557 | 'title' => _MI_MYMODULE2_CATEGORY_NOTIFY, |
||
| 558 | 'description' => _MI_MYMODULE2_CATEGORY_NOTIFY_DESC, |
||
| 559 | 'subscribe_from' => ['articles.php', 'testfields.php'], |
||
| 560 | 'item_name' => '', |
||
| 561 | 'allow_bookmark' => 1, |
||
| 562 | ]; |
||
| 563 | // Testfield Notify |
||
| 564 | $modversion['notification']['category'][3] = [ |
||
| 565 | 'name' => 'testfield', |
||
| 566 | 'title' => _MI_MYMODULE2_TESTFIELD_NOTIFY, |
||
| 567 | 'description' => _MI_MYMODULE2_TESTFIELD_NOTIFY_DESC, |
||
| 568 | 'subscribe_from' => 'testfields.php', |
||
| 569 | 'item_name' => 'tf_id', |
||
| 570 | 'allow_bookmark' => 1, |
||
| 571 | ]; |
||
| 572 | // GLOBAL_NEW_CATEGORY Notify |
||
| 573 | $modversion['notification']['event'][1] = [ |
||
| 574 | 'name' => 'new_category', |
||
| 575 | 'category' => 'global', |
||
| 576 | 'admin_only' => 0, |
||
| 577 | 'title' => _MI_MYMODULE2_GLOBAL_NEW_CATEGORY_NOTIFY, |
||
| 578 | 'caption' => _MI_MYMODULE2_GLOBAL_NEW_CATEGORY_NOTIFY_CAPTION, |
||
| 579 | 'description' => _MI_MYMODULE2_GLOBAL_NEW_CATEGORY_NOTIFY_DESC, |
||
| 580 | 'mail_template' => 'global_newcategory_notify', |
||
| 581 | 'mail_subject' => _MI_MYMODULE2_GLOBAL_NEW_CATEGORY_NOTIFY_SUBJECT, |
||
| 582 | ]; |
||
| 583 | // GLOBAL_MODIFY Notify |
||
| 584 | $modversion['notification']['event'][2] = [ |
||
| 585 | 'name' => 'modify', |
||
| 586 | 'category' => 'global', |
||
| 587 | 'admin_only' => 1, |
||
| 588 | 'title' => _MI_MYMODULE2_GLOBAL_MODIFY_NOTIFY, |
||
| 589 | 'caption' => _MI_MYMODULE2_GLOBAL_MODIFY_NOTIFY_CAPTION, |
||
| 590 | 'description' => _MI_MYMODULE2_GLOBAL_MODIFY_NOTIFY_DESC, |
||
| 591 | 'mail_template' => 'global_modify_notify', |
||
| 592 | 'mail_subject' => _MI_MYMODULE2_GLOBAL_MODIFY_NOTIFY_SUBJECT, |
||
| 593 | ]; |
||
| 594 | // GLOBAL_BROKEN Notify |
||
| 595 | $modversion['notification']['event'][3] = [ |
||
| 596 | 'name' => 'broken', |
||
| 597 | 'category' => 'global', |
||
| 598 | 'admin_only' => 1, |
||
| 599 | 'title' => _MI_MYMODULE2_GLOBAL_BROKEN_NOTIFY, |
||
| 600 | 'caption' => _MI_MYMODULE2_GLOBAL_BROKEN_NOTIFY_CAPTION, |
||
| 601 | 'description' => _MI_MYMODULE2_GLOBAL_BROKEN_NOTIFY_DESC, |
||
| 602 | 'mail_template' => 'global_broken_notify', |
||
| 603 | 'mail_subject' => _MI_MYMODULE2_GLOBAL_BROKEN_NOTIFY_SUBJECT, |
||
| 604 | ]; |
||
| 605 | // GLOBAL_SUBMIT Notify |
||
| 606 | $modversion['notification']['event'][4] = [ |
||
| 607 | 'name' => 'submit', |
||
| 608 | 'category' => 'global', |
||
| 609 | 'admin_only' => 1, |
||
| 610 | 'title' => _MI_MYMODULE2_GLOBAL_SUBMIT_NOTIFY, |
||
| 611 | 'caption' => _MI_MYMODULE2_GLOBAL_SUBMIT_NOTIFY_CAPTION, |
||
| 612 | 'description' => _MI_MYMODULE2_GLOBAL_SUBMIT_NOTIFY_DESC, |
||
| 613 | 'mail_template' => 'global_submit_notify', |
||
| 614 | 'mail_subject' => _MI_MYMODULE2_GLOBAL_SUBMIT_NOTIFY_SUBJECT, |
||
| 615 | ]; |
||
| 616 | // GLOBAL_NEW Notify |
||
| 617 | $modversion['notification']['event'][5] = [ |
||
| 618 | 'name' => 'new_testfield', |
||
| 619 | 'category' => 'global', |
||
| 620 | 'admin_only' => 0, |
||
| 621 | 'title' => _MI_MYMODULE2_GLOBAL_NEW_NOTIFY, |
||
| 622 | 'caption' => _MI_MYMODULE2_GLOBAL_NEW_NOTIFY_CAPTION, |
||
| 623 | 'description' => _MI_MYMODULE2_GLOBAL_NEW_NOTIFY_DESC, |
||
| 624 | 'mail_template' => 'global_newtestfield_notify', |
||
| 625 | 'mail_subject' => _MI_MYMODULE2_GLOBAL_NEW_NOTIFY_SUBJECT, |
||
| 626 | ]; |
||
| 627 | // CATEGORY_SUBMIT Notify |
||
| 628 | $modversion['notification']['event'][6] = [ |
||
| 629 | 'name' => 'submit', |
||
| 630 | 'category' => 'category', |
||
| 631 | 'admin_only' => 1, |
||
| 632 | 'title' => _MI_MYMODULE2_CATEGORY_SUBMIT_NOTIFY, |
||
| 633 | 'caption' => _MI_MYMODULE2_CATEGORY_SUBMIT_NOTIFY_CAPTION, |
||
| 634 | 'description' => _MI_MYMODULE2_CATEGORY_SUBMIT_NOTIFY_DESC, |
||
| 635 | 'mail_template' => 'category_testfieldsubmit_notify', |
||
| 636 | 'mail_subject' => _MI_MYMODULE2_CATEGORY_SUBMIT_NOTIFY_SUBJECT, |
||
| 637 | ]; |
||
| 638 | // CATEGORY Notify |
||
| 639 | $modversion['notification']['event'][7] = [ |
||
| 640 | 'name' => 'new_category', |
||
| 641 | 'category' => 'category', |
||
| 642 | 'admin_only' => 0, |
||
| 643 | 'title' => _MI_MYMODULE2_CATEGORY_NOTIFY, |
||
| 644 | 'caption' => _MI_MYMODULE2_CATEGORY_NOTIFY_CAPTION, |
||
| 645 | 'description' => _MI_MYMODULE2_CATEGORY_NOTIFY_DESC, |
||
| 646 | 'mail_template' => 'category_newtestfield_notify', |
||
| 647 | 'mail_subject' => _MI_MYMODULE2_CATEGORY_NOTIFY_SUBJECT, |
||
| 648 | ]; |
||
| 649 | // TESTFIELD Notify |
||
| 650 | $modversion['notification']['event'][8] = [ |
||
| 651 | 'name' => 'approve', |
||
| 652 | 'category' => 'testfield', |
||
| 653 | 'admin_only' => 1, |
||
| 654 | 'title' => _MI_MYMODULE2_TESTFIELD_NOTIFY, |
||
| 655 | 'caption' => _MI_MYMODULE2_TESTFIELD_NOTIFY_CAPTION, |
||
| 656 | 'description' => _MI_MYMODULE2_TESTFIELD_NOTIFY_DESC, |
||
| 657 | 'mail_template' => 'testfield_approve_notify', |
||
| 658 | 'mail_subject' => _MI_MYMODULE2_TESTFIELD_NOTIFY_SUBJECT, |
||
| 659 | ]; |
||
| 660 |