@@ -49,10 +49,10 @@ |
||
49 | 49 | if (!$edit_func) { |
50 | 50 | return false; |
51 | 51 | } |
52 | - if (is_file(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'))) { |
|
52 | + if (is_file(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'))) { |
|
53 | 53 | xoops_loadLanguage('blocks', $this->getVar('dirname')); |
54 | 54 | |
55 | - require_once XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'); |
|
55 | + require_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'); |
|
56 | 56 | $options = explode('|', $this->getVar('options')); |
57 | 57 | $edit_form = $edit_func($options); |
58 | 58 | if (!$edit_form) { |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | // $sql .= " WHERE metakey='version' LIMIT 1"; |
39 | 39 | // $query = $GLOBALS['xoopsDB']->query($sql); |
40 | 40 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
41 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
41 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO')."</legend>\n"; |
|
42 | 42 | $html .= "<div style='padding: 8px;'>\n"; |
43 | 43 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
44 | 44 | // $html .= "<br>\n"; |
45 | 45 | // $html .= "<br>\n"; |
46 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
46 | + $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI')."</div>\n"; |
|
47 | 47 | $html .= "<ul>\n"; |
48 | 48 | |
49 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
50 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
49 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
50 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
51 | 51 | if (function_exists('gd_info')) { |
52 | 52 | if (true === ($gdlib = gd_info())) { |
53 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
53 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | // |
@@ -60,18 +60,18 @@ discard block |
||
60 | 60 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
61 | 61 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
62 | 62 | // |
63 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
63 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
64 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
65 | 65 | |
66 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
68 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
66 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: blue;">'.ini_get('upload_max_filesize')."</span></b>\n"; |
|
67 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: blue;">'.ini_get('post_max_size')."</span></b>\n"; |
|
68 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: blue;">'.ini_get('memory_limit')."</span></b>\n"; |
|
69 | 69 | $html .= "</ul>\n"; |
70 | 70 | $html .= "<ul>\n"; |
71 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
71 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH."</b>\n"; |
|
72 | 72 | $html .= "</ul>\n"; |
73 | 73 | $html .= "<br>\n"; |
74 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
74 | + $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC')."\n"; |
|
75 | 75 | $html .= '</div>'; |
76 | 76 | $html .= '</fieldset><br>'; |
77 | 77 |
@@ -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 (\Exception $e) { |
38 | 38 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | $dir = \opendir($src); |
59 | 59 | // @mkdir($dst); |
60 | 60 | if (!@\mkdir($dst) && !\is_dir($dst)) { |
61 | - throw new \RuntimeException('The directory ' . $dst . ' could not be created.'); |
|
61 | + throw new \RuntimeException('The directory '.$dst.' could not be created.'); |
|
62 | 62 | } |
63 | 63 | while (false !== ($file = \readdir($dir))) { |
64 | 64 | if (('.' !== $file) && ('..' !== $file)) { |
65 | - if (\is_dir($src . '/' . $file)) { |
|
66 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
65 | + if (\is_dir($src.'/'.$file)) { |
|
66 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
67 | 67 | } else { |
68 | - \copy($src . '/' . $file, $dst . '/' . $file); |
|
68 | + \copy($src.'/'.$file, $dst.'/'.$file); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | self::rrmdir($fObj->getPathname()); |
156 | 156 | } |
157 | 157 | } |
158 | - $iterator = null; // clear iterator Obj to close file/directory |
|
158 | + $iterator = null; // clear iterator Obj to close file/directory |
|
159 | 159 | return \rmdir($src); // remove the directory & return results |
160 | 160 | } |
161 | 161 | |
@@ -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 | return \rmdir($src); // remove the directory & return results |
200 | 200 | } |
201 | 201 | |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | $iterator = new \DirectoryIterator($src); |
232 | 232 | foreach ($iterator as $fObj) { |
233 | 233 | if ($fObj->isFile()) { |
234 | - \copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
234 | + \copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
235 | 235 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
236 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
236 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
44 | 44 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
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; |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | //check for minimum XOOPS version |
66 | 66 | $currentVer = mb_substr(XOOPS_VERSION, 6); // get the numeric part of string |
67 | 67 | if (null === $requiredVer) { |
68 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
68 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
69 | 69 | } |
70 | 70 | $success = true; |
71 | 71 | |
72 | 72 | if (version_compare($currentVer, $requiredVer, '<')) { |
73 | 73 | $success = false; |
74 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
74 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $success; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | if (false !== $reqVer && '' !== $reqVer) { |
104 | 104 | if (version_compare($verNum, $reqVer, '<')) { |
105 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
105 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
106 | 106 | $success = false; |
107 | 107 | } |
108 | 108 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
127 | 127 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
128 | 128 | $update = ''; |
129 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
129 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
130 | 130 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
131 | 131 | $ret = ''; |
132 | 132 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | if (false === $curlReturn) { |
141 | 141 | trigger_error(curl_error($curlHandle)); |
142 | 142 | } elseif (false !== strpos($curlReturn, 'Not Found')) { |
143 | - trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
143 | + trigger_error('Repository Not Found: '.$infoReleasesUrl); |
|
144 | 144 | } else { |
145 | 145 | $file = json_decode($curlReturn, false); |
146 | 146 | $latestVersionLink = sprintf("https://github.com/$repository/archive/%s.zip", $file ? reset($file)->tag_name : $default); |
147 | 147 | $latestVersion = $file[0]->tag_name; |
148 | 148 | $prerelease = $file[0]->prerelease; |
149 | 149 | if ('master' !== $latestVersionLink) { |
150 | - $update = constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
150 | + $update = constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion; |
|
151 | 151 | } |
152 | 152 | //"PHP-standardized" version |
153 | 153 | $latestVersion = mb_strtolower($latestVersion); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $latestVersion = str_replace('_', '', mb_strtolower($latestVersion)); |
156 | 156 | $latestVersion = str_replace('final', '', mb_strtolower($latestVersion)); |
157 | 157 | } |
158 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
158 | + $moduleVersion = ($helper->getModule()->getInfo('version').'_'.$helper->getModule()->getInfo('module_status')); |
|
159 | 159 | //"PHP-standardized" version |
160 | 160 | $moduleVersion = str_replace(' ', '', mb_strtolower($moduleVersion)); |
161 | 161 | // $moduleVersion = '1.0'; //for testing only |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | { |
67 | 67 | if ($considerHtml) { |
68 | 68 | // if the plain text is shorter than the maximum length, return the whole text |
69 | - if (mb_strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) { |
|
69 | + if (mb_strlen(preg_replace('/<.*?'.'>/', '', $text)) <= $length) { |
|
70 | 70 | return $text; |
71 | 71 | } |
72 | 72 | // splits all html-tags to scanable lines |
73 | - preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
|
73 | + preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
|
74 | 74 | $total_length = mb_strlen($ending); |
75 | 75 | $open_tags = []; |
76 | 76 | $truncate = ''; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | unset($open_tags[$pos]); |
89 | 89 | } |
90 | 90 | // if tag is an opening tag |
91 | - } elseif (preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) { |
|
91 | + } elseif (preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) { |
|
92 | 92 | // add tag to the beginning of $open_tags list |
93 | 93 | array_unshift($open_tags, mb_strtolower($tag_matchings[1])); |
94 | 94 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ($considerHtml) { |
147 | 147 | // close all unclosed html-tags |
148 | 148 | foreach ($open_tags as $tag) { |
149 | - $truncate .= '</' . $tag . '>'; |
|
149 | + $truncate .= '</'.$tag.'>'; |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // set the auto-incremented id's value to blank. |
227 | 227 | unset($tempTable[$id_field]); |
228 | 228 | // insert cloned copy of the original record |
229 | - $sql = "INSERT INTO $table (" . implode(', ', array_keys($tempTable)) . ") VALUES ('" . implode("', '", array_values($tempTable)) . "')"; |
|
229 | + $sql = "INSERT INTO $table (".implode(', ', array_keys($tempTable)).") VALUES ('".implode("', '", array_values($tempTable))."')"; |
|
230 | 230 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
231 | 231 | if (!$result) { |
232 | 232 | exit($GLOBALS['xoopsDB']->error()); |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | /** @var Utility $utility */ |
26 | 26 | /** @var Configurator $configurator */ |
27 | 27 | |
28 | -require dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
29 | -require dirname(__DIR__) . '/preloads/autoloader.php'; |
|
28 | +require dirname(__DIR__, 3).'/include/cp_header.php'; |
|
29 | +require dirname(__DIR__).'/preloads/autoloader.php'; |
|
30 | 30 | |
31 | 31 | $op = Request::getCmd('op', ''); |
32 | 32 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | loadSampleData(); |
47 | 47 | } else { |
48 | 48 | xoops_cp_header(); |
49 | - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
49 | + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_CONFIRM')), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
50 | 50 | xoops_cp_footer(); |
51 | 51 | } |
52 | 52 | break; |
@@ -72,20 +72,20 @@ discard block |
||
72 | 72 | $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
73 | 73 | |
74 | 74 | $language = 'english/'; |
75 | - if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
76 | - $language = $xoopsConfig['language'] . '/'; |
|
75 | + if (is_dir(__DIR__.'/'.$xoopsConfig['language'])) { |
|
76 | + $language = $xoopsConfig['language'].'/'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // load module tables |
80 | 80 | foreach ($tables as $table) { |
81 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
81 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
82 | 82 | TableLoad::truncateTable($table); |
83 | 83 | TableLoad::loadTableFromArray($table, $tabledata); |
84 | 84 | } |
85 | 85 | |
86 | 86 | // load permissions |
87 | 87 | $table = 'group_permission'; |
88 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
88 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
89 | 89 | $mid = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); |
90 | 90 | loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); |
91 | 91 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $utility::rcopy($src, $dest); |
99 | 99 | } |
100 | 100 | } |
101 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS')); |
|
101 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_SUCCESS')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | function saveSampleData() |
@@ -109,26 +109,26 @@ discard block |
||
109 | 109 | $helper = Helper::getInstance(); |
110 | 110 | $tables = $helper->getModule()->getInfo('tables'); |
111 | 111 | |
112 | - $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
113 | - if (!file_exists($languageFolder . '/')) { |
|
114 | - Utility::createFolder($languageFolder . '/'); |
|
112 | + $languageFolder = __DIR__.'/'.$xoopsConfig['language']; |
|
113 | + if (!file_exists($languageFolder.'/')) { |
|
114 | + Utility::createFolder($languageFolder.'/'); |
|
115 | 115 | } |
116 | - $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
116 | + $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/'; |
|
117 | 117 | Utility::createFolder($exportFolder); |
118 | 118 | |
119 | 119 | // save module tables |
120 | 120 | foreach ($tables as $table) { |
121 | - TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
121 | + TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // save permissions |
125 | 125 | $criteria = new \CriteriaCompo(); |
126 | 126 | $criteria->add(new \Criteria('gperm_modid', $helper->getModule()->getVar('mid'))); |
127 | 127 | $skipColumns[] = 'gperm_id'; |
128 | - TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
128 | + TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns); |
|
129 | 129 | unset($criteria); |
130 | 130 | |
131 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
131 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS')); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | function exportSchema() |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | // |
144 | 144 | // redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
145 | 145 | } catch (\Throwable $e) { |
146 | - exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
146 | + exit(constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR')); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | $prefixedTable = $db->prefix($table); |
168 | 168 | $count = 0; |
169 | 169 | |
170 | - $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
170 | + $sql = 'DELETE FROM '.$prefixedTable.' WHERE `'.$search.'`='.$db->quote($replace); |
|
171 | 171 | |
172 | 172 | $result = $db->queryF($sql); |
173 | 173 | |
174 | 174 | foreach ($data as $row) { |
175 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
175 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
176 | 176 | $valueClause = ' VALUES ('; |
177 | 177 | $first = true; |
178 | 178 | foreach ($row as $column => $value) { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
194 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
194 | + $sql = $insertInto.') '.$valueClause.')'; |
|
195 | 195 | |
196 | 196 | $result = $db->queryF($sql); |
197 | 197 | if (false !== $result) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | return $count; |
203 | 203 | } |
204 | 204 | |
205 | -function clearSampleData(){ |
|
205 | +function clearSampleData() { |
|
206 | 206 | $moduleDirName = \basename(\dirname(__DIR__)); |
207 | 207 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
208 | 208 | $helper = Helper::getInstance(); |
@@ -213,5 +213,5 @@ discard block |
||
213 | 213 | foreach ($tables as $table) { |
214 | 214 | \Xmf\Database\TableLoad::truncateTable($table); |
215 | 215 | } |
216 | - redirect_header($helper->url('admin/index.php'), 1, constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK')); |
|
216 | + redirect_header($helper->url('admin/index.php'), 1, constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA_OK')); |
|
217 | 217 | } |