@@ -21,33 +21,33 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function myiframe_getmoduleoption($option, $repmodule = 'myiframe') |
23 | 23 | { |
24 | - global $xoopsModuleConfig, $xoopsModule; |
|
25 | - static $tbloptions = []; |
|
26 | - if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
27 | - return $tbloptions[$option]; |
|
28 | - } |
|
24 | + global $xoopsModuleConfig, $xoopsModule; |
|
25 | + static $tbloptions = []; |
|
26 | + if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
27 | + return $tbloptions[$option]; |
|
28 | + } |
|
29 | 29 | |
30 | - $retval = false; |
|
31 | - if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) { |
|
32 | - if (isset($xoopsModuleConfig[$option])) { |
|
33 | - $retval = $xoopsModuleConfig[$option]; |
|
34 | - } |
|
35 | - } else { |
|
36 | - /** @var \XoopsModuleHandler $moduleHandler */ |
|
37 | - $moduleHandler = xoops_getHandler('module'); |
|
38 | - $module = $moduleHandler->getByDirname($repmodule); |
|
39 | - /** @var \XoopsConfigHandler $configHandler */ |
|
40 | - $configHandler = xoops_getHandler('config'); |
|
41 | - if ($module) { |
|
42 | - $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
43 | - if (isset($moduleConfig[$option])) { |
|
44 | - $retval = $moduleConfig[$option]; |
|
45 | - } |
|
46 | - } |
|
47 | - } |
|
48 | - $tbloptions[$option] = $retval; |
|
30 | + $retval = false; |
|
31 | + if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) { |
|
32 | + if (isset($xoopsModuleConfig[$option])) { |
|
33 | + $retval = $xoopsModuleConfig[$option]; |
|
34 | + } |
|
35 | + } else { |
|
36 | + /** @var \XoopsModuleHandler $moduleHandler */ |
|
37 | + $moduleHandler = xoops_getHandler('module'); |
|
38 | + $module = $moduleHandler->getByDirname($repmodule); |
|
39 | + /** @var \XoopsConfigHandler $configHandler */ |
|
40 | + $configHandler = xoops_getHandler('config'); |
|
41 | + if ($module) { |
|
42 | + $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
43 | + if (isset($moduleConfig[$option])) { |
|
44 | + $retval = $moduleConfig[$option]; |
|
45 | + } |
|
46 | + } |
|
47 | + } |
|
48 | + $tbloptions[$option] = $retval; |
|
49 | 49 | |
50 | - return $retval; |
|
50 | + return $retval; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function myiframe_FieldExists($fieldname, $table) |
63 | 63 | { |
64 | - $result = $GLOBALS['xoopsDB']->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'"); |
|
64 | + $result = $GLOBALS['xoopsDB']->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'"); |
|
65 | 65 | |
66 | - return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0); |
|
66 | + return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -78,21 +78,21 @@ discard block |
||
78 | 78 | */ |
79 | 79 | function myiframe_set_metas($page_title = '', $meta_description = '', $meta_keywords = ''): void |
80 | 80 | { |
81 | - global $xoTheme, $xoTheme, $xoopsTpl; |
|
82 | - $xoopsTpl->assign('xoops_pagetitle', $page_title); |
|
83 | - if (isset($xoTheme) && is_object($xoTheme)) { |
|
84 | - if (!empty($meta_keywords)) { |
|
85 | - $xoTheme->addMeta('meta', 'keywords', $meta_keywords); |
|
86 | - } |
|
87 | - if (!empty($meta_description)) { |
|
88 | - $xoTheme->addMeta('meta', 'description', $meta_description); |
|
89 | - } |
|
90 | - } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
91 | - if (!empty($meta_keywords)) { |
|
92 | - $xoopsTpl->assign('xoops_meta_keywords', $meta_keywords); |
|
93 | - } |
|
94 | - if (!empty($meta_description)) { |
|
95 | - $xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
96 | - } |
|
97 | - } |
|
81 | + global $xoTheme, $xoTheme, $xoopsTpl; |
|
82 | + $xoopsTpl->assign('xoops_pagetitle', $page_title); |
|
83 | + if (isset($xoTheme) && is_object($xoTheme)) { |
|
84 | + if (!empty($meta_keywords)) { |
|
85 | + $xoTheme->addMeta('meta', 'keywords', $meta_keywords); |
|
86 | + } |
|
87 | + if (!empty($meta_description)) { |
|
88 | + $xoTheme->addMeta('meta', 'description', $meta_description); |
|
89 | + } |
|
90 | + } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
91 | + if (!empty($meta_keywords)) { |
|
92 | + $xoopsTpl->assign('xoops_meta_keywords', $meta_keywords); |
|
93 | + } |
|
94 | + if (!empty($meta_description)) { |
|
95 | + $xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
96 | + } |
|
97 | + } |
|
98 | 98 | } |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function xoops_module_pre_install_myiframe(\XoopsModule $module) |
30 | 30 | { |
31 | - require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
32 | - /** @var \Utility $utility */ |
|
33 | - $utility = new Utility(); |
|
34 | - $xoopsSuccess = $utility::checkVerXoops($module); |
|
35 | - $phpSuccess = $utility::checkVerPhp($module); |
|
31 | + require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
32 | + /** @var \Utility $utility */ |
|
33 | + $utility = new Utility(); |
|
34 | + $xoopsSuccess = $utility::checkVerXoops($module); |
|
35 | + $phpSuccess = $utility::checkVerPhp($module); |
|
36 | 36 | |
37 | - if (false !== $xoopsSuccess && false !== $phpSuccess) { |
|
38 | - $moduleTables = &$module->getInfo('tables'); |
|
39 | - foreach ($moduleTables as $table) { |
|
40 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
41 | - } |
|
42 | - } |
|
37 | + if (false !== $xoopsSuccess && false !== $phpSuccess) { |
|
38 | + $moduleTables = &$module->getInfo('tables'); |
|
39 | + foreach ($moduleTables as $table) { |
|
40 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
41 | + } |
|
42 | + } |
|
43 | 43 | |
44 | - return $xoopsSuccess && $phpSuccess; |
|
44 | + return $xoopsSuccess && $phpSuccess; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -52,52 +52,52 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function xoops_module_install_myiframe(\XoopsModule $module) |
54 | 54 | { |
55 | - require \dirname(__DIR__, 3) . '/mainfile.php'; |
|
55 | + require \dirname(__DIR__, 3) . '/mainfile.php'; |
|
56 | 56 | |
57 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
57 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
58 | 58 | |
59 | - /** @var Myiframe\Helper $helper */ |
|
60 | - $helper = Myiframe\Helper::getInstance(); |
|
61 | - /** @var Myiframe\Utility $helper */ |
|
62 | - $utility = new Utility(); |
|
63 | - /** @var Myiframe\Common\Configurator $helper */ |
|
64 | - $configurator = new Myiframe\Common\Configurator(); |
|
65 | - // Load language files |
|
66 | - $helper->loadLanguage('admin'); |
|
67 | - $helper->loadLanguage('modinfo'); |
|
59 | + /** @var Myiframe\Helper $helper */ |
|
60 | + $helper = Myiframe\Helper::getInstance(); |
|
61 | + /** @var Myiframe\Utility $helper */ |
|
62 | + $utility = new Utility(); |
|
63 | + /** @var Myiframe\Common\Configurator $helper */ |
|
64 | + $configurator = new Myiframe\Common\Configurator(); |
|
65 | + // Load language files |
|
66 | + $helper->loadLanguage('admin'); |
|
67 | + $helper->loadLanguage('modinfo'); |
|
68 | 68 | |
69 | - // default Permission Settings ---------------------- |
|
70 | - global $xoopsModule; |
|
71 | - $moduleId = $xoopsModule->getVar('mid'); |
|
72 | - // $moduleId2 = $helper->getModule()->mid(); |
|
73 | - /** @var \XoopsGroupPermHandler $grouppermHandler */ |
|
74 | - $grouppermHandler = xoops_getHandler('groupperm'); |
|
75 | - // access rights ------------------------------------------ |
|
76 | - $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | - $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
69 | + // default Permission Settings ---------------------- |
|
70 | + global $xoopsModule; |
|
71 | + $moduleId = $xoopsModule->getVar('mid'); |
|
72 | + // $moduleId2 = $helper->getModule()->mid(); |
|
73 | + /** @var \XoopsGroupPermHandler $grouppermHandler */ |
|
74 | + $grouppermHandler = xoops_getHandler('groupperm'); |
|
75 | + // access rights ------------------------------------------ |
|
76 | + $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | + $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | + $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | + $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | + $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
81 | 81 | |
82 | - // --- CREATE FOLDERS --------------- |
|
83 | - if (count($configurator->uploadFolders) > 0) { |
|
84 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
85 | - foreach (array_keys($configurator->uploadFolders) as $i) { |
|
86 | - $utility::createFolder($configurator->uploadFolders[$i]); |
|
87 | - } |
|
88 | - } |
|
82 | + // --- CREATE FOLDERS --------------- |
|
83 | + if (count($configurator->uploadFolders) > 0) { |
|
84 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
85 | + foreach (array_keys($configurator->uploadFolders) as $i) { |
|
86 | + $utility::createFolder($configurator->uploadFolders[$i]); |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - // --- COPY blank.png FILES --------------- |
|
91 | - if (count($configurator->copyBlankFiles) > 0) { |
|
92 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
93 | - foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
94 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
95 | - $utility::copyFile($file, $dest); |
|
96 | - } |
|
97 | - } |
|
98 | - //delete .html entries from the tpl table |
|
99 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
100 | - $GLOBALS['xoopsDB']->queryF($sql); |
|
90 | + // --- COPY blank.png FILES --------------- |
|
91 | + if (count($configurator->copyBlankFiles) > 0) { |
|
92 | + $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
93 | + foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
94 | + $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
95 | + $utility::copyFile($file, $dest); |
|
96 | + } |
|
97 | + } |
|
98 | + //delete .html entries from the tpl table |
|
99 | + $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
100 | + $GLOBALS['xoopsDB']->queryF($sql); |
|
101 | 101 | |
102 | - return true; |
|
102 | + return true; |
|
103 | 103 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function xoops_module_pre_install_myiframe(\XoopsModule $module) |
30 | 30 | { |
31 | - require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
31 | + require_once \dirname(__DIR__).'/preloads/autoloader.php'; |
|
32 | 32 | /** @var \Utility $utility */ |
33 | 33 | $utility = new Utility(); |
34 | 34 | $xoopsSuccess = $utility::checkVerXoops($module); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if (false !== $xoopsSuccess && false !== $phpSuccess) { |
38 | 38 | $moduleTables = &$module->getInfo('tables'); |
39 | 39 | foreach ($moduleTables as $table) { |
40 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
40 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function xoops_module_install_myiframe(\XoopsModule $module) |
54 | 54 | { |
55 | - require \dirname(__DIR__, 3) . '/mainfile.php'; |
|
55 | + require \dirname(__DIR__, 3).'/mainfile.php'; |
|
56 | 56 | |
57 | 57 | $moduleDirName = \basename(\dirname(__DIR__)); |
58 | 58 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
74 | 74 | $grouppermHandler = xoops_getHandler('groupperm'); |
75 | 75 | // access rights ------------------------------------------ |
76 | - $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | - $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
76 | + $grouppermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | + $grouppermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
81 | 81 | |
82 | 82 | // --- CREATE FOLDERS --------------- |
83 | 83 | if (count($configurator->uploadFolders) > 0) { |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | |
90 | 90 | // --- COPY blank.png FILES --------------- |
91 | 91 | if (count($configurator->copyBlankFiles) > 0) { |
92 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
92 | + $file = \dirname(__DIR__).'/assets/images/blank.png'; |
|
93 | 93 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
94 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
94 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
95 | 95 | $utility::copyFile($file, $dest); |
96 | 96 | } |
97 | 97 | } |
98 | 98 | //delete .html entries from the tpl table |
99 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
99 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
100 | 100 | $GLOBALS['xoopsDB']->queryF($sql); |
101 | 101 | |
102 | 102 | return true; |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | */ |
21 | 21 | function xoops_module_pre_uninstall_myiframe(\XoopsModule $module) |
22 | 22 | { |
23 | - // Do some synchronization |
|
24 | - return true; |
|
23 | + // Do some synchronization |
|
24 | + return true; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -32,32 +32,32 @@ discard block |
||
32 | 32 | */ |
33 | 33 | function xoops_module_uninstall_myiframe(\XoopsModule $module) |
34 | 34 | { |
35 | - // return true; |
|
35 | + // return true; |
|
36 | 36 | |
37 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
38 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
39 | - /** @var Myiframe\Helper $helper */ |
|
40 | - $helper = Myiframe\Helper::getInstance(); |
|
37 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
38 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
39 | + /** @var Myiframe\Helper $helper */ |
|
40 | + $helper = Myiframe\Helper::getInstance(); |
|
41 | 41 | |
42 | - /** @var Myiframe\Utility $utility */ |
|
43 | - $utility = new Utility(); |
|
42 | + /** @var Myiframe\Utility $utility */ |
|
43 | + $utility = new Utility(); |
|
44 | 44 | |
45 | - $success = true; |
|
46 | - $helper->loadLanguage('admin'); |
|
45 | + $success = true; |
|
46 | + $helper->loadLanguage('admin'); |
|
47 | 47 | |
48 | - // Rename uploads folder to BAK and add date to name |
|
49 | - $uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName"); |
|
50 | - $dirInfo = new \SplFileInfo($uploadDirectory); |
|
51 | - if ($dirInfo->isDir()) { |
|
52 | - // The directory exists so rename it |
|
53 | - $date = date('Y-m-d'); |
|
54 | - if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) { |
|
55 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $uploadDirectory)); |
|
56 | - $success = false; |
|
57 | - } |
|
58 | - } |
|
59 | - unset($dirInfo); |
|
60 | - /* |
|
48 | + // Rename uploads folder to BAK and add date to name |
|
49 | + $uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName"); |
|
50 | + $dirInfo = new \SplFileInfo($uploadDirectory); |
|
51 | + if ($dirInfo->isDir()) { |
|
52 | + // The directory exists so rename it |
|
53 | + $date = date('Y-m-d'); |
|
54 | + if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) { |
|
55 | + $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $uploadDirectory)); |
|
56 | + $success = false; |
|
57 | + } |
|
58 | + } |
|
59 | + unset($dirInfo); |
|
60 | + /* |
|
61 | 61 | //------------ START ---------------- |
62 | 62 | //------------------------------------------------------------------ |
63 | 63 | // Remove xsitemap.xml from XOOPS root folder if it exists |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | // return $success && $delOk; // use this if you're using this routine |
72 | 72 | */ |
73 | 73 | |
74 | - return $success; |
|
75 | - //------------ END ---------------- |
|
74 | + return $success; |
|
75 | + //------------ END ---------------- |
|
76 | 76 | } |
@@ -51,8 +51,8 @@ |
||
51 | 51 | if ($dirInfo->isDir()) { |
52 | 52 | // The directory exists so rename it |
53 | 53 | $date = date('Y-m-d'); |
54 | - if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) { |
|
55 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $uploadDirectory)); |
|
54 | + if (!rename($uploadDirectory, $uploadDirectory."_bak_$date")) { |
|
55 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $uploadDirectory)); |
|
56 | 56 | $success = false; |
57 | 57 | } |
58 | 58 | } |
@@ -30,5 +30,5 @@ |
||
30 | 30 | */ |
31 | 31 | class Utility extends Common\SysUtility |
32 | 32 | { |
33 | - //--------------- Custom module methods ----------------------------- |
|
33 | + //--------------- Custom module methods ----------------------------- |
|
34 | 34 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | $ret = false; |
69 | 69 | |
70 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
70 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
71 | 71 | if (!\class_exists($class)) { |
72 | 72 | throw new \RuntimeException("Class '$class' not found"); |
73 | 73 | } |
@@ -23,62 +23,62 @@ |
||
23 | 23 | */ |
24 | 24 | class Helper extends \Xmf\Module\Helper |
25 | 25 | { |
26 | - public $debug; |
|
26 | + public $debug; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @param bool $debug |
|
30 | - */ |
|
31 | - public function __construct($debug = false) |
|
32 | - { |
|
33 | - $this->debug = $debug; |
|
34 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
35 | - parent::__construct($moduleDirName); |
|
36 | - } |
|
28 | + /** |
|
29 | + * @param bool $debug |
|
30 | + */ |
|
31 | + public function __construct($debug = false) |
|
32 | + { |
|
33 | + $this->debug = $debug; |
|
34 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
35 | + parent::__construct($moduleDirName); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param bool $debug |
|
40 | - * |
|
41 | - * @return \XoopsModules\Myiframe\Helper |
|
42 | - */ |
|
43 | - public static function getInstance(bool $debug = false): self |
|
44 | - { |
|
45 | - static $instance; |
|
46 | - if (null === $instance) { |
|
47 | - $instance = new static($debug); |
|
48 | - } |
|
38 | + /** |
|
39 | + * @param bool $debug |
|
40 | + * |
|
41 | + * @return \XoopsModules\Myiframe\Helper |
|
42 | + */ |
|
43 | + public static function getInstance(bool $debug = false): self |
|
44 | + { |
|
45 | + static $instance; |
|
46 | + if (null === $instance) { |
|
47 | + $instance = new static($debug); |
|
48 | + } |
|
49 | 49 | |
50 | - return $instance; |
|
51 | - } |
|
50 | + return $instance; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @return string |
|
55 | - */ |
|
56 | - public function getDirname() |
|
57 | - { |
|
58 | - return $this->dirname; |
|
59 | - } |
|
53 | + /** |
|
54 | + * @return string |
|
55 | + */ |
|
56 | + public function getDirname() |
|
57 | + { |
|
58 | + return $this->dirname; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Get an Object Handler |
|
63 | - * |
|
64 | - * @param string $name name of handler to load |
|
65 | - * |
|
66 | - * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
67 | - */ |
|
68 | - public function getHandler($name) |
|
69 | - { |
|
70 | - $ret = false; |
|
61 | + /** |
|
62 | + * Get an Object Handler |
|
63 | + * |
|
64 | + * @param string $name name of handler to load |
|
65 | + * |
|
66 | + * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
67 | + */ |
|
68 | + public function getHandler($name) |
|
69 | + { |
|
70 | + $ret = false; |
|
71 | 71 | |
72 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
73 | - if (!\class_exists($class)) { |
|
74 | - throw new \RuntimeException("Class '$class' not found"); |
|
75 | - } |
|
76 | - /** @var \XoopsMySQLDatabase $db */ |
|
77 | - $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
78 | - $helper = self::getInstance(); |
|
79 | - $ret = new $class($db, $helper); |
|
80 | - $this->addLog("Getting handler '{$name}'"); |
|
72 | + $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
73 | + if (!\class_exists($class)) { |
|
74 | + throw new \RuntimeException("Class '$class' not found"); |
|
75 | + } |
|
76 | + /** @var \XoopsMySQLDatabase $db */ |
|
77 | + $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
78 | + $helper = self::getInstance(); |
|
79 | + $ret = new $class($db, $helper); |
|
80 | + $this->addLog("Getting handler '{$name}'"); |
|
81 | 81 | |
82 | - return $ret; |
|
83 | - } |
|
82 | + return $ret; |
|
83 | + } |
|
84 | 84 | } |
@@ -25,39 +25,39 @@ discard block |
||
25 | 25 | */ |
26 | 26 | class Breadcrumb |
27 | 27 | { |
28 | - public $dirname; |
|
29 | - private $bread = []; |
|
28 | + public $dirname; |
|
29 | + private $bread = []; |
|
30 | 30 | |
31 | - public function __construct() |
|
32 | - { |
|
33 | - $this->dirname = \basename(\dirname(__DIR__, 2)); |
|
34 | - } |
|
31 | + public function __construct() |
|
32 | + { |
|
33 | + $this->dirname = \basename(\dirname(__DIR__, 2)); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Add link to breadcrumb |
|
38 | - * |
|
39 | - * @param string $title |
|
40 | - * @param string $link |
|
41 | - */ |
|
42 | - public function addLink($title = '', $link = ''): void |
|
43 | - { |
|
44 | - $this->bread[] = [ |
|
45 | - 'link' => $link, |
|
46 | - 'title' => $title, |
|
47 | - ]; |
|
48 | - } |
|
36 | + /** |
|
37 | + * Add link to breadcrumb |
|
38 | + * |
|
39 | + * @param string $title |
|
40 | + * @param string $link |
|
41 | + */ |
|
42 | + public function addLink($title = '', $link = ''): void |
|
43 | + { |
|
44 | + $this->bread[] = [ |
|
45 | + 'link' => $link, |
|
46 | + 'title' => $title, |
|
47 | + ]; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * Render BreadCrumb |
|
52 | - */ |
|
53 | - public function render(): void |
|
54 | - { |
|
55 | - /* |
|
50 | + /** |
|
51 | + * Render BreadCrumb |
|
52 | + */ |
|
53 | + public function render(): void |
|
54 | + { |
|
55 | + /* |
|
56 | 56 | TODO if you want to use the render code below, |
57 | 57 | 1) create ./templates/chess_common_breadcrumb.tpl) |
58 | 58 | 2) add declaration to xoops_version.php |
59 | 59 | */ |
60 | - /* |
|
60 | + /* |
|
61 | 61 | if (!isset($GLOBALS['xoTheme']) || !\is_object($GLOBALS['xoTheme'])) { |
62 | 62 | require $GLOBALS['xoops']->path('class/theme.php'); |
63 | 63 | |
@@ -76,5 +76,5 @@ discard block |
||
76 | 76 | |
77 | 77 | return $html; |
78 | 78 | */ |
79 | - } |
|
79 | + } |
|
80 | 80 | } |
@@ -19,127 +19,127 @@ |
||
19 | 19 | */ |
20 | 20 | trait VersionChecks |
21 | 21 | { |
22 | - /** |
|
23 | - * Verifies XOOPS version meets minimum requirements for this module |
|
24 | - * @static |
|
25 | - * @param \XoopsModule $module |
|
26 | - * |
|
27 | - * @param null|string $requiredVer |
|
28 | - * @return bool true if meets requirements, false if not |
|
29 | - */ |
|
30 | - public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null) |
|
31 | - { |
|
32 | - $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
33 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
34 | - if (null === $module) { |
|
35 | - $module = \XoopsModule::getByDirname($moduleDirName); |
|
36 | - } |
|
37 | - \xoops_loadLanguage('admin', $moduleDirName); |
|
38 | - \xoops_loadLanguage('common', $moduleDirName); |
|
22 | + /** |
|
23 | + * Verifies XOOPS version meets minimum requirements for this module |
|
24 | + * @static |
|
25 | + * @param \XoopsModule $module |
|
26 | + * |
|
27 | + * @param null|string $requiredVer |
|
28 | + * @return bool true if meets requirements, false if not |
|
29 | + */ |
|
30 | + public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null) |
|
31 | + { |
|
32 | + $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
33 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
34 | + if (null === $module) { |
|
35 | + $module = \XoopsModule::getByDirname($moduleDirName); |
|
36 | + } |
|
37 | + \xoops_loadLanguage('admin', $moduleDirName); |
|
38 | + \xoops_loadLanguage('common', $moduleDirName); |
|
39 | 39 | |
40 | - //check for minimum XOOPS version |
|
41 | - $currentVer = mb_substr(\XOOPS_VERSION, 6); // get the numeric part of string |
|
42 | - if (null === $requiredVer) { |
|
43 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
44 | - } |
|
45 | - $success = true; |
|
40 | + //check for minimum XOOPS version |
|
41 | + $currentVer = mb_substr(\XOOPS_VERSION, 6); // get the numeric part of string |
|
42 | + if (null === $requiredVer) { |
|
43 | + $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
44 | + } |
|
45 | + $success = true; |
|
46 | 46 | |
47 | - if (\version_compare($currentVer, $requiredVer, '<')) { |
|
48 | - $success = false; |
|
49 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
50 | - } |
|
47 | + if (\version_compare($currentVer, $requiredVer, '<')) { |
|
48 | + $success = false; |
|
49 | + $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
50 | + } |
|
51 | 51 | |
52 | - return $success; |
|
53 | - } |
|
52 | + return $success; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * Verifies PHP version meets minimum requirements for this module |
|
57 | - * @static |
|
58 | - * @param \XoopsModule|bool|null $module |
|
59 | - * |
|
60 | - * @return bool true if meets requirements, false if not |
|
61 | - */ |
|
62 | - public static function checkVerPhp(\XoopsModule $module = null) |
|
63 | - { |
|
64 | - $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
65 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
66 | - if (null === $module) { |
|
67 | - $module = \XoopsModule::getByDirname($moduleDirName); |
|
68 | - } |
|
69 | - \xoops_loadLanguage('admin', $moduleDirName); |
|
70 | - \xoops_loadLanguage('common', $moduleDirName); |
|
55 | + /** |
|
56 | + * Verifies PHP version meets minimum requirements for this module |
|
57 | + * @static |
|
58 | + * @param \XoopsModule|bool|null $module |
|
59 | + * |
|
60 | + * @return bool true if meets requirements, false if not |
|
61 | + */ |
|
62 | + public static function checkVerPhp(\XoopsModule $module = null) |
|
63 | + { |
|
64 | + $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
65 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
66 | + if (null === $module) { |
|
67 | + $module = \XoopsModule::getByDirname($moduleDirName); |
|
68 | + } |
|
69 | + \xoops_loadLanguage('admin', $moduleDirName); |
|
70 | + \xoops_loadLanguage('common', $moduleDirName); |
|
71 | 71 | |
72 | - // check for minimum PHP version |
|
73 | - $success = true; |
|
72 | + // check for minimum PHP version |
|
73 | + $success = true; |
|
74 | 74 | |
75 | - $verNum = \PHP_VERSION; |
|
76 | - $reqVer = &$module->getInfo('min_php'); |
|
75 | + $verNum = \PHP_VERSION; |
|
76 | + $reqVer = &$module->getInfo('min_php'); |
|
77 | 77 | |
78 | - if (false !== $reqVer && '' !== $reqVer) { |
|
79 | - if (\version_compare($verNum, $reqVer, '<')) { |
|
80 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
81 | - $success = false; |
|
82 | - } |
|
83 | - } |
|
78 | + if (false !== $reqVer && '' !== $reqVer) { |
|
79 | + if (\version_compare($verNum, $reqVer, '<')) { |
|
80 | + $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
81 | + $success = false; |
|
82 | + } |
|
83 | + } |
|
84 | 84 | |
85 | - return $success; |
|
86 | - } |
|
85 | + return $success; |
|
86 | + } |
|
87 | 87 | |
88 | - /** |
|
89 | - * compares current module version with the latest GitHub release |
|
90 | - * @static |
|
91 | - * |
|
92 | - * @return string|array info about the latest module version, if newer |
|
93 | - */ |
|
94 | - public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array |
|
95 | - { |
|
96 | - $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
97 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
98 | - $update = ''; |
|
99 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
100 | - // $repository = 'XoopsModules25x/publisher'; //for testing only |
|
101 | - $ret = null; |
|
102 | - $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
|
103 | - if ('github' === $source) { |
|
104 | - if (\function_exists('curl_init') && false !== ($curlHandle = \curl_init())) { |
|
105 | - \curl_setopt($curlHandle, \CURLOPT_URL, $infoReleasesUrl); |
|
106 | - \curl_setopt($curlHandle, \CURLOPT_RETURNTRANSFER, true); |
|
107 | - \curl_setopt($curlHandle, \CURLOPT_SSL_VERIFYPEER, true); //TODO: how to avoid an error when 'Peer's Certificate issuer is not recognized' |
|
108 | - \curl_setopt($curlHandle, \CURLOPT_HTTPHEADER, ["User-Agent:Publisher\r\n"]); |
|
109 | - $curlReturn = \curl_exec($curlHandle); |
|
110 | - if (false === $curlReturn) { |
|
111 | - \trigger_error(\curl_error($curlHandle)); |
|
112 | - } elseif (false !== \mb_strpos($curlReturn, 'Not Found')) { |
|
113 | - \trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
114 | - } else { |
|
115 | - $file = json_decode($curlReturn, false); |
|
116 | - $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default); |
|
117 | - $latestVersion = $file[0]->tag_name; |
|
118 | - $prerelease = $file[0]->prerelease; |
|
119 | - if ('master' !== $latestVersionLink) { |
|
120 | - $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
121 | - } |
|
122 | - //"PHP-standardized" version |
|
123 | - $latestVersion = \mb_strtolower($latestVersion); |
|
124 | - if (false !== mb_strpos($latestVersion, 'final')) { |
|
125 | - $latestVersion = \str_replace('_', '', \mb_strtolower($latestVersion)); |
|
126 | - $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion)); |
|
127 | - } |
|
128 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
129 | - //"PHP-standardized" version |
|
130 | - $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion)); |
|
131 | - // $moduleVersion = '1.0'; //for testing only |
|
132 | - // $moduleDirName = 'publisher'; //for testing only |
|
133 | - if (!$prerelease && \version_compare($moduleVersion, $latestVersion, '<')) { |
|
134 | - $ret = []; |
|
135 | - $ret[] = $update; |
|
136 | - $ret[] = $latestVersionLink; |
|
137 | - } |
|
138 | - } |
|
139 | - \curl_close($curlHandle); |
|
140 | - } |
|
141 | - } |
|
88 | + /** |
|
89 | + * compares current module version with the latest GitHub release |
|
90 | + * @static |
|
91 | + * |
|
92 | + * @return string|array info about the latest module version, if newer |
|
93 | + */ |
|
94 | + public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array |
|
95 | + { |
|
96 | + $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
97 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
98 | + $update = ''; |
|
99 | + $repository = 'XoopsModules25x/' . $moduleDirName; |
|
100 | + // $repository = 'XoopsModules25x/publisher'; //for testing only |
|
101 | + $ret = null; |
|
102 | + $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
|
103 | + if ('github' === $source) { |
|
104 | + if (\function_exists('curl_init') && false !== ($curlHandle = \curl_init())) { |
|
105 | + \curl_setopt($curlHandle, \CURLOPT_URL, $infoReleasesUrl); |
|
106 | + \curl_setopt($curlHandle, \CURLOPT_RETURNTRANSFER, true); |
|
107 | + \curl_setopt($curlHandle, \CURLOPT_SSL_VERIFYPEER, true); //TODO: how to avoid an error when 'Peer's Certificate issuer is not recognized' |
|
108 | + \curl_setopt($curlHandle, \CURLOPT_HTTPHEADER, ["User-Agent:Publisher\r\n"]); |
|
109 | + $curlReturn = \curl_exec($curlHandle); |
|
110 | + if (false === $curlReturn) { |
|
111 | + \trigger_error(\curl_error($curlHandle)); |
|
112 | + } elseif (false !== \mb_strpos($curlReturn, 'Not Found')) { |
|
113 | + \trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
114 | + } else { |
|
115 | + $file = json_decode($curlReturn, false); |
|
116 | + $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default); |
|
117 | + $latestVersion = $file[0]->tag_name; |
|
118 | + $prerelease = $file[0]->prerelease; |
|
119 | + if ('master' !== $latestVersionLink) { |
|
120 | + $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
121 | + } |
|
122 | + //"PHP-standardized" version |
|
123 | + $latestVersion = \mb_strtolower($latestVersion); |
|
124 | + if (false !== mb_strpos($latestVersion, 'final')) { |
|
125 | + $latestVersion = \str_replace('_', '', \mb_strtolower($latestVersion)); |
|
126 | + $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion)); |
|
127 | + } |
|
128 | + $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
129 | + //"PHP-standardized" version |
|
130 | + $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion)); |
|
131 | + // $moduleVersion = '1.0'; //for testing only |
|
132 | + // $moduleDirName = 'publisher'; //for testing only |
|
133 | + if (!$prerelease && \version_compare($moduleVersion, $latestVersion, '<')) { |
|
134 | + $ret = []; |
|
135 | + $ret[] = $update; |
|
136 | + $ret[] = $latestVersionLink; |
|
137 | + } |
|
138 | + } |
|
139 | + \curl_close($curlHandle); |
|
140 | + } |
|
141 | + } |
|
142 | 142 | |
143 | - return $ret; |
|
144 | - } |
|
143 | + return $ret; |
|
144 | + } |
|
145 | 145 | } |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | //check for minimum XOOPS version |
41 | 41 | $currentVer = mb_substr(\XOOPS_VERSION, 6); // get the numeric part of string |
42 | 42 | if (null === $requiredVer) { |
43 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
43 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
44 | 44 | } |
45 | 45 | $success = true; |
46 | 46 | |
47 | 47 | if (\version_compare($currentVer, $requiredVer, '<')) { |
48 | 48 | $success = false; |
49 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
49 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $success; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | if (false !== $reqVer && '' !== $reqVer) { |
79 | 79 | if (\version_compare($verNum, $reqVer, '<')) { |
80 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
80 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
81 | 81 | $success = false; |
82 | 82 | } |
83 | 83 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
97 | 97 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
98 | 98 | $update = ''; |
99 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
99 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
100 | 100 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
101 | 101 | $ret = null; |
102 | 102 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | if (false === $curlReturn) { |
111 | 111 | \trigger_error(\curl_error($curlHandle)); |
112 | 112 | } elseif (false !== \mb_strpos($curlReturn, 'Not Found')) { |
113 | - \trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
113 | + \trigger_error('Repository Not Found: '.$infoReleasesUrl); |
|
114 | 114 | } else { |
115 | 115 | $file = json_decode($curlReturn, false); |
116 | 116 | $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default); |
117 | 117 | $latestVersion = $file[0]->tag_name; |
118 | 118 | $prerelease = $file[0]->prerelease; |
119 | 119 | if ('master' !== $latestVersionLink) { |
120 | - $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
120 | + $update = \constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion; |
|
121 | 121 | } |
122 | 122 | //"PHP-standardized" version |
123 | 123 | $latestVersion = \mb_strtolower($latestVersion); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $latestVersion = \str_replace('_', '', \mb_strtolower($latestVersion)); |
126 | 126 | $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion)); |
127 | 127 | } |
128 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
128 | + $moduleVersion = ($helper->getModule()->getInfo('version').'_'.$helper->getModule()->getInfo('module_status')); |
|
129 | 129 | //"PHP-standardized" version |
130 | 130 | $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion)); |
131 | 131 | // $moduleVersion = '1.0'; //for testing only |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | |
63 | 63 | if (self::SHOW_BUTTONS == $displaySampleButton) { |
64 | 64 | \xoops_loadLanguage('admin/modulesadmin', 'system'); |
65 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add'); |
|
66 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add'); |
|
67 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert'); |
|
65 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add'); |
|
66 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add'); |
|
67 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert'); |
|
68 | 68 | // $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), $helper->url( 'testdata/index.php?op=exportschema'), 'add'); |
69 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete'); |
|
69 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete'); |
|
70 | 70 | } else { |
71 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add'); |
|
71 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add'); |
|
72 | 72 | // $displaySampleButton = $config['displaySampleButton']; |
73 | 73 | } |
74 | 74 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public static function hideButtons(): void |
82 | 82 | { |
83 | - $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
83 | + $yamlFile = \dirname(__DIR__, 2).'/config/admin.yml'; |
|
84 | 84 | $app = []; |
85 | 85 | $app['displaySampleButton'] = 0; |
86 | 86 | Yaml::save($app, $yamlFile); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public static function showButtons(): void |
96 | 96 | { |
97 | - $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
97 | + $yamlFile = \dirname(__DIR__, 2).'/config/admin.yml'; |
|
98 | 98 | $app = []; |
99 | 99 | $app['displaySampleButton'] = 1; |
100 | 100 | Yaml::save($app, $yamlFile); |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | use Xmf\{ |
26 | - Module\Admin, |
|
27 | - Request, |
|
28 | - Yaml |
|
26 | + Module\Admin, |
|
27 | + Request, |
|
28 | + Yaml |
|
29 | 29 | }; |
30 | 30 | use XoopsModules\Myiframe\{ |
31 | - Helper |
|
31 | + Helper |
|
32 | 32 | }; |
33 | 33 | |
34 | 34 | /** @var Helper $helper */ |
@@ -40,65 +40,65 @@ discard block |
||
40 | 40 | */ |
41 | 41 | class TestdataButtons |
42 | 42 | { |
43 | - /** Button status constants */ |
|
44 | - private const SHOW_BUTTONS = 1; |
|
45 | - private const HIDE_BUTTONS = 0; |
|
43 | + /** Button status constants */ |
|
44 | + private const SHOW_BUTTONS = 1; |
|
45 | + private const HIDE_BUTTONS = 0; |
|
46 | 46 | |
47 | - /** |
|
48 | - * Load the test button configuration |
|
49 | - * |
|
50 | - * @param \Xmf\Module\Admin $adminObject |
|
51 | - * |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - public static function loadButtonConfig($adminObject): void |
|
55 | - { |
|
56 | - $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
57 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
58 | - $helper = Helper::getInstance(); |
|
59 | - $yamlFile = $helper->path('/config/admin.yml'); |
|
60 | - /** @var array $config */ |
|
61 | - $config = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps |
|
62 | - $displaySampleButton = $config['displaySampleButton']; |
|
47 | + /** |
|
48 | + * Load the test button configuration |
|
49 | + * |
|
50 | + * @param \Xmf\Module\Admin $adminObject |
|
51 | + * |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + public static function loadButtonConfig($adminObject): void |
|
55 | + { |
|
56 | + $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
57 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
58 | + $helper = Helper::getInstance(); |
|
59 | + $yamlFile = $helper->path('/config/admin.yml'); |
|
60 | + /** @var array $config */ |
|
61 | + $config = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps |
|
62 | + $displaySampleButton = $config['displaySampleButton']; |
|
63 | 63 | |
64 | - if (self::SHOW_BUTTONS == $displaySampleButton) { |
|
65 | - \xoops_loadLanguage('admin/modulesadmin', 'system'); |
|
66 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add'); |
|
67 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add'); |
|
68 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert'); |
|
69 | - // $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), $helper->url( 'testdata/index.php?op=exportschema'), 'add'); |
|
70 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete'); |
|
71 | - } else { |
|
72 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add'); |
|
73 | - // $displaySampleButton = $config['displaySampleButton']; |
|
74 | - } |
|
75 | - } |
|
64 | + if (self::SHOW_BUTTONS == $displaySampleButton) { |
|
65 | + \xoops_loadLanguage('admin/modulesadmin', 'system'); |
|
66 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add'); |
|
67 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add'); |
|
68 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert'); |
|
69 | + // $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), $helper->url( 'testdata/index.php?op=exportschema'), 'add'); |
|
70 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete'); |
|
71 | + } else { |
|
72 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add'); |
|
73 | + // $displaySampleButton = $config['displaySampleButton']; |
|
74 | + } |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * Hide the test buttons |
|
79 | - * |
|
80 | - * @return void |
|
81 | - */ |
|
82 | - public static function hideButtons(): void |
|
83 | - { |
|
84 | - $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
85 | - $app = []; |
|
86 | - $app['displaySampleButton'] = 0; |
|
87 | - Yaml::save($app, $yamlFile); |
|
88 | - \redirect_header('index.php', 0, ''); |
|
89 | - } |
|
77 | + /** |
|
78 | + * Hide the test buttons |
|
79 | + * |
|
80 | + * @return void |
|
81 | + */ |
|
82 | + public static function hideButtons(): void |
|
83 | + { |
|
84 | + $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
85 | + $app = []; |
|
86 | + $app['displaySampleButton'] = 0; |
|
87 | + Yaml::save($app, $yamlFile); |
|
88 | + \redirect_header('index.php', 0, ''); |
|
89 | + } |
|
90 | 90 | |
91 | - /** |
|
92 | - * Show the test buttons |
|
93 | - * |
|
94 | - * @return void |
|
95 | - */ |
|
96 | - public static function showButtons(): void |
|
97 | - { |
|
98 | - $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
99 | - $app = []; |
|
100 | - $app['displaySampleButton'] = 1; |
|
101 | - Yaml::save($app, $yamlFile); |
|
102 | - \redirect_header('index.php', 0, ''); |
|
103 | - } |
|
91 | + /** |
|
92 | + * Show the test buttons |
|
93 | + * |
|
94 | + * @return void |
|
95 | + */ |
|
96 | + public static function showButtons(): void |
|
97 | + { |
|
98 | + $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
99 | + $app = []; |
|
100 | + $app['displaySampleButton'] = 1; |
|
101 | + Yaml::save($app, $yamlFile); |
|
102 | + \redirect_header('index.php', 0, ''); |
|
103 | + } |
|
104 | 104 | } |
@@ -19,60 +19,60 @@ |
||
19 | 19 | */ |
20 | 20 | trait ServerStats |
21 | 21 | { |
22 | - /** |
|
23 | - * serverStats() |
|
24 | - * |
|
25 | - * @return string |
|
26 | - */ |
|
27 | - public static function getServerStats() |
|
28 | - { |
|
29 | - //mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
30 | - $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
31 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
32 | - \xoops_loadLanguage('common', $moduleDirName); |
|
33 | - $html = ''; |
|
34 | - // $sql = 'SELECT metavalue'; |
|
35 | - // $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
36 | - // $sql .= " WHERE metakey='version' LIMIT 1"; |
|
37 | - // $query = $GLOBALS['xoopsDB']->query($sql); |
|
38 | - // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
39 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
40 | - $html .= "<div style='padding: 8px;'>\n"; |
|
41 | - // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
|
42 | - // $html .= "<br>\n"; |
|
43 | - // $html .= "<br>\n"; |
|
44 | - $html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
45 | - $html .= "<ul>\n"; |
|
22 | + /** |
|
23 | + * serverStats() |
|
24 | + * |
|
25 | + * @return string |
|
26 | + */ |
|
27 | + public static function getServerStats() |
|
28 | + { |
|
29 | + //mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
30 | + $moduleDirName = \basename(\dirname(__DIR__, 2)); |
|
31 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
32 | + \xoops_loadLanguage('common', $moduleDirName); |
|
33 | + $html = ''; |
|
34 | + // $sql = 'SELECT metavalue'; |
|
35 | + // $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
36 | + // $sql .= " WHERE metakey='version' LIMIT 1"; |
|
37 | + // $query = $GLOBALS['xoopsDB']->query($sql); |
|
38 | + // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
39 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
40 | + $html .= "<div style='padding: 8px;'>\n"; |
|
41 | + // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
|
42 | + // $html .= "<br>\n"; |
|
43 | + // $html .= "<br>\n"; |
|
44 | + $html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
45 | + $html .= "<ul>\n"; |
|
46 | 46 | |
47 | - $gdlib = \function_exists('gd_info') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
48 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
49 | - if (\function_exists('gd_info')) { |
|
50 | - if (true === ($gdlib = gd_info())) { |
|
51 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
52 | - } |
|
53 | - } |
|
54 | - // |
|
55 | - // $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF'); |
|
56 | - // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode; |
|
57 | - // |
|
58 | - // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
|
59 | - // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
|
60 | - // |
|
61 | - $downloads = \ini_get('file_uploads') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
62 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
47 | + $gdlib = \function_exists('gd_info') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
48 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
49 | + if (\function_exists('gd_info')) { |
|
50 | + if (true === ($gdlib = gd_info())) { |
|
51 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
52 | + } |
|
53 | + } |
|
54 | + // |
|
55 | + // $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF'); |
|
56 | + // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode; |
|
57 | + // |
|
58 | + // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
|
59 | + // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
|
60 | + // |
|
61 | + $downloads = \ini_get('file_uploads') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
62 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
63 | 63 | |
64 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . \ini_get('upload_max_filesize') . "</span></b>\n"; |
|
65 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . \ini_get('post_max_size') . "</span></b>\n"; |
|
66 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . \ini_get('memory_limit') . "</span></b>\n"; |
|
67 | - $html .= "</ul>\n"; |
|
68 | - $html .= "<ul>\n"; |
|
69 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
70 | - $html .= "</ul>\n"; |
|
71 | - $html .= "<br>\n"; |
|
72 | - $html .= \constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
73 | - $html .= '</div>'; |
|
74 | - $html .= '</fieldset><br>'; |
|
64 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . \ini_get('upload_max_filesize') . "</span></b>\n"; |
|
65 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . \ini_get('post_max_size') . "</span></b>\n"; |
|
66 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . \ini_get('memory_limit') . "</span></b>\n"; |
|
67 | + $html .= "</ul>\n"; |
|
68 | + $html .= "<ul>\n"; |
|
69 | + $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
70 | + $html .= "</ul>\n"; |
|
71 | + $html .= "<br>\n"; |
|
72 | + $html .= \constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
73 | + $html .= '</div>'; |
|
74 | + $html .= '</fieldset><br>'; |
|
75 | 75 | |
76 | - return $html; |
|
77 | - } |
|
76 | + return $html; |
|
77 | + } |
|
78 | 78 | } |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | // $sql .= " WHERE metakey='version' LIMIT 1"; |
37 | 37 | // $query = $GLOBALS['xoopsDB']->query($sql); |
38 | 38 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
39 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
39 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>".\constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO')."</legend>\n"; |
|
40 | 40 | $html .= "<div style='padding: 8px;'>\n"; |
41 | 41 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
42 | 42 | // $html .= "<br>\n"; |
43 | 43 | // $html .= "<br>\n"; |
44 | - $html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
44 | + $html .= '<div>'.\constant('CO_'.$moduleDirNameUpper.'_SPHPINI')."</div>\n"; |
|
45 | 45 | $html .= "<ul>\n"; |
46 | 46 | |
47 | - $gdlib = \function_exists('gd_info') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
48 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
47 | + $gdlib = \function_exists('gd_info') ? '<span style="color: green;">'.\constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: red;">'.\constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
48 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
49 | 49 | if (\function_exists('gd_info')) { |
50 | 50 | if (true === ($gdlib = gd_info())) { |
51 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
51 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | // |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
59 | 59 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
60 | 60 | // |
61 | - $downloads = \ini_get('file_uploads') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
62 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
61 | + $downloads = \ini_get('file_uploads') ? '<span style="color: green;">'.\constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: red;">'.\constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
62 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
63 | 63 | |
64 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . \ini_get('upload_max_filesize') . "</span></b>\n"; |
|
65 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . \ini_get('post_max_size') . "</span></b>\n"; |
|
66 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . \ini_get('memory_limit') . "</span></b>\n"; |
|
64 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: blue;">'.\ini_get('upload_max_filesize')."</span></b>\n"; |
|
65 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: blue;">'.\ini_get('post_max_size')."</span></b>\n"; |
|
66 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: blue;">'.\ini_get('memory_limit')."</span></b>\n"; |
|
67 | 67 | $html .= "</ul>\n"; |
68 | 68 | $html .= "<ul>\n"; |
69 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
69 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH."</b>\n"; |
|
70 | 70 | $html .= "</ul>\n"; |
71 | 71 | $html .= "<br>\n"; |
72 | - $html .= \constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
72 | + $html .= \constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC')."\n"; |
|
73 | 73 | $html .= '</div>'; |
74 | 74 | $html .= '</fieldset><br>'; |
75 | 75 |