@@ -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 | } |
@@ -14,36 +14,36 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function b_myiframe_iframe_show($options) |
16 | 16 | { |
17 | - $block = []; |
|
18 | - $tblalign = [ |
|
19 | - 'top', |
|
20 | - 'middle', |
|
21 | - 'bottom', |
|
22 | - 'left', |
|
23 | - 'rigth', |
|
24 | - ]; |
|
25 | - $tblscrolling = [ |
|
26 | - 'yes', |
|
27 | - 'no', |
|
28 | - 'auto', |
|
29 | - ]; |
|
30 | - $iframeHandler = $helper->getHandler('MyiframeBase'); |
|
31 | - $frame = null; |
|
32 | - $frame = $iframeHandler->get($options[0]); |
|
17 | + $block = []; |
|
18 | + $tblalign = [ |
|
19 | + 'top', |
|
20 | + 'middle', |
|
21 | + 'bottom', |
|
22 | + 'left', |
|
23 | + 'rigth', |
|
24 | + ]; |
|
25 | + $tblscrolling = [ |
|
26 | + 'yes', |
|
27 | + 'no', |
|
28 | + 'auto', |
|
29 | + ]; |
|
30 | + $iframeHandler = $helper->getHandler('MyiframeBase'); |
|
31 | + $frame = null; |
|
32 | + $frame = $iframeHandler->get($options[0]); |
|
33 | 33 | |
34 | - if (is_object($frame)) { |
|
35 | - $block['longdesc'] = $frame->getVar('frame_description'); |
|
36 | - $block['width'] = $frame->getVar('frame_width'); |
|
37 | - $block['height'] = $frame->getVar('frame_height'); |
|
38 | - $block['align'] = $tblalign[$frame->getVar('frame_align') - 1]; |
|
39 | - $block['frameborder'] = $frame->getVar('frame_frameborder'); |
|
40 | - $block['marginwidth'] = $frame->getVar('frame_marginwidth'); |
|
41 | - $block['marginheight'] = $frame->getVar('frame_marginheight'); |
|
42 | - $block['scrolling'] = $tblscrolling[$frame->getVar('frame_scrolling') - 1]; |
|
43 | - $block['url'] = $frame->getVar('frame_url'); |
|
44 | - } |
|
34 | + if (is_object($frame)) { |
|
35 | + $block['longdesc'] = $frame->getVar('frame_description'); |
|
36 | + $block['width'] = $frame->getVar('frame_width'); |
|
37 | + $block['height'] = $frame->getVar('frame_height'); |
|
38 | + $block['align'] = $tblalign[$frame->getVar('frame_align') - 1]; |
|
39 | + $block['frameborder'] = $frame->getVar('frame_frameborder'); |
|
40 | + $block['marginwidth'] = $frame->getVar('frame_marginwidth'); |
|
41 | + $block['marginheight'] = $frame->getVar('frame_marginheight'); |
|
42 | + $block['scrolling'] = $tblscrolling[$frame->getVar('frame_scrolling') - 1]; |
|
43 | + $block['url'] = $frame->getVar('frame_url'); |
|
44 | + } |
|
45 | 45 | |
46 | - return $block; |
|
46 | + return $block; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -52,25 +52,25 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function b_myiframe_iframe_edit($options) |
54 | 54 | { |
55 | - /** @var \MyiframeBaseHandler $iframeHandler */ |
|
56 | - $iframeHandler = $helper->getHandler('MyiframeBase'); |
|
57 | - $frarray = []; |
|
58 | - $critere = new \Criteria('1', '1', '='); |
|
59 | - $critere->setSort('frame_description'); |
|
60 | - $frarray = $iframeHandler->getObjects($critere); |
|
55 | + /** @var \MyiframeBaseHandler $iframeHandler */ |
|
56 | + $iframeHandler = $helper->getHandler('MyiframeBase'); |
|
57 | + $frarray = []; |
|
58 | + $critere = new \Criteria('1', '1', '='); |
|
59 | + $critere->setSort('frame_description'); |
|
60 | + $frarray = $iframeHandler->getObjects($critere); |
|
61 | 61 | |
62 | - $form = '' . _MB_MYIFRAME_IFRAME . " <select name='options[0]'>"; |
|
63 | - /** @var Myiframe $oneframe */ |
|
64 | - foreach ($frarray as $oneframe) { |
|
65 | - $form .= "<option value='" . $oneframe->getVar('frame_frameid') . "'"; |
|
66 | - if ($options[0] == $oneframe->getVar('frame_frameid')) { |
|
67 | - $form .= " selected='selected'"; |
|
68 | - } |
|
69 | - $form .= '>' . $oneframe->getVar('frame_description') . '</option>'; |
|
70 | - } |
|
71 | - $form .= "</select>\n"; |
|
62 | + $form = '' . _MB_MYIFRAME_IFRAME . " <select name='options[0]'>"; |
|
63 | + /** @var Myiframe $oneframe */ |
|
64 | + foreach ($frarray as $oneframe) { |
|
65 | + $form .= "<option value='" . $oneframe->getVar('frame_frameid') . "'"; |
|
66 | + if ($options[0] == $oneframe->getVar('frame_frameid')) { |
|
67 | + $form .= " selected='selected'"; |
|
68 | + } |
|
69 | + $form .= '>' . $oneframe->getVar('frame_description') . '</option>'; |
|
70 | + } |
|
71 | + $form .= "</select>\n"; |
|
72 | 72 | |
73 | - return $form; |
|
73 | + return $form; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | */ |
79 | 79 | function b_myiframe_iframe_onthefly($options): void |
80 | 80 | { |
81 | - $options = explode('|', $options); |
|
82 | - $block = b_myiframe_iframe_show($options); |
|
81 | + $options = explode('|', $options); |
|
82 | + $block = b_myiframe_iframe_show($options); |
|
83 | 83 | |
84 | - $tpl = new \XoopsTpl(); |
|
85 | - $tpl->assign('block', $block); |
|
86 | - $tpl->display('db:myiframe_block_show.tpl'); |
|
84 | + $tpl = new \XoopsTpl(); |
|
85 | + $tpl->assign('block', $block); |
|
86 | + $tpl->display('db:myiframe_block_show.tpl'); |
|
87 | 87 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * Copyright (c) Hervé Thouzard of Instant Zero (https://www.instant-zero.com) |
7 | 7 | * **************************************************************************** |
8 | 8 | */ |
9 | -require_once XOOPS_ROOT_PATH . '/modules/myiframe/include/functions.php'; |
|
9 | +require_once XOOPS_ROOT_PATH.'/modules/myiframe/include/functions.php'; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param $options |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | 'left', |
23 | 23 | 'rigth', |
24 | 24 | ]; |
25 | - $tblscrolling = [ |
|
25 | + $tblscrolling = [ |
|
26 | 26 | 'yes', |
27 | 27 | 'no', |
28 | 28 | 'auto', |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | $block['longdesc'] = $frame->getVar('frame_description'); |
36 | 36 | $block['width'] = $frame->getVar('frame_width'); |
37 | 37 | $block['height'] = $frame->getVar('frame_height'); |
38 | - $block['align'] = $tblalign[$frame->getVar('frame_align') - 1]; |
|
38 | + $block['align'] = $tblalign[$frame->getVar('frame_align')-1]; |
|
39 | 39 | $block['frameborder'] = $frame->getVar('frame_frameborder'); |
40 | 40 | $block['marginwidth'] = $frame->getVar('frame_marginwidth'); |
41 | 41 | $block['marginheight'] = $frame->getVar('frame_marginheight'); |
42 | - $block['scrolling'] = $tblscrolling[$frame->getVar('frame_scrolling') - 1]; |
|
42 | + $block['scrolling'] = $tblscrolling[$frame->getVar('frame_scrolling')-1]; |
|
43 | 43 | $block['url'] = $frame->getVar('frame_url'); |
44 | 44 | } |
45 | 45 | |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | $critere->setSort('frame_description'); |
60 | 60 | $frarray = $iframeHandler->getObjects($critere); |
61 | 61 | |
62 | - $form = '' . _MB_MYIFRAME_IFRAME . " <select name='options[0]'>"; |
|
62 | + $form = ''._MB_MYIFRAME_IFRAME." <select name='options[0]'>"; |
|
63 | 63 | /** @var Myiframe $oneframe */ |
64 | 64 | foreach ($frarray as $oneframe) { |
65 | - $form .= "<option value='" . $oneframe->getVar('frame_frameid') . "'"; |
|
65 | + $form .= "<option value='".$oneframe->getVar('frame_frameid')."'"; |
|
66 | 66 | if ($options[0] == $oneframe->getVar('frame_frameid')) { |
67 | 67 | $form .= " selected='selected'"; |
68 | 68 | } |
69 | - $form .= '>' . $oneframe->getVar('frame_description') . '</option>'; |
|
69 | + $form .= '>'.$oneframe->getVar('frame_description').'</option>'; |
|
70 | 70 | } |
71 | 71 | $form .= "</select>\n"; |
72 | 72 |
@@ -16,81 +16,81 @@ |
||
16 | 16 | |
17 | 17 | $suplparam = ''; |
18 | 18 | if (isset($_GET)) { |
19 | - foreach ($_GET as $k => $v) { |
|
20 | - if ('IFRAMEID' !== \mb_strtoupper(trim($k))) { |
|
21 | - $suplparam .= $k . '=' . $v . '&'; |
|
22 | - } |
|
23 | - } |
|
19 | + foreach ($_GET as $k => $v) { |
|
20 | + if ('IFRAMEID' !== \mb_strtoupper(trim($k))) { |
|
21 | + $suplparam .= $k . '=' . $v . '&'; |
|
22 | + } |
|
23 | + } |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | if (mb_strlen(xoops_trim($suplparam)) > 0) { |
27 | - $suplparam = mb_substr($suplparam, 0, -1); |
|
27 | + $suplparam = mb_substr($suplparam, 0, -1); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** @var \MyiframeBaseHandler $iframeHandler */ |
31 | 31 | $iframeHandler = $helper->getHandler('MyiframeBase'); |
32 | 32 | |
33 | 33 | if (Request::hasVar('iframeid', 'GET')) { |
34 | - $tblalign = [ |
|
35 | - 'top', |
|
36 | - 'middle', |
|
37 | - 'bottom', |
|
38 | - 'left', |
|
39 | - 'rigth', |
|
40 | - ]; |
|
41 | - $tblscrolling = [ |
|
42 | - 'yes', |
|
43 | - 'no', |
|
44 | - 'auto', |
|
45 | - ]; |
|
46 | - $frameid = Request::getInt('iframeid', 0, 'GET'); |
|
34 | + $tblalign = [ |
|
35 | + 'top', |
|
36 | + 'middle', |
|
37 | + 'bottom', |
|
38 | + 'left', |
|
39 | + 'rigth', |
|
40 | + ]; |
|
41 | + $tblscrolling = [ |
|
42 | + 'yes', |
|
43 | + 'no', |
|
44 | + 'auto', |
|
45 | + ]; |
|
46 | + $frameid = Request::getInt('iframeid', 0, 'GET'); |
|
47 | 47 | |
48 | - $frame = $iframeHandler->get($frameid); |
|
48 | + $frame = $iframeHandler->get($frameid); |
|
49 | 49 | |
50 | - if (is_object($frame)) { |
|
51 | - $iframeHandler->updatehits($frameid); |
|
52 | - $xoopsTpl->assign('frameok', true); |
|
53 | - $xoopsTpl->assign('longdesc', $frame->getVar('frame_description')); |
|
54 | - $xoopsTpl->assign('width', $frame->getVar('frame_width')); |
|
55 | - $xoopsTpl->assign('height', $frame->getVar('frame_height')); |
|
56 | - $xoopsTpl->assign('align', $tblalign[$frame->getVar('frame_align') - 1]); |
|
57 | - $xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder')); |
|
58 | - $xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth')); |
|
59 | - $xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight')); |
|
60 | - $xoopsTpl->assign('scrolling', $tblscrolling[$frame->getVar('frame_scrolling') - 1]); |
|
61 | - if ('' !== xoops_trim($suplparam)) { |
|
62 | - $xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam); |
|
63 | - } else { |
|
64 | - $xoopsTpl->assign('url', $frame->getVar('frame_url')); |
|
65 | - } |
|
66 | - $title = $frame->getVar('frame_description'); |
|
67 | - myiframe_set_metas($title, $title); |
|
68 | - } else { |
|
69 | - $xoopsTpl->assign('frameok', false); |
|
70 | - $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR); |
|
71 | - } |
|
50 | + if (is_object($frame)) { |
|
51 | + $iframeHandler->updatehits($frameid); |
|
52 | + $xoopsTpl->assign('frameok', true); |
|
53 | + $xoopsTpl->assign('longdesc', $frame->getVar('frame_description')); |
|
54 | + $xoopsTpl->assign('width', $frame->getVar('frame_width')); |
|
55 | + $xoopsTpl->assign('height', $frame->getVar('frame_height')); |
|
56 | + $xoopsTpl->assign('align', $tblalign[$frame->getVar('frame_align') - 1]); |
|
57 | + $xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder')); |
|
58 | + $xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth')); |
|
59 | + $xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight')); |
|
60 | + $xoopsTpl->assign('scrolling', $tblscrolling[$frame->getVar('frame_scrolling') - 1]); |
|
61 | + if ('' !== xoops_trim($suplparam)) { |
|
62 | + $xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam); |
|
63 | + } else { |
|
64 | + $xoopsTpl->assign('url', $frame->getVar('frame_url')); |
|
65 | + } |
|
66 | + $title = $frame->getVar('frame_description'); |
|
67 | + myiframe_set_metas($title, $title); |
|
68 | + } else { |
|
69 | + $xoopsTpl->assign('frameok', false); |
|
70 | + $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR); |
|
71 | + } |
|
72 | 72 | } else { |
73 | - if (myiframe_getmoduleoption('showlist')) { |
|
74 | - $baseurl = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php'; |
|
75 | - $frarray = []; |
|
76 | - $critere = new \Criteria('1', '1', '='); |
|
77 | - $critere->setSort('frame_description'); |
|
78 | - $frarray = $iframeHandler->getObjects($critere); |
|
79 | - if (count($frarray) > 0) { |
|
80 | - foreach ($frarray as $frame) { |
|
81 | - /** @var Myiframe $frame */ |
|
82 | - if ('' === xoops_trim($frame->getVar('frame_description'))) { |
|
83 | - $liendesc = $frame->getVar('frame_url'); |
|
84 | - } else { |
|
85 | - $liendesc = "<a href='" . $baseurl . '?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . '</a>'; |
|
86 | - } |
|
87 | - $iframe['list'] = $liendesc; |
|
88 | - $xoopsTpl->append('iframes', $iframe); |
|
89 | - } |
|
90 | - } |
|
91 | - } else { |
|
92 | - $xoopsTpl->assign('frameok', false); |
|
93 | - $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR); |
|
94 | - } |
|
73 | + if (myiframe_getmoduleoption('showlist')) { |
|
74 | + $baseurl = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php'; |
|
75 | + $frarray = []; |
|
76 | + $critere = new \Criteria('1', '1', '='); |
|
77 | + $critere->setSort('frame_description'); |
|
78 | + $frarray = $iframeHandler->getObjects($critere); |
|
79 | + if (count($frarray) > 0) { |
|
80 | + foreach ($frarray as $frame) { |
|
81 | + /** @var Myiframe $frame */ |
|
82 | + if ('' === xoops_trim($frame->getVar('frame_description'))) { |
|
83 | + $liendesc = $frame->getVar('frame_url'); |
|
84 | + } else { |
|
85 | + $liendesc = "<a href='" . $baseurl . '?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . '</a>'; |
|
86 | + } |
|
87 | + $iframe['list'] = $liendesc; |
|
88 | + $xoopsTpl->append('iframes', $iframe); |
|
89 | + } |
|
90 | + } |
|
91 | + } else { |
|
92 | + $xoopsTpl->assign('frameok', false); |
|
93 | + $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR); |
|
94 | + } |
|
95 | 95 | } |
96 | 96 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | |
12 | 12 | |
13 | 13 | $GLOBALS['xoopsOption']['template_main'] = 'myiframe.tpl'; |
14 | -require __DIR__ . '/header.php'; |
|
15 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
14 | +require __DIR__.'/header.php'; |
|
15 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
16 | 16 | |
17 | 17 | $suplparam = ''; |
18 | 18 | if (isset($_GET)) { |
19 | 19 | foreach ($_GET as $k => $v) { |
20 | 20 | if ('IFRAMEID' !== \mb_strtoupper(trim($k))) { |
21 | - $suplparam .= $k . '=' . $v . '&'; |
|
21 | + $suplparam .= $k.'='.$v.'&'; |
|
22 | 22 | } |
23 | 23 | } |
24 | 24 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $iframeHandler = $helper->getHandler('MyiframeBase'); |
32 | 32 | |
33 | 33 | if (Request::hasVar('iframeid', 'GET')) { |
34 | - $tblalign = [ |
|
34 | + $tblalign = [ |
|
35 | 35 | 'top', |
36 | 36 | 'middle', |
37 | 37 | 'bottom', |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'no', |
44 | 44 | 'auto', |
45 | 45 | ]; |
46 | - $frameid = Request::getInt('iframeid', 0, 'GET'); |
|
46 | + $frameid = Request::getInt('iframeid', 0, 'GET'); |
|
47 | 47 | |
48 | 48 | $frame = $iframeHandler->get($frameid); |
49 | 49 | |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | $xoopsTpl->assign('longdesc', $frame->getVar('frame_description')); |
54 | 54 | $xoopsTpl->assign('width', $frame->getVar('frame_width')); |
55 | 55 | $xoopsTpl->assign('height', $frame->getVar('frame_height')); |
56 | - $xoopsTpl->assign('align', $tblalign[$frame->getVar('frame_align') - 1]); |
|
56 | + $xoopsTpl->assign('align', $tblalign[$frame->getVar('frame_align')-1]); |
|
57 | 57 | $xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder')); |
58 | 58 | $xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth')); |
59 | 59 | $xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight')); |
60 | - $xoopsTpl->assign('scrolling', $tblscrolling[$frame->getVar('frame_scrolling') - 1]); |
|
60 | + $xoopsTpl->assign('scrolling', $tblscrolling[$frame->getVar('frame_scrolling')-1]); |
|
61 | 61 | if ('' !== xoops_trim($suplparam)) { |
62 | - $xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam); |
|
62 | + $xoopsTpl->assign('url', $frame->getVar('frame_url').'?'.$suplparam); |
|
63 | 63 | } else { |
64 | 64 | $xoopsTpl->assign('url', $frame->getVar('frame_url')); |
65 | 65 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | } else { |
73 | 73 | if (myiframe_getmoduleoption('showlist')) { |
74 | - $baseurl = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php'; |
|
74 | + $baseurl = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php'; |
|
75 | 75 | $frarray = []; |
76 | 76 | $critere = new \Criteria('1', '1', '='); |
77 | 77 | $critere->setSort('frame_description'); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | if ('' === xoops_trim($frame->getVar('frame_description'))) { |
83 | 83 | $liendesc = $frame->getVar('frame_url'); |
84 | 84 | } else { |
85 | - $liendesc = "<a href='" . $baseurl . '?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . '</a>'; |
|
85 | + $liendesc = "<a href='".$baseurl.'?iframeid='.$frame->getVar('frame_frameid')."'>".$frame->getVar('frame_description').'</a>'; |
|
86 | 86 | } |
87 | 87 | $iframe['list'] = $liendesc; |
88 | 88 | $xoopsTpl->append('iframes', $iframe); |
@@ -93,4 +93,4 @@ discard block |
||
93 | 93 | $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR); |
94 | 94 | } |
95 | 95 | } |
96 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
96 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -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 | } |
@@ -27,28 +27,28 @@ |
||
27 | 27 | */ |
28 | 28 | final class Constants |
29 | 29 | { |
30 | - /**#@+ |
|
30 | + /**#@+ |
|
31 | 31 | * Constant definition |
32 | 32 | */ |
33 | 33 | |
34 | - const DISALLOW = 0; |
|
35 | - |
|
36 | - /** |
|
37 | - * no delay XOOPS redirect delay (in seconds) |
|
38 | - */ |
|
39 | - const REDIRECT_DELAY_NONE = 0; |
|
40 | - /** |
|
41 | - * short XOOPS redirect delay (in seconds) |
|
42 | - */ |
|
43 | - const REDIRECT_DELAY_SHORT = 1; |
|
44 | - /** |
|
45 | - * medium XOOPS redirect delay (in seconds) |
|
46 | - */ |
|
47 | - const REDIRECT_DELAY_MEDIUM = 3; |
|
48 | - /** |
|
49 | - * long XOOPS redirect delay (in seconds) |
|
50 | - */ |
|
51 | - const REDIRECT_DELAY_LONG = 7; |
|
52 | - |
|
53 | - /**#@-*/ |
|
34 | + const DISALLOW = 0; |
|
35 | + |
|
36 | + /** |
|
37 | + * no delay XOOPS redirect delay (in seconds) |
|
38 | + */ |
|
39 | + const REDIRECT_DELAY_NONE = 0; |
|
40 | + /** |
|
41 | + * short XOOPS redirect delay (in seconds) |
|
42 | + */ |
|
43 | + const REDIRECT_DELAY_SHORT = 1; |
|
44 | + /** |
|
45 | + * medium XOOPS redirect delay (in seconds) |
|
46 | + */ |
|
47 | + const REDIRECT_DELAY_MEDIUM = 3; |
|
48 | + /** |
|
49 | + * long XOOPS redirect delay (in seconds) |
|
50 | + */ |
|
51 | + const REDIRECT_DELAY_LONG = 7; |
|
52 | + |
|
53 | + /**#@-*/ |
|
54 | 54 | } |
@@ -23,60 +23,60 @@ |
||
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 | - * @return \XoopsModules\Myiframe\Helper |
|
40 | - */ |
|
41 | - public static function getInstance(bool $debug = false): self |
|
42 | - { |
|
43 | - static $instance; |
|
44 | - if (null === $instance) { |
|
45 | - $instance = new static($debug); |
|
46 | - } |
|
38 | + /** |
|
39 | + * @return \XoopsModules\Myiframe\Helper |
|
40 | + */ |
|
41 | + public static function getInstance(bool $debug = false): self |
|
42 | + { |
|
43 | + static $instance; |
|
44 | + if (null === $instance) { |
|
45 | + $instance = new static($debug); |
|
46 | + } |
|
47 | 47 | |
48 | - return $instance; |
|
49 | - } |
|
48 | + return $instance; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return string |
|
53 | - */ |
|
54 | - public function getDirname() |
|
55 | - { |
|
56 | - return $this->dirname; |
|
57 | - } |
|
51 | + /** |
|
52 | + * @return string |
|
53 | + */ |
|
54 | + public function getDirname() |
|
55 | + { |
|
56 | + return $this->dirname; |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * Get an Object Handler |
|
61 | - * |
|
62 | - * @param string $name name of handler to load |
|
63 | - * |
|
64 | - * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
65 | - */ |
|
66 | - public function getHandler($name) |
|
67 | - { |
|
68 | - $ret = false; |
|
59 | + /** |
|
60 | + * Get an Object Handler |
|
61 | + * |
|
62 | + * @param string $name name of handler to load |
|
63 | + * |
|
64 | + * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
65 | + */ |
|
66 | + public function getHandler($name) |
|
67 | + { |
|
68 | + $ret = false; |
|
69 | 69 | |
70 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
71 | - if (!\class_exists($class)) { |
|
72 | - throw new \RuntimeException("Class '$class' not found"); |
|
73 | - } |
|
74 | - /** @var \XoopsMySQLDatabase $db */ |
|
75 | - $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
76 | - $helper = self::getInstance(); |
|
77 | - $ret = new $class($db, $helper); |
|
78 | - $this->addLog("Getting handler '{$name}'"); |
|
70 | + $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
71 | + if (!\class_exists($class)) { |
|
72 | + throw new \RuntimeException("Class '$class' not found"); |
|
73 | + } |
|
74 | + /** @var \XoopsMySQLDatabase $db */ |
|
75 | + $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
76 | + $helper = self::getInstance(); |
|
77 | + $ret = new $class($db, $helper); |
|
78 | + $this->addLog("Getting handler '{$name}'"); |
|
79 | 79 | |
80 | - return $ret; |
|
81 | - } |
|
80 | + return $ret; |
|
81 | + } |
|
82 | 82 | } |
@@ -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 | } |
@@ -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 | } |