ggoffy /
wggithub
| 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 | * wgGitHub module for xoops |
||||||
| 14 | * |
||||||
| 15 | * @copyright 2020 XOOPS Project (https://xooops.org) |
||||||
| 16 | * @license GPL 2.0 or later |
||||||
| 17 | * @package wggithub |
||||||
| 18 | * @since 1.0 |
||||||
| 19 | * @min_xoops 2.5.10 |
||||||
| 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
||||||
| 21 | */ |
||||||
| 22 | |||||||
| 23 | use XoopsModules\Wggithub\Constants; |
||||||
| 24 | |||||||
| 25 | $moduleDirName = \basename(__DIR__); |
||||||
| 26 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
||||||
| 27 | // ------------------- Informations ------------------- // |
||||||
| 28 | $modversion = [ |
||||||
| 29 | 'name' => \_MI_WGGITHUB_NAME, |
||||||
| 30 | 'version' => '1.5.2', |
||||||
| 31 | 'module_status' => 'RC1', |
||||||
| 32 | 'description' => \_MI_WGGITHUB_DESC, |
||||||
| 33 | 'author' => 'Goffy - XOOPS Development Team', |
||||||
| 34 | 'author_mail' => '[email protected]', |
||||||
| 35 | 'author_website_url' => 'https://wedega.com', |
||||||
| 36 | 'author_website_name' => 'XOOPS on Wedega', |
||||||
| 37 | 'credits' => 'Goffy - XOOPS Development Team', |
||||||
| 38 | 'license' => 'GPL 2.0 or later', |
||||||
| 39 | 'license_url' => 'http://www.gnu.org/licenses/gpl-3.0.en.html', |
||||||
| 40 | 'help' => 'page=help', |
||||||
| 41 | 'release_info' => 'release_info', |
||||||
| 42 | 'release_file' => \XOOPS_URL . '/modules/wggithub/docs/release_info file', |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 43 | 'release_date' => '2022/08/08', |
||||||
| 44 | 'manual' => 'link to manual file', |
||||||
| 45 | 'manual_file' => \XOOPS_URL . '/modules/wggithub/docs/install.txt', |
||||||
| 46 | 'min_php' => '7.4', |
||||||
| 47 | 'min_xoops' => '2.5.11 Stable', |
||||||
| 48 | 'min_admin' => '1.2', |
||||||
| 49 | 'min_db' => ['mysql' => '5.5', 'mysqli' => '5.6'], |
||||||
| 50 | 'image' => 'assets/images/logoModule.png', |
||||||
| 51 | 'dirname' => \basename(__DIR__), |
||||||
| 52 | 'dirmoduleadmin' => 'Frameworks/moduleclasses/moduleadmin', |
||||||
| 53 | 'sysicons16' => '../../Frameworks/moduleclasses/icons/16', |
||||||
| 54 | 'sysicons32' => '../../Frameworks/moduleclasses/icons/32', |
||||||
| 55 | 'modicons16' => 'assets/icons/16', |
||||||
| 56 | 'modicons32' => 'assets/icons/32', |
||||||
| 57 | 'demo_site_url' => 'https://xoops.org', |
||||||
| 58 | 'demo_site_name' => 'XOOPS Demo Site', |
||||||
| 59 | 'support_url' => 'https://xoops.org/modules/newbb', |
||||||
| 60 | 'support_name' => 'Support Forum', |
||||||
| 61 | 'module_website_url' => 'www.xoops.org', |
||||||
| 62 | 'module_website_name' => 'XOOPS Project', |
||||||
| 63 | 'release' => '2023-03-20', |
||||||
| 64 | 'system_menu' => 1, |
||||||
| 65 | 'hasAdmin' => 1, |
||||||
| 66 | 'hasMain' => 1, |
||||||
| 67 | 'adminindex' => 'admin/index.php', |
||||||
| 68 | 'adminmenu' => 'admin/menu.php', |
||||||
| 69 | 'onInstall' => 'include/install.php', |
||||||
| 70 | 'onUninstall' => 'include/uninstall.php', |
||||||
| 71 | 'onUpdate' => 'include/update.php', |
||||||
| 72 | ]; |
||||||
| 73 | // ------------------- Templates ------------------- // |
||||||
| 74 | $modversion['templates'] = [ |
||||||
| 75 | // Admin templates |
||||||
| 76 | ['file' => 'wggithub_admin_about.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 77 | ['file' => 'wggithub_admin_header.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 78 | ['file' => 'wggithub_admin_index.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 79 | ['file' => 'wggithub_admin_settings.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 80 | ['file' => 'wggithub_admin_repositories.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 81 | ['file' => 'wggithub_admin_directories.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 82 | ['file' => 'wggithub_admin_logs.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 83 | ['file' => 'wggithub_admin_readmes.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 84 | ['file' => 'wggithub_admin_releases.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 85 | ['file' => 'wggithub_admin_permissions.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 86 | ['file' => 'wggithub_admin_footer.tpl', 'description' => '', 'type' => 'admin'], |
||||||
| 87 | // User templates |
||||||
| 88 | ['file' => 'wggithub_header.tpl', 'description' => ''], |
||||||
| 89 | ['file' => 'wggithub_index.tpl', 'description' => ''], |
||||||
| 90 | ['file' => 'wggithub_breadcrumbs.tpl', 'description' => ''], |
||||||
| 91 | ['file' => 'wggithub_footer.tpl', 'description' => ''], |
||||||
| 92 | ]; |
||||||
| 93 | // ------------------- Mysql ------------------- // |
||||||
| 94 | $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
||||||
| 95 | // Tables |
||||||
| 96 | $modversion['tables'] = [ |
||||||
| 97 | 'wggithub_settings', |
||||||
| 98 | 'wggithub_repositories', |
||||||
| 99 | 'wggithub_directories', |
||||||
| 100 | 'wggithub_logs', |
||||||
| 101 | 'wggithub_readmes', |
||||||
| 102 | 'wggithub_releases', |
||||||
| 103 | ]; |
||||||
| 104 | // ------------------- Search ------------------- // |
||||||
| 105 | $modversion['hasSearch'] = 1; |
||||||
| 106 | $modversion['search'] = [ |
||||||
| 107 | 'file' => 'include/search.inc.php', |
||||||
| 108 | 'func' => 'wggithub_search', |
||||||
| 109 | ]; |
||||||
| 110 | // ------------------- Blocks ------------------- // |
||||||
| 111 | // Repositories last |
||||||
| 112 | $modversion['blocks'][] = [ |
||||||
| 113 | 'file' => 'repositories.php', |
||||||
| 114 | 'name' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_LAST, |
||||||
| 115 | 'description' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_LAST_DESC, |
||||||
| 116 | 'show_func' => 'b_wggithub_repositories_show', |
||||||
| 117 | 'edit_func' => 'b_wggithub_repositories_edit', |
||||||
| 118 | 'template' => 'wggithub_block_repositories.tpl', |
||||||
| 119 | 'options' => 'last|5|25|0', |
||||||
| 120 | ]; |
||||||
| 121 | // Repositories new |
||||||
| 122 | $modversion['blocks'][] = [ |
||||||
| 123 | 'file' => 'repositories.php', |
||||||
| 124 | 'name' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_NEW, |
||||||
| 125 | 'description' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_NEW_DESC, |
||||||
| 126 | 'show_func' => 'b_wggithub_repositories_show', |
||||||
| 127 | 'edit_func' => 'b_wggithub_repositories_edit', |
||||||
| 128 | 'template' => 'wggithub_block_repositories.tpl', |
||||||
| 129 | 'options' => 'new|5|25|0', |
||||||
| 130 | ]; |
||||||
| 131 | // Repositories hits |
||||||
| 132 | $modversion['blocks'][] = [ |
||||||
| 133 | 'file' => 'repositories.php', |
||||||
| 134 | 'name' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_HITS, |
||||||
| 135 | 'description' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_HITS_DESC, |
||||||
| 136 | 'show_func' => 'b_wggithub_repositories_show', |
||||||
| 137 | 'edit_func' => 'b_wggithub_repositories_edit', |
||||||
| 138 | 'template' => 'wggithub_block_repositories.tpl', |
||||||
| 139 | 'options' => 'hits|5|25|0', |
||||||
| 140 | ]; |
||||||
| 141 | // Repositories top |
||||||
| 142 | $modversion['blocks'][] = [ |
||||||
| 143 | 'file' => 'repositories.php', |
||||||
| 144 | 'name' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_TOP, |
||||||
| 145 | 'description' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_TOP_DESC, |
||||||
| 146 | 'show_func' => 'b_wggithub_repositories_show', |
||||||
| 147 | 'edit_func' => 'b_wggithub_repositories_edit', |
||||||
| 148 | 'template' => 'wggithub_block_repositories.tpl', |
||||||
| 149 | 'options' => 'top|5|25|0', |
||||||
| 150 | ]; |
||||||
| 151 | // Repositories random |
||||||
| 152 | $modversion['blocks'][] = [ |
||||||
| 153 | 'file' => 'repositories.php', |
||||||
| 154 | 'name' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_RANDOM, |
||||||
| 155 | 'description' => \_MI_WGGITHUB_REPOSITORIES_BLOCK_RANDOM_DESC, |
||||||
| 156 | 'show_func' => 'b_wggithub_repositories_show', |
||||||
| 157 | 'edit_func' => 'b_wggithub_repositories_edit', |
||||||
| 158 | 'template' => 'wggithub_block_repositories.tpl', |
||||||
| 159 | 'options' => 'random|5|25|0', |
||||||
| 160 | ]; |
||||||
| 161 | // ------------------- Config ------------------- // |
||||||
| 162 | // Editor Admin |
||||||
| 163 | \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
Loading history...
|
|||||||
| 164 | $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 Loading history...
|
|||||||
| 165 | $modversion['config'][] = [ |
||||||
| 166 | 'name' => 'editor_admin', |
||||||
| 167 | 'title' => '_MI_WGGITHUB_EDITOR_ADMIN', |
||||||
| 168 | 'description' => '_MI_WGGITHUB_EDITOR_ADMIN_DESC', |
||||||
| 169 | 'formtype' => 'select', |
||||||
| 170 | 'valuetype' => 'text', |
||||||
| 171 | 'default' => 'dhtml', |
||||||
| 172 | 'options' => \array_flip($editorHandler->getList()), |
||||||
| 173 | ]; |
||||||
| 174 | // Editor User |
||||||
| 175 | \xoops_load('xoopseditorhandler');
|
||||||
| 176 | $editorHandler = XoopsEditorHandler::getInstance(); |
||||||
| 177 | $modversion['config'][] = [ |
||||||
| 178 | 'name' => 'editor_user', |
||||||
| 179 | 'title' => '_MI_WGGITHUB_EDITOR_USER', |
||||||
| 180 | 'description' => '_MI_WGGITHUB_EDITOR_USER_DESC', |
||||||
| 181 | 'formtype' => 'select', |
||||||
| 182 | 'valuetype' => 'text', |
||||||
| 183 | 'default' => 'dhtml', |
||||||
| 184 | 'options' => \array_flip($editorHandler->getList()), |
||||||
| 185 | ]; |
||||||
| 186 | // Editor : max characters admin area |
||||||
| 187 | $modversion['config'][] = [ |
||||||
| 188 | 'name' => 'editor_maxchar', |
||||||
| 189 | 'title' => '_MI_WGGITHUB_EDITOR_MAXCHAR', |
||||||
| 190 | 'description' => '_MI_WGGITHUB_EDITOR_MAXCHAR_DESC', |
||||||
| 191 | 'formtype' => 'textbox', |
||||||
| 192 | 'valuetype' => 'int', |
||||||
| 193 | 'default' => 50, |
||||||
| 194 | ]; |
||||||
| 195 | // Keywords |
||||||
| 196 | $modversion['config'][] = [ |
||||||
| 197 | 'name' => 'keywords', |
||||||
| 198 | 'title' => '_MI_WGGITHUB_KEYWORDS', |
||||||
| 199 | 'description' => '_MI_WGGITHUB_KEYWORDS_DESC', |
||||||
| 200 | 'formtype' => 'textbox', |
||||||
| 201 | 'valuetype' => 'text', |
||||||
| 202 | 'default' => 'wggithub, settings, repositories, directories, requests, readmes', |
||||||
| 203 | ]; |
||||||
| 204 | // Admin pager |
||||||
| 205 | $modversion['config'][] = [ |
||||||
| 206 | 'name' => 'adminpager', |
||||||
| 207 | 'title' => '_MI_WGGITHUB_ADMIN_PAGER', |
||||||
| 208 | 'description' => '_MI_WGGITHUB_ADMIN_PAGER_DESC', |
||||||
| 209 | 'formtype' => 'textbox', |
||||||
| 210 | 'valuetype' => 'int', |
||||||
| 211 | 'default' => 25, |
||||||
| 212 | ]; |
||||||
| 213 | // User pager |
||||||
| 214 | $modversion['config'][] = [ |
||||||
| 215 | 'name' => 'userpager', |
||||||
| 216 | 'title' => '_MI_WGGITHUB_USER_PAGER', |
||||||
| 217 | 'description' => '_MI_WGGITHUB_USER_PAGER_DESC', |
||||||
| 218 | 'formtype' => 'textbox', |
||||||
| 219 | 'valuetype' => 'int', |
||||||
| 220 | 'default' => 25, |
||||||
| 221 | ]; |
||||||
| 222 | // Autoapproved |
||||||
| 223 | $modversion['config'][] = [ |
||||||
| 224 | 'name' => 'autoapproved', |
||||||
| 225 | 'title' => '_MI_WGGITHUB_AUTOAPPROVED', |
||||||
| 226 | 'description' => '_MI_WGGITHUB_AUTOAPPROVED_DESC', |
||||||
| 227 | 'formtype' => 'yesno', |
||||||
| 228 | 'valuetype' => 'int', |
||||||
| 229 | 'default' => 1, |
||||||
| 230 | ]; |
||||||
| 231 | // Filter release |
||||||
| 232 | $modversion['config'][] = [ |
||||||
| 233 | 'name' => 'filter_type', |
||||||
| 234 | 'title' => '_MI_WGGITHUB_FILTER_TYPE', |
||||||
| 235 | 'description' => '_MI_WGGITHUB_FILTER_TYPE_DESC', |
||||||
| 236 | 'formtype' => 'select', |
||||||
| 237 | 'valuetype' => 'int', |
||||||
| 238 | 'default' => 1, |
||||||
| 239 | 'options' => ['_AM_WGGITHUB_FILTER_TYPE_ALL' => 1, '_AM_WGGITHUB_FILTER_TYPE_RELEASES' => 2], |
||||||
| 240 | ]; |
||||||
| 241 | // Number column |
||||||
| 242 | $modversion['config'][] = [ |
||||||
| 243 | 'name' => 'numb_col', |
||||||
| 244 | 'title' => '_MI_WGGITHUB_NUMB_COL', |
||||||
| 245 | 'description' => '_MI_WGGITHUB_NUMB_COL_DESC', |
||||||
| 246 | 'formtype' => 'select', |
||||||
| 247 | 'valuetype' => 'int', |
||||||
| 248 | 'default' => 1, |
||||||
| 249 | 'options' => [1 => '1', 2 => '2', 3 => '3', 4 => '4'], |
||||||
| 250 | ]; |
||||||
| 251 | // Divide by |
||||||
| 252 | $modversion['config'][] = [ |
||||||
| 253 | 'name' => 'divideby', |
||||||
| 254 | 'title' => '_MI_WGGITHUB_DIVIDEBY', |
||||||
| 255 | 'description' => '_MI_WGGITHUB_DIVIDEBY_DESC', |
||||||
| 256 | 'formtype' => 'select', |
||||||
| 257 | 'valuetype' => 'int', |
||||||
| 258 | 'default' => 1, |
||||||
| 259 | 'options' => [1 => '1', 2 => '2', 3 => '3', 4 => '4'], |
||||||
| 260 | ]; |
||||||
| 261 | // Table type |
||||||
| 262 | $modversion['config'][] = [ |
||||||
| 263 | 'name' => 'table_type', |
||||||
| 264 | 'title' => '_MI_WGGITHUB_TABLE_TYPE', |
||||||
| 265 | 'description' => '_MI_WGGITHUB_DIVIDEBY_DESC', |
||||||
| 266 | 'formtype' => 'select', |
||||||
| 267 | 'valuetype' => 'int', |
||||||
| 268 | 'default' => 'bordered', |
||||||
| 269 | 'options' => ['bordered' => 'bordered', 'striped' => 'striped', 'hover' => 'hover', 'condensed' => 'condensed'], |
||||||
| 270 | ]; |
||||||
| 271 | // Panel by |
||||||
| 272 | $modversion['config'][] = [ |
||||||
| 273 | 'name' => 'panel_type', |
||||||
| 274 | 'title' => '_MI_WGGITHUB_PANEL_TYPE', |
||||||
| 275 | 'description' => '_MI_WGGITHUB_PANEL_TYPE_DESC', |
||||||
| 276 | 'formtype' => 'select', |
||||||
| 277 | 'valuetype' => 'text', |
||||||
| 278 | 'default' => 'default', |
||||||
| 279 | 'options' => ['default' => 'default', 'primary' => 'primary', 'success' => 'success', 'info' => 'info', 'warning' => 'warning', 'danger' => 'danger'], |
||||||
| 280 | ]; |
||||||
| 281 | // Show breadcrumb |
||||||
| 282 | $modversion['config'][] = [ |
||||||
| 283 | 'name' => 'show_breadcrumbs', |
||||||
| 284 | 'title' => '_MI_WGGITHUB_SHOWBCRUMBS', |
||||||
| 285 | 'description' => '_MI_WGGITHUB_SHOWBCRUMBS_DESC', |
||||||
| 286 | 'formtype' => 'yesno', |
||||||
| 287 | 'valuetype' => 'int', |
||||||
| 288 | 'default' => 1, |
||||||
| 289 | ]; |
||||||
| 290 | // Advertise |
||||||
| 291 | $modversion['config'][] = [ |
||||||
| 292 | 'name' => 'advertise', |
||||||
| 293 | 'title' => '_MI_WGGITHUB_ADVERTISE', |
||||||
| 294 | 'description' => '_MI_WGGITHUB_ADVERTISE_DESC', |
||||||
| 295 | 'formtype' => 'textarea', |
||||||
| 296 | 'valuetype' => 'text', |
||||||
| 297 | 'default' => '', |
||||||
| 298 | ]; |
||||||
| 299 | // Make Sample button visible? |
||||||
| 300 | $modversion['config'][] = [ |
||||||
| 301 | 'name' => 'displaySampleButton', |
||||||
| 302 | 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
||||||
| 303 | 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
||||||
| 304 | 'formtype' => 'yesno', |
||||||
| 305 | 'valuetype' => 'int', |
||||||
| 306 | 'default' => 1, |
||||||
| 307 | ]; |
||||||
| 308 | // Maintained by |
||||||
| 309 | $modversion['config'][] = [ |
||||||
| 310 | 'name' => 'maintainedby', |
||||||
| 311 | 'title' => '_MI_WGGITHUB_MAINTAINEDBY', |
||||||
| 312 | 'description' => '_MI_WGGITHUB_MAINTAINEDBY_DESC', |
||||||
| 313 | 'formtype' => 'textbox', |
||||||
| 314 | 'valuetype' => 'text', |
||||||
| 315 | 'default' => 'https://xoops.org/modules/newbb', |
||||||
| 316 | ]; |
||||||
| 317 |