Passed
Pull Request — master (#610)
by Richard
14:27
created
htdocs/modules/xlanguage/admin/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @version         $Id$
17 17
  */
18 18
 
19
-include __DIR__ . '/header.php';
19
+include __DIR__.'/header.php';
20 20
 
21 21
 switch ($op) {
22 22
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
                 } else {
79 79
                     $confirm = $xoops->confirm(array(
80 80
                         'ok' => 1, 'xlanguage_id' => $xlanguage_id, 'op' => 'del'
81
-                    ), $_SERVER['REQUEST_URI'], sprintf(_AM_XLANGUAGE_DELETE_CFM . "<br /><b><span style='color : Red'> %s </span></b><br /><br />", $lang->getVar('xlanguage_name')));
82
-                    $confirm = '<div class="confirm">' . $confirm . '</div>';
81
+                    ), $_SERVER['REQUEST_URI'], sprintf(_AM_XLANGUAGE_DELETE_CFM."<br /><b><span style='color : Red'> %s </span></b><br /><br />", $lang->getVar('xlanguage_name')));
82
+                    $confirm = '<div class="confirm">'.$confirm.'</div>';
83 83
                     $admin_page->addInfoBox(_MI_XLANGUAGE_DELETE);
84 84
                     $admin_page->addInfoBoxLine($confirm);
85 85
                     $admin_page->displayIndex();
@@ -104,4 +104,4 @@  discard block
 block discarded – undo
104 104
         $admin_page->displayIndex();
105 105
         break;
106 106
 }
107
-include __DIR__ . '/footer.php';
107
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/admin/header.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
  * @version         $Id$
17 17
  */
18 18
 
19
-include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
19
+include_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php';
20 20
 
21 21
 $op = '';
22 22
 if (isset($_POST)) {
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/preloads/preload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public static function eventCoreIncludeCommonEnd($args)
35 35
     {
36
-        if (XoopsLoad::fileExists($hnd_file = dirname(__DIR__) . '/api.php')) {
36
+        if (XoopsLoad::fileExists($hnd_file = dirname(__DIR__).'/api.php')) {
37 37
             include_once $hnd_file;
38 38
         }
39 39
     }
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/include/functions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         if (strpos($expr, '[-_]') === false) {
83 83
             $expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr);
84 84
         }
85
-        if (($envType == 1 && preg_match('^(' . $expr . ')(;q=[0-9]\\.[0-9])?$^', $str)) || ($envType == 2 && preg_match('(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))', $str))) {
85
+        if (($envType == 1 && preg_match('^('.$expr.')(;q=[0-9]\\.[0-9])?$^', $str)) || ($envType == 2 && preg_match('(\(|\[|;[[:space:]])('.$expr.')(;|\]|\))', $str))) {
86 86
             $lang = $key;
87 87
             break;
88 88
         }
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 
195 195
     // create the pattern between language tags
196 196
     $pqhtmltags = explode(',', preg_quote($xoops->registry()->get('XLANGUAGE_TAGS_RESERVED'), '/'));
197
-    $mid_pattern = '(?:(?!(' . implode('|', $pqhtmltags) . ')).)*';
197
+    $mid_pattern = '(?:(?!('.implode('|', $pqhtmltags).')).)*';
198 198
 
199 199
     $patterns = array();
200 200
     $replaces = array();
201 201
     /* */
202 202
     if (isset($xlanguage_langs[$xoopsConfigLanguage])) {
203 203
         $lang = $xlanguage_langs[$xoopsConfigLanguage];
204
-        $patterns[] = '/(\[([^\]]*\|)?' . preg_quote($lang) . '(\|[^\]]*)?\])(' . $mid_pattern . ')(\[\/([^\]]*\|)?' . preg_quote($lang) . '(\|[^\]]*)?\])/isU';
204
+        $patterns[] = '/(\[([^\]]*\|)?'.preg_quote($lang).'(\|[^\]]*)?\])('.$mid_pattern.')(\[\/([^\]]*\|)?'.preg_quote($lang).'(\|[^\]]*)?\])/isU';
205 205
         $replaces[] = '$4';
206 206
     }
207 207
     /* */
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
             continue;
211 211
         }
212 212
         $name = $xlanguage_langs[$_lang];
213
-        $patterns[] = '/(\[([^\]]*\|)?' . preg_quote($name) . '(\|[^\]]*)?\])(' . $mid_pattern . ')(\[\/([^\]]*\|)?' . preg_quote($name) . '(\|[^\]]*)?(\]\<br[\s]?[\/]?\>|\]))/isU';
213
+        $patterns[] = '/(\[([^\]]*\|)?'.preg_quote($name).'(\|[^\]]*)?\])('.$mid_pattern.')(\[\/([^\]]*\|)?'.preg_quote($name).'(\|[^\]]*)?(\]\<br[\s]?[\/]?\>|\]))/isU';
214 214
         $replaces[] = '';
215 215
     }
216 216
     if (!empty($xoopsConfigLanguage)) {
217
-        $s = preg_replace('/\[[\/]?[\|]?' . preg_quote($xoopsConfigLanguage) . '[\|]?\](\<br \/\>)?/i', '', $s);
217
+        $s = preg_replace('/\[[\/]?[\|]?'.preg_quote($xoopsConfigLanguage).'[\|]?\](\<br \/\>)?/i', '', $s);
218 218
     }
219 219
     if (count($replaces) > 0) {
220 220
         $s = preg_replace($patterns, $replaces, $s);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
     $ret = $matches[1];
237 237
     if (!empty($xlanguage_langs)) {
238
-        $pattern = '/(\[([\/])?(' . implode('|', array_map('preg_quote', array_values($xlanguage_langs))) . ')([\|\]]))/isU';
238
+        $pattern = '/(\[([\/])?('.implode('|', array_map('preg_quote', array_values($xlanguage_langs))).')([\|\]]))/isU';
239 239
         $ret = preg_replace($pattern, '&#91;\\2\\3\\4', $ret);
240 240
     }
241 241
     return $ret;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
     if (!$xoops->registry()->get('XLANGUAGE_THEME_ENABLE')) {
253 253
         return false;
254 254
     }
255
-    include_once \XoopsBaseConfig::get('root-path') . '/modules/xlanguage/blocks/xlanguage_blocks.php';
255
+    include_once \XoopsBaseConfig::get('root-path').'/modules/xlanguage/blocks/xlanguage_blocks.php';
256 256
     if (empty($options)) {
257 257
         $options[0] = 'images'; // display style: image, text, select
258 258
         $options[1] = ' '; // delimitor
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     $block = b_xlanguage_select_show($options);
263 263
     $xoops->theme()->addStylesheet('modules/xlanguage/css/block.css');
264 264
     $xoops->tpl()->assign('block', $block);
265
-    $xlanguage_switch_code = "<div id='xo-language' class='" . $options[0] . "'>" . $xoops->tpl()->fetch('block:xlanguage/xlanguage_block.tpl') . "</div>";
265
+    $xlanguage_switch_code = "<div id='xo-language' class='".$options[0]."'>".$xoops->tpl()->fetch('block:xlanguage/xlanguage_block.tpl')."</div>";
266 266
     $xoops->tpl()->assign('xlanguage_switch_code', $xlanguage_switch_code);
267 267
     return true;
268 268
 }
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/include/install.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 function xoops_module_install_xlanguage(XoopsModule $module)
28 28
 {
29 29
     $xoops = Xoops::getInstance();
30
-    xlanguage_mkdirs($xoops->path(\XoopsBaseConfig::get('var-path')) . '/configs/xlanguage');
30
+    xlanguage_mkdirs($xoops->path(\XoopsBaseConfig::get('var-path')).'/configs/xlanguage');
31 31
 
32 32
     return true;
33 33
 }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     foreach ($paths as $path) {
62 62
         if (!empty($path)) {
63
-            $dest = $dest . '/' . $path;
63
+            $dest = $dest.'/'.$path;
64 64
             if (!is_dir($dest)) {
65 65
                 if (!mkdir($dest, 0755)) {
66 66
                     return false;
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
     }
91 91
 
92 92
     // Simple copy for a file
93
-    if (is_file($folder_in . '/' . $source_file)) {
94
-        return copy($folder_in . '/' . $source_file, $folder_out . '/' . basename($source_file));
93
+    if (is_file($folder_in.'/'.$source_file)) {
94
+        return copy($folder_in.'/'.$source_file, $folder_out.'/'.basename($source_file));
95 95
     }
96 96
 
97 97
     return false;
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/include/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  * @version         $Id$
18 18
  */
19 19
 
20
-return array (
20
+return array(
21 21
     'charset' => array(
22 22
         //'big5'          => 'big5',
23 23
         //'euc-kr'        => 'euc-kr',
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/api.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 
22 22
 $xlanguage = array();
23 23
 
24
-if (XoopsLoad::fileExists($hnd_file = \XoopsBaseConfig::get('root-path') . '/modules/xlanguage/include/vars.php')) {
24
+if (XoopsLoad::fileExists($hnd_file = \XoopsBaseConfig::get('root-path').'/modules/xlanguage/include/vars.php')) {
25 25
     include_once $hnd_file;
26 26
 }
27
-if (XoopsLoad::fileExists($hnd_file = \XoopsBaseConfig::get('root-path') . '/modules/xlanguage/include/functions.php')) {
27
+if (XoopsLoad::fileExists($hnd_file = \XoopsBaseConfig::get('root-path').'/modules/xlanguage/include/functions.php')) {
28 28
     include_once $hnd_file;
29 29
 }
30 30
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             if (!empty(${$HV})) {
73 73
                 ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset);
74 74
             }
75
-            $GLOBALS['HTTP' . $HV . '_VARS'] = ${$HV};
75
+            $GLOBALS['HTTP'.$HV.'_VARS'] = ${$HV};
76 76
         }
77 77
     }
78 78
     ob_start('xlanguage_encoding');
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/blocks/xlanguage_blocks.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $QUERY_STRING_array = array_filter(explode('&', $xoops->getEnv('QUERY_STRING')));
41 41
     $QUERY_STRING_new = array();
42 42
     foreach ($QUERY_STRING_array as $QUERY) {
43
-        if (substr($QUERY, 0, (strlen($lang_tag) + 1)) != $lang_tag . '=') {
43
+        if (substr($QUERY, 0, (strlen($lang_tag) + 1)) != $lang_tag.'=') {
44 44
             $vals = explode('=', $QUERY);
45 45
             foreach (array_keys($vals) as $key) {
46 46
                 if (preg_match('/^a-z0-9$/i', $vals[$key])) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     $block['delimitor'] = $options[1];
56 56
     $block['number'] = $options[2];
57 57
 
58
-    if ($options[0]==='jquery') {
58
+    if ($options[0] === 'jquery') {
59 59
         $xoops = \Xoops::getInstance();
60 60
         $xoops->theme()->addBaseScriptAssets('@jqueryui');
61 61
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $query_string = implode('&', array_map('htmlspecialchars', $QUERY_STRING_new));
70 70
         $query_string .= empty($query_string) ? '' : '&';
71 71
     }
72
-    $block['url'] = $xoops->getEnv('PHP_SELF') . '?' . $query_string . $lang_tag . '=';
72
+    $block['url'] = $xoops->getEnv('PHP_SELF').'?'.$query_string.$lang_tag.'=';
73 73
     $block['languages'] = $helper->getHandlerLanguage()->cached_config;
74 74
 
75 75
     return $block;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 {
85 85
     $block_form = new Xoops\Form\BlockForm();
86 86
 
87
-    $tmp = new Xoops\Form\Select(_MB_XLANGUAGE_DISPLAY_METHOD . ' : ', 'options[0]', $options[0]);
87
+    $tmp = new Xoops\Form\Select(_MB_XLANGUAGE_DISPLAY_METHOD.' : ', 'options[0]', $options[0]);
88 88
     $tmp->addOption('images', _MB_XLANGUAGE_DISPLAY_FLAGLIST);
89 89
     $tmp->addOption('text', _MB_XLANGUAGE_DISPLAY_TEXTLIST);
90 90
     $tmp->addOption('select', _MB_XLANGUAGE_DISPLAY_SELECT);
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
     $tmp->addOption('bootstrap', _MB_XLANGUAGE_DISPLAY_BOOTSTRAP);
93 93
     $block_form->addElement($tmp);
94 94
 
95
-    $block_form->addElement(new Xoops\Form\Text(_MB_XLANGUAGE_IMAGE_SEPARATOR . ' (' . _MB_XLANGUAGE_OPTIONAL . ') : ', 'options[1]', 5, 5, $options[1]));
96
-    $block_form->addElement(new Xoops\Form\Text(_MB_XLANGUAGE_IMAGE_PERROW . ' (' . _MB_XLANGUAGE_OPTIONAL . ') : ', 'options[2]', 2, 2, $options[2]));
95
+    $block_form->addElement(new Xoops\Form\Text(_MB_XLANGUAGE_IMAGE_SEPARATOR.' ('._MB_XLANGUAGE_OPTIONAL.') : ', 'options[1]', 5, 5, $options[1]));
96
+    $block_form->addElement(new Xoops\Form\Text(_MB_XLANGUAGE_IMAGE_PERROW.' ('._MB_XLANGUAGE_OPTIONAL.') : ', 'options[2]', 2, 2, $options[2]));
97 97
 
98 98
     return $block_form->render();
99 99
 }
Please login to merge, or discard this patch.
htdocs/modules/xlanguage/class/xlanguage.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  * @version         $Id$
25 25
  */
26 26
 
27
-include_once \XoopsBaseConfig::get('root-path') . '/modules/xlanguage/include/vars.php';
27
+include_once \XoopsBaseConfig::get('root-path').'/modules/xlanguage/include/vars.php';
28 28
 
29 29
 /**
30 30
  * Class XlanguageLanguage
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public function getValues($keys = null, $format = 's', $maxDepth = 1)
56 56
     {
57 57
         $ret = parent::getValues();
58
-        $ret['xlanguage_image'] = \XoopsBaseConfig::get('url') . '/media/xoops/images/flags/' . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . '/' . $this->getVar('xlanguage_image');
58
+        $ret['xlanguage_image'] = \XoopsBaseConfig::get('url').'/media/xoops/images/flags/'.\Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme').'/'.$this->getVar('xlanguage_image');
59 59
         return $ret;
60 60
     }
61 61
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     public function loadConfig()
103 103
     {
104 104
         $xoops = Xoops::getInstance();
105
-        $this->configPath = \XoopsBaseConfig::get('var-path') . '/configs/';
105
+        $this->configPath = \XoopsBaseConfig::get('var-path').'/configs/';
106 106
         $this->configFile = $xoops->registry()->get('XLANGUAGE_CONFIG_FILE');
107 107
         $this->configFileExt = '.php';
108 108
         return $this->cached_config = $this->loadFileConfig();
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function readConfig()
127 127
     {
128
-        $path_file = $this->configPath . $this->configFile . $this->configFileExt;
128
+        $path_file = $this->configPath.$this->configFile.$this->configFileExt;
129 129
         XoopsLoad::load('XoopsFile');
130 130
         $file = XoopsFile::getHandler('file', $path_file);
131 131
         return eval(@$file->read());
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
     public function writeConfig($data)
153 153
     {
154 154
         if ($this->createPath($this->configPath)) {
155
-            $path_file = $this->configPath . $this->configFile . $this->configFileExt;
155
+            $path_file = $this->configPath.$this->configFile.$this->configFileExt;
156 156
             XoopsLoad::load('XoopsFile');
157 157
             $file = XoopsFile::getHandler('file', $path_file);
158
-            return $file->write('return ' . var_export($data, true) . ';');
158
+            return $file->write('return '.var_export($data, true).';');
159 159
         }
160 160
     }
161 161
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
         foreach ($paths as $path) {
178 178
             if (!empty($path)) {
179
-                $dest = $dest . '/' . $path;
179
+                $dest = $dest.'/'.$path;
180 180
                 if (!is_dir($dest)) {
181 181
                     if (!mkdir($dest, 0755)) {
182 182
                         return false;
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
         }
206 206
 
207 207
         // Simple copy for a file
208
-        if (is_file($folder_in . '/' . $source_file)) {
209
-            return copy($folder_in . '/' . $source_file, $folder_out . '/' . basename($source_file));
208
+        if (is_file($folder_in.'/'.$source_file)) {
209
+            return copy($folder_in.'/'.$source_file, $folder_out.'/'.basename($source_file));
210 210
         }
211 211
         return false;
212 212
     }
Please login to merge, or discard this patch.