@@ -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; |
@@ -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 | } |
@@ -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 | } |
@@ -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); |
@@ -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 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder)); |
33 | 33 | } |
34 | 34 | |
35 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
35 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
36 | 36 | } |
37 | 37 | } catch (\Throwable $e) { |
38 | 38 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | $dir = \opendir($src); |
58 | 58 | // @mkdir($dst); |
59 | 59 | if (!@\mkdir($dst) && !\is_dir($dst)) { |
60 | - throw new \RuntimeException('The directory ' . $dst . ' could not be created.'); |
|
60 | + throw new \RuntimeException('The directory '.$dst.' could not be created.'); |
|
61 | 61 | } |
62 | 62 | while (false !== ($file = \readdir($dir))) { |
63 | 63 | if (('.' !== $file) && ('..' !== $file)) { |
64 | - if (\is_dir($src . '/' . $file)) { |
|
65 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
64 | + if (\is_dir($src.'/'.$file)) { |
|
65 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
66 | 66 | } else { |
67 | - \copy($src . '/' . $file, $dst . '/' . $file); |
|
67 | + \copy($src.'/'.$file, $dst.'/'.$file); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | self::rrmdir($fObj->getPathname()); |
155 | 155 | } |
156 | 156 | } |
157 | - $iterator = null; // clear iterator Obj to close file/directory |
|
157 | + $iterator = null; // clear iterator Obj to close file/directory |
|
158 | 158 | |
159 | 159 | return \rmdir($src); // remove the directory & return results |
160 | 160 | } |
@@ -188,14 +188,14 @@ discard block |
||
188 | 188 | $iterator = new \DirectoryIterator($src); |
189 | 189 | foreach ($iterator as $fObj) { |
190 | 190 | if ($fObj->isFile()) { |
191 | - \rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
191 | + \rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
192 | 192 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
193 | 193 | // Try recursively on directory |
194 | - self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
194 | + self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
195 | 195 | // rmdir($fObj->getPath()); // now delete the directory |
196 | 196 | } |
197 | 197 | } |
198 | - $iterator = null; // clear iterator Obj to close file/directory |
|
198 | + $iterator = null; // clear iterator Obj to close file/directory |
|
199 | 199 | |
200 | 200 | return \rmdir($src); // remove the directory & return results |
201 | 201 | } |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | $iterator = new \DirectoryIterator($src); |
233 | 233 | foreach ($iterator as $fObj) { |
234 | 234 | if ($fObj->isFile()) { |
235 | - \copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
235 | + \copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
236 | 236 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
237 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
237 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() |
45 | 45 | { |
46 | - $config = require \dirname(__DIR__, 2) . '/config/config.php'; |
|
46 | + $config = require \dirname(__DIR__, 2).'/config/config.php'; |
|
47 | 47 | |
48 | 48 | $this->name = $config->name; |
49 | 49 | $this->paths = $config->paths; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->moduleStats = $config->moduleStats; |
59 | 59 | $this->modCopyright = $config->modCopyright; |
60 | 60 | |
61 | - $this->icons = require \dirname(__DIR__, 2) . '/config/icons.php'; |
|
62 | - $this->paths = require \dirname(__DIR__, 2) . '/config/paths.php'; |
|
61 | + $this->icons = require \dirname(__DIR__, 2).'/config/icons.php'; |
|
62 | + $this->paths = require \dirname(__DIR__, 2).'/config/paths.php'; |
|
63 | 63 | } |
64 | 64 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function listBlocks(): void |
69 | 69 | { |
70 | 70 | global $xoopsModule, $pathIcon16; |
71 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
71 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
72 | 72 | // xoops_loadLanguage('admin', 'system'); |
73 | 73 | // xoops_loadLanguage('admin/blocksadmin', 'system'); |
74 | 74 | // xoops_loadLanguage('admin/groups', 'system'); |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | $moduleList[-1] = \_AM_SYSTEM_BLOCKS_TOPPAGE; |
89 | 89 | $moduleList[0] = \_AM_SYSTEM_BLOCKS_ALLPAGES; |
90 | 90 | \ksort($moduleList); |
91 | - echo "<h4 style='text-align:left;'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</h4>'; |
|
92 | - echo "<form action='" . $_SERVER['SCRIPT_NAME'] . "' name='blockadmin' method='post'>"; |
|
91 | + echo "<h4 style='text-align:left;'>".\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</h4>'; |
|
92 | + echo "<form action='".$_SERVER['SCRIPT_NAME']."' name='blockadmin' method='post'>"; |
|
93 | 93 | echo $GLOBALS['xoopsSecurity']->getTokenHTML(); |
94 | 94 | echo "<table width='100%' class='outer' cellpadding='4' cellspacing='1'> |
95 | - <tr valign='middle'><th align='center'>" . \_AM_SYSTEM_BLOCKS_TITLE . "</th><th align='center' nowrap='nowrap'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'SIDE') . '<br>' . _LEFT . '-' . _CENTER . '-' . _RIGHT . "</th> |
|
96 | - <th align='center'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT') . "</th> |
|
97 | - <th align='center'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE') . "</th><th align='center'>" . \_AM_SYSTEM_BLOCKS_VISIBLEIN . "</th> |
|
98 | - <th align='center'>" . \_AM_SYSTEM_ADGS . "</th> |
|
99 | - <th align='center'>" . \_AM_SYSTEM_BLOCKS_BCACHETIME . "</th> |
|
100 | - <th align='center'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'ACTION') . '</th> |
|
95 | + <tr valign='middle'><th align='center'>" . \_AM_SYSTEM_BLOCKS_TITLE."</th><th align='center' nowrap='nowrap'>".\constant('CO_'.$this->moduleDirNameUpper.'_'.'SIDE').'<br>'._LEFT.'-'._CENTER.'-'._RIGHT."</th> |
|
96 | + <th align='center'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'WEIGHT')."</th> |
|
97 | + <th align='center'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLE')."</th><th align='center'>".\_AM_SYSTEM_BLOCKS_VISIBLEIN."</th> |
|
98 | + <th align='center'>" . \_AM_SYSTEM_ADGS."</th> |
|
99 | + <th align='center'>" . \_AM_SYSTEM_BLOCKS_BCACHETIME."</th> |
|
100 | + <th align='center'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'ACTION').'</th> |
|
101 | 101 | </tr>'; |
102 | 102 | $blockArray = \XoopsBlock::getByModule($xoopsModule->mid()); |
103 | 103 | $blockCount = \count($blockArray); |
@@ -117,14 +117,14 @@ discard block |
||
117 | 117 | ]; |
118 | 118 | foreach ($blockArray as $i) { |
119 | 119 | $groupsPermissions = $grouppermHandler->getGroupIds('block_read', $i->getVar('bid')); |
120 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $i->getVar('bid'); |
|
120 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$i->getVar('bid'); |
|
121 | 121 | $result = $this->db->query($sql); |
122 | 122 | $modules = []; |
123 | 123 | if (!$result instanceof \mysqli_result) { |
124 | - \trigger_error("Query Failed! SQL: $sql Error: " . $this->db->error(), \E_USER_ERROR); |
|
124 | + \trigger_error("Query Failed! SQL: $sql Error: ".$this->db->error(), \E_USER_ERROR); |
|
125 | 125 | } |
126 | 126 | while (false !== ($row = $this->db->fetchArray($result))) { |
127 | - $modules[] = (int)$row['module_id']; |
|
127 | + $modules[] = (int) $row['module_id']; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | $cachetimeOptions = ''; |
@@ -174,46 +174,46 @@ discard block |
||
174 | 174 | $title = $i->getVar('title'); |
175 | 175 | } |
176 | 176 | $name = $i->getVar('name'); |
177 | - echo "<tr valign='top'><td class='$class' align='center'><input type='text' name='title[" . $i->getVar('bid') . "]' value='" . $title . "'></td> |
|
177 | + echo "<tr valign='top'><td class='$class' align='center'><input type='text' name='title[".$i->getVar('bid')."]' value='".$title."'></td> |
|
178 | 178 | <td class='$class' align='center' nowrap='nowrap'><div align='center' > |
179 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_LEFT . "'$ssel2> |
|
180 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_CENTER . "'$ssel3> |
|
181 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_RIGHT . "'$ssel4> |
|
179 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_LEFT."'$ssel2> |
|
180 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_CENTER."'$ssel3> |
|
181 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_RIGHT."'$ssel4> |
|
182 | 182 | </div> |
183 | 183 | <div> |
184 | - <span style='float:right;'><input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_SIDEBLOCK_RIGHT . "'$ssel1></span> |
|
185 | - <div align='left'><input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_SIDEBLOCK_LEFT . "'$ssel0></div> |
|
184 | + <span style='float:right;'><input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_SIDEBLOCK_RIGHT."'$ssel1></span> |
|
185 | + <div align='left'><input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_SIDEBLOCK_LEFT."'$ssel0></div> |
|
186 | 186 | </div> |
187 | 187 | <div align='center'> |
188 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_BOTTOMLEFT . "'$ssel5> |
|
189 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_BOTTOM . "'$ssel7> |
|
190 | - <input type='radio' name='side[" . $i->getVar('bid') . "]' value='" . \XOOPS_CENTERBLOCK_BOTTOMRIGHT . "'$ssel6> |
|
188 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_BOTTOMLEFT."'$ssel5> |
|
189 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_BOTTOM."'$ssel7> |
|
190 | + <input type='radio' name='side[".$i->getVar('bid')."]' value='".\XOOPS_CENTERBLOCK_BOTTOMRIGHT."'$ssel6> |
|
191 | 191 | </div> |
192 | 192 | </td> |
193 | - <td class='$class' align='center'><input type='text' name='weight[" . $i->getVar('bid') . "]' value='" . $i->getVar('weight') . "' size='5' maxlength='5'></td> |
|
194 | - <td class='$class' align='center' nowrap><input type='radio' name='visible[" . $i->getVar('bid') . "]' value='1'$sel1>" . _YES . " <input type='radio' name='visible[" . $i->getVar('bid') . "]' value='0'$sel0>" . _NO . '</td>'; |
|
193 | + <td class='$class' align='center'><input type='text' name='weight[".$i->getVar('bid')."]' value='".$i->getVar('weight')."' size='5' maxlength='5'></td> |
|
194 | + <td class='$class' align='center' nowrap><input type='radio' name='visible[".$i->getVar('bid')."]' value='1'$sel1>"._YES." <input type='radio' name='visible[".$i->getVar('bid')."]' value='0'$sel0>"._NO.'</td>'; |
|
195 | 195 | |
196 | - echo "<td class='$class' align='center'><select size='5' name='bmodule[" . $i->getVar('bid') . "][]' id='bmodule[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
|
196 | + echo "<td class='$class' align='center'><select size='5' name='bmodule[".$i->getVar('bid')."][]' id='bmodule[".$i->getVar('bid')."][]' multiple='multiple'>"; |
|
197 | 197 | foreach ($moduleList as $k => $v) { |
198 | - echo "<option value='$k'" . (\in_array($k, $modules) ? " selected='selected'" : '') . ">$v</option>"; |
|
198 | + echo "<option value='$k'".(\in_array($k, $modules) ? " selected='selected'" : '').">$v</option>"; |
|
199 | 199 | } |
200 | 200 | echo '</select></td>'; |
201 | 201 | |
202 | - echo "<td class='$class' align='center'><select size='5' name='groups[" . $i->getVar('bid') . "][]' id='groups[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
|
202 | + echo "<td class='$class' align='center'><select size='5' name='groups[".$i->getVar('bid')."][]' id='groups[".$i->getVar('bid')."][]' multiple='multiple'>"; |
|
203 | 203 | foreach ($groups as $grp) { |
204 | - echo "<option value='" . $grp->getVar('groupid') . "' " . (\in_array($grp->getVar('groupid'), $groupsPermissions) ? " selected='selected'" : '') . '>' . $grp->getVar('name') . '</option>'; |
|
204 | + echo "<option value='".$grp->getVar('groupid')."' ".(\in_array($grp->getVar('groupid'), $groupsPermissions) ? " selected='selected'" : '').'>'.$grp->getVar('name').'</option>'; |
|
205 | 205 | } |
206 | 206 | echo '</select></td>'; |
207 | 207 | |
208 | 208 | // Cache lifetime |
209 | - echo '<td class="' . $class . '" align="center"> <select name="bcachetime[' . $i->getVar('bid') . ']" size="1">' . $cachetimeOptions . '</select> |
|
209 | + echo '<td class="'.$class.'" align="center"> <select name="bcachetime['.$i->getVar('bid').']" size="1">'.$cachetimeOptions.'</select> |
|
210 | 210 | </td>'; |
211 | 211 | |
212 | 212 | // Actions |
213 | 213 | |
214 | 214 | echo "<td class='$class' align='center'> |
215 | - <a href='blocksadmin.php?op=edit&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/edit.png' . " alt='" . _EDIT . "' title='" . _EDIT . "'></a> |
|
216 | - <a href='blocksadmin.php?op=clone&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/editcopy.png' . " alt='" . _CLONE . "' title='" . _CLONE . "'></a>"; |
|
215 | + <a href='blocksadmin.php?op=edit&bid=".$i->getVar('bid')."'><img src=".$pathIcon16.'/edit.png'." alt='"._EDIT."' title='"._EDIT."'></a> |
|
216 | + <a href='blocksadmin.php?op=clone&bid=" . $i->getVar('bid')."'><img src=".$pathIcon16.'/editcopy.png'." alt='"._CLONE."' title='"._CLONE."'></a>"; |
|
217 | 217 | // if ('S' !== $i->getVar('block_type') && 'M' !== $i->getVar('block_type')) { |
218 | 218 | // echo " <a href='" . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=delete&bid=' . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . _DELETE . "' title='" . _DELETE . "'> |
219 | 219 | // </a>"; |
@@ -222,22 +222,22 @@ discard block |
||
222 | 222 | // if ('S' !== $i->getVar('block_type') && 'M' !== $i->getVar('block_type')) { |
223 | 223 | if (!\in_array($i->getVar('block_type'), ['M', 'S'])) { |
224 | 224 | echo " |
225 | - <a href='blocksadmin.php?op=delete&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . _DELETE . "' title='" . _DELETE . "'> |
|
225 | + <a href='blocksadmin.php?op=delete&bid=" . $i->getVar('bid')."'><img src=".$pathIcon16.'/delete.png'." alt='"._DELETE."' title='"._DELETE."'> |
|
226 | 226 | </a>"; |
227 | 227 | } |
228 | 228 | echo " |
229 | - <input type='hidden' name='oldtitle[" . $i->getVar('bid') . "]' value='" . $i->getVar('title') . "'> |
|
230 | - <input type='hidden' name='oldside[" . $i->getVar('bid') . "]' value='" . $i->getVar('side') . "'> |
|
231 | - <input type='hidden' name='oldweight[" . $i->getVar('bid') . "]' value='" . $i->getVar('weight') . "'> |
|
232 | - <input type='hidden' name='oldvisible[" . $i->getVar('bid') . "]' value='" . $i->getVar('visible') . "'> |
|
233 | - <input type='hidden' name='oldgroups[" . $i->getVar('groups') . "]' value='" . $i->getVar('groups') . "'> |
|
234 | - <input type='hidden' name='oldbcachetime[" . $i->getVar('bid') . "]' value='" . $i->getVar('bcachetime') . "'> |
|
235 | - <input type='hidden' name='bid[" . $i->getVar('bid') . "]' value='" . $i->getVar('bid') . "'> |
|
229 | + <input type='hidden' name='oldtitle[" . $i->getVar('bid')."]' value='".$i->getVar('title')."'> |
|
230 | + <input type='hidden' name='oldside[" . $i->getVar('bid')."]' value='".$i->getVar('side')."'> |
|
231 | + <input type='hidden' name='oldweight[" . $i->getVar('bid')."]' value='".$i->getVar('weight')."'> |
|
232 | + <input type='hidden' name='oldvisible[" . $i->getVar('bid')."]' value='".$i->getVar('visible')."'> |
|
233 | + <input type='hidden' name='oldgroups[" . $i->getVar('groups')."]' value='".$i->getVar('groups')."'> |
|
234 | + <input type='hidden' name='oldbcachetime[" . $i->getVar('bid')."]' value='".$i->getVar('bcachetime')."'> |
|
235 | + <input type='hidden' name='bid[" . $i->getVar('bid')."]' value='".$i->getVar('bid')."'> |
|
236 | 236 | </td></tr> |
237 | 237 | "; |
238 | 238 | $class = ('even' === $class) ? 'odd' : 'even'; |
239 | 239 | } |
240 | - echo "<tr><td class='foot' align='center' colspan='8'> <input type='hidden' name='op' value='order'>" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "<input type='submit' name='submit' value='" . _SUBMIT . "'></td></tr></table></form><br><br>"; |
|
240 | + echo "<tr><td class='foot' align='center' colspan='8'> <input type='hidden' name='op' value='order'>".$GLOBALS['xoopsSecurity']->getTokenHTML()."<input type='submit' name='submit' value='"._SUBMIT."'></td></tr></table></form><br><br>"; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | public function deleteBlock(int $bid): void |
@@ -268,18 +268,18 @@ discard block |
||
268 | 268 | \xoops_loadLanguage('admin/groups', 'system'); |
269 | 269 | |
270 | 270 | $myblock = new \XoopsBlock($bid); |
271 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $bid; |
|
271 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$bid; |
|
272 | 272 | $result = $this->db->query($sql); |
273 | 273 | $modules = []; |
274 | 274 | if ($result instanceof \mysqli_result) { |
275 | 275 | while (false !== ($row = $this->db->fetchArray($result))) { |
276 | - $modules[] = (int)$row['module_id']; |
|
276 | + $modules[] = (int) $row['module_id']; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | $isCustom = \in_array($myblock->getVar('block_type'), ['C', 'E']); |
280 | 280 | $block = [ |
281 | - 'title' => $myblock->getVar('title') . ' Clone', |
|
282 | - 'form_title' => \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK'), |
|
281 | + 'title' => $myblock->getVar('title').' Clone', |
|
282 | + 'form_title' => \constant('CO_'.$this->moduleDirNameUpper.'_'.'BLOCKS_CLONEBLOCK'), |
|
283 | 283 | 'name' => $myblock->getVar('name'), |
284 | 284 | 'side' => $myblock->getVar('side'), |
285 | 285 | 'weight' => $myblock->getVar('weight'), |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | 'template' => $myblock->getVar('template'), |
296 | 296 | 'options' => $myblock->getVar('options'), |
297 | 297 | ]; |
298 | - echo '<a href="blocksadmin.php">' . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</a> <span style="font-weight:bold;">»»</span> ' . \_AM_SYSTEM_BLOCKS_CLONEBLOCK . '<br><br>'; |
|
298 | + echo '<a href="blocksadmin.php">'.\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</a> <span style="font-weight:bold;">»»</span> '.\_AM_SYSTEM_BLOCKS_CLONEBLOCK.'<br><br>'; |
|
299 | 299 | // $form = new Blockform(); |
300 | 300 | // $form->render(); |
301 | 301 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | // $newid = $clone->store(); //see https://github.com/XOOPS/XoopsCore25/issues/1105 |
339 | 339 | if ($clone->store()) { |
340 | - $newid = $clone->id(); //get the id of the cloned block |
|
340 | + $newid = $clone->id(); //get the id of the cloned block |
|
341 | 341 | } |
342 | 342 | if (!$newid) { |
343 | 343 | // \xoops_cp_header(); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | if ('' !== $clone->getVar('template')) { |
349 | 349 | /** @var \XoopsTplfileHandler $tplfileHandler */ |
350 | 350 | $tplfileHandler = \xoops_getHandler('tplfile'); |
351 | - $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', (string)$bid); |
|
351 | + $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', (string) $bid); |
|
352 | 352 | if (\count($btemplate) > 0) { |
353 | 353 | $tplclone = $btemplate[0]->xoopsClone(); |
354 | 354 | $tplclone->setVar('tpl_id', 0); |
@@ -358,12 +358,12 @@ discard block |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | foreach ($bmodule as $bmid) { |
361 | - $sql = 'INSERT INTO ' . $this->db->prefix('block_module_link') . ' (block_id, module_id) VALUES (' . $newid . ', ' . $bmid . ')'; |
|
361 | + $sql = 'INSERT INTO '.$this->db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')'; |
|
362 | 362 | $this->db->query($sql); |
363 | 363 | } |
364 | 364 | //$groups = &$GLOBALS['xoopsUser']->getGroups(); |
365 | 365 | foreach ($groups as $iValue) { |
366 | - $sql = 'INSERT INTO ' . $this->db->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (' . $iValue . ', ' . $newid . ", 1, 'block_read')"; |
|
366 | + $sql = 'INSERT INTO '.$this->db->prefix('group_permission').' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES ('.$iValue.', '.$newid.", 1, 'block_read')"; |
|
367 | 367 | $this->db->query($sql); |
368 | 368 | } |
369 | 369 | $this->helper->redirect('admin/blocksadmin.php?op=list', 1, _AM_DBUPDATED); |
@@ -392,12 +392,12 @@ discard block |
||
392 | 392 | \xoops_loadLanguage('admin/groups', 'system'); |
393 | 393 | // mpu_adm_menu(); |
394 | 394 | $myblock = new \XoopsBlock($bid); |
395 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $bid; |
|
395 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$bid; |
|
396 | 396 | $result = $this->db->query($sql); |
397 | 397 | $modules = []; |
398 | 398 | if ($result instanceof \mysqli_result) { |
399 | 399 | while (false !== ($row = $this->db->fetchArray($result))) { |
400 | - $modules[] = (int)$row['module_id']; |
|
400 | + $modules[] = (int) $row['module_id']; |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | $isCustom = \in_array($myblock->getVar('block_type'), ['C', 'E']); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | 'template' => $myblock->getVar('template'), |
420 | 420 | 'options' => $myblock->getVar('options'), |
421 | 421 | ]; |
422 | - echo '<a href="blocksadmin.php">' . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</a> <span style="font-weight:bold;">»»</span> ' . \_AM_SYSTEM_BLOCKS_EDITBLOCK . '<br><br>'; |
|
422 | + echo '<a href="blocksadmin.php">'.\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</a> <span style="font-weight:bold;">»»</span> '.\_AM_SYSTEM_BLOCKS_EDITBLOCK.'<br><br>'; |
|
423 | 423 | |
424 | 424 | echo $this->render($block); |
425 | 425 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | $this->db->query($sql); |
460 | 460 | } else { |
461 | 461 | foreach ($bmodule as $bmid) { |
462 | - $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int)$bmid); |
|
462 | + $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int) $bmid); |
|
463 | 463 | $this->db->query($sql); |
464 | 464 | } |
465 | 465 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $this->db->query($sql); |
473 | 473 | } |
474 | 474 | } |
475 | - $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_' . $this->moduleDirNameUpper . '_' . 'UPDATE_SUCCESS')); |
|
475 | + $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_'.$this->moduleDirNameUpper.'_'.'UPDATE_SUCCESS')); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | public function orderBlock( |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | $this->db->query($sql); |
499 | 499 | } else { |
500 | 500 | foreach ($bmodule[$i] as $bmid) { |
501 | - $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int)$bmid); |
|
501 | + $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int) $bmid); |
|
502 | 502 | $this->db->query($sql); |
503 | 503 | } |
504 | 504 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
516 | - $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_' . $this->moduleDirNameUpper . '_' . 'UPDATE_SUCCESS')); |
|
516 | + $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_'.$this->moduleDirNameUpper.'_'.'UPDATE_SUCCESS')); |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | public function render(?array $block = null) |
@@ -537,9 +537,9 @@ discard block |
||
537 | 537 | 9 => \_AM_SYSTEM_BLOCKS_CBBOTTOM, |
538 | 538 | ]); |
539 | 539 | $form->addElement($sideSelect); |
540 | - $form->addElement(new \XoopsFormText(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight'])); |
|
541 | - $form->addElement(new \XoopsFormRadioYN(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible'])); |
|
542 | - $modSelect = new \XoopsFormSelect(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
|
540 | + $form->addElement(new \XoopsFormText(\constant('CO_'.$this->moduleDirNameUpper.'_'.'WEIGHT'), 'bweight', 2, 5, $block['weight'])); |
|
541 | + $form->addElement(new \XoopsFormRadioYN(\constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLE'), 'bvisible', $block['visible'])); |
|
542 | + $modSelect = new \XoopsFormSelect(\constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
|
543 | 543 | /** @var \XoopsModuleHandler $moduleHandler */ |
544 | 544 | $moduleHandler = \xoops_getHandler('module'); |
545 | 545 | $criteria = new \CriteriaCompo(new \Criteria('hasmain', '1')); |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | $form->addElement(new \XoopsFormText(\_AM_SYSTEM_BLOCKS_TITLE, 'btitle', 50, 255, $block['title']), false); |
554 | 554 | if ($block['is_custom']) { |
555 | 555 | $textarea = new \XoopsFormDhtmlTextArea(\_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); |
556 | - $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . \_AM_SYSTEM_BLOCKS_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . \sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>'); |
|
556 | + $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'.\_AM_SYSTEM_BLOCKS_USEFULTAGS.'</span><br><span style="font-size:x-small;font-weight:normal;">'.\sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>'); |
|
557 | 557 | $form->addElement($textarea, true); |
558 | 558 | $ctypeSelect = new \XoopsFormSelect(\_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
559 | 559 | $ctypeSelect->addOptionArray([ |
@@ -569,11 +569,11 @@ discard block |
||
569 | 569 | $tplfileHandler = \xoops_getHandler('tplfile'); |
570 | 570 | $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']); |
571 | 571 | if (\count($btemplate) > 0) { |
572 | - $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
|
572 | + $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate[0]->getVar('tpl_id').'">'.\_AM_SYSTEM_BLOCKS_EDITTPL.'</a>')); |
|
573 | 573 | } else { |
574 | 574 | $btemplate2 = $tplfileHandler->find('default', 'block', $block['bid']); |
575 | 575 | if (\count($btemplate2) > 0) { |
576 | - $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar('tpl_id') . '" target="_blank">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
|
576 | + $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'.\_AM_SYSTEM_BLOCKS_EDITTPL.'</a>')); |
|
577 | 577 | } |
578 | 578 | } |
579 | 579 | } |