Completed
Push — master ( bf34f3...88111b )
by Michael
03:08
created
print.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/header.php';
10
-require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php';
11
-require_once XOOPS_ROOT_PATH . '/class/template.php';
9
+require_once __DIR__.'/header.php';
10
+require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php';
11
+require_once XOOPS_ROOT_PATH.'/class/template.php';
12 12
 
13 13
 $xoopsTpl                = new \XoopsTpl();
14 14
 $myts                    = \MyTextSanitizer::getInstance();
Please login to merge, or discard this patch.
include/update.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
21 21
 
22
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
23
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartdbupdater.php';
22
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
23
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartdbupdater.php';
24 24
 
25 25
 /**
26 26
  * @param  XoopsModule $module
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 
38 38
     $dbupdater = new XoopsModules\Smartobject\SmartObjectDbupdater();
39 39
 
40
-    echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>';
40
+    echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>';
41 41
 
42 42
     // db migrate version = 1
43 43
     $newDbVersion = 1;
44 44
     if ($dbVersion < $newDbVersion) {
45
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
45
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
46 46
 
47 47
         // Create table smartobject_link
48 48
         $table = new XoopsModules\Smartobject\SmartDbTable('smartobject_link');
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     // db migrate version = 2
146 146
     $newDbVersion = 2;
147 147
     if ($dbVersion < $newDbVersion) {
148
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
148
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
149 149
 
150 150
         // Create table smartobject_rating
151 151
         $table = new XoopsModules\Smartobject\SmartDbTable('smartobject_rating');
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     // db migrate version = 3
186 186
     $newDbVersion = 3;
187 187
     if ($dbVersion < $newDbVersion) {
188
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
188
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
189 189
 
190 190
         // Create table smartobject_customtag
191 191
         $table = new XoopsModules\Smartobject\SmartDbTable('smartobject_customtag');
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     // db migrate version = 4
211 211
     $newDbVersion = 4;
212 212
     if ($dbVersion < $newDbVersion) {
213
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
213
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
214 214
 
215 215
         // Create table smartobject_currency
216 216
         $table = new XoopsModules\Smartobject\SmartDbTable('smartobject_currency');
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
     // db migrate version = 6
237 237
     $newDbVersion = 6;
238 238
     if ($dbVersion < $newDbVersion) {
239
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
239
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
240 240
     }
241 241
 
242 242
     $newDbVersion = 7;
243 243
     if ($dbVersion < $newDbVersion) {
244
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
244
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
245 245
 
246 246
         // Create table smartobject_file
247 247
         $table = new XoopsModules\Smartobject\SmartDbTable('smartobject_file');
Please login to merge, or discard this patch.
include/captcha/captcha.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 class XoopsCaptcha
15 15
 {
16 16
     public $active = true;
17
-    public $mode   = 'text';    // potential values: image, text
17
+    public $mode   = 'text'; // potential values: image, text
18 18
     public $config = [];
19 19
 
20 20
     public $message = []; // Logging error messages
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function __construct()
26 26
     {
27 27
         // Loading default preferences
28
-        $this->config = @include __DIR__ . '/config.php';
28
+        $this->config = @include __DIR__.'/config.php';
29 29
 
30 30
         $this->setMode($this->config['mode']);
31 31
     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     {
142 142
         $sessionName = @$_SESSION['XoopsCaptcha_name'];
143 143
         $skipMember  = (null === $skipMember) ? @$_SESSION['XoopsCaptcha_skipmember'] : $skipMember;
144
-        $maxAttempts = (int)(@$_SESSION['XoopsCaptcha_maxattempts']);
144
+        $maxAttempts = (int) (@$_SESSION['XoopsCaptcha_maxattempts']);
145 145
 
146 146
         $is_valid = false;
147 147
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         if (is_object($GLOBALS['xoopsUser']) && !empty($skipMember)) {
150 150
             $is_valid = true;
151 151
         // Kill too many attempts
152
-        } elseif (!empty($maxAttempts) && $_SESSION['XoopsCaptcha_attempt_' . $sessionName] > $maxAttempts) {
152
+        } elseif (!empty($maxAttempts) && $_SESSION['XoopsCaptcha_attempt_'.$sessionName] > $maxAttempts) {
153 153
             $this->message[] = XOOPS_CAPTCHA_TOOMANYATTEMPTS;
154 154
 
155 155
         // Verify the code
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
         if (!empty($maxAttempts)) {
162 162
             if (!$is_valid) {
163 163
                 // Increase the attempt records on failure
164
-                $_SESSION['XoopsCaptcha_attempt_' . $sessionName]++;
164
+                $_SESSION['XoopsCaptcha_attempt_'.$sessionName]++;
165 165
                 // Log the error message
166 166
                 $this->message[] = XOOPS_CAPTCHA_INVALID_CODE;
167 167
             } else {
168 168
 
169 169
                 // reset attempt records on success
170
-                $_SESSION['XoopsCaptcha_attempt_' . $sessionName] = null;
170
+                $_SESSION['XoopsCaptcha_attempt_'.$sessionName] = null;
171 171
             }
172 172
         }
173 173
         $this->destroyGarbage(true);
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
      */
199 199
     public function destroyGarbage($clearSession = false)
200 200
     {
201
-        require_once __DIR__ . '/' . $this->mode . '.php';
202
-        $class          = 'XoopsCaptcha' . ucfirst($this->mode);
201
+        require_once __DIR__.'/'.$this->mode.'.php';
202
+        $class          = 'XoopsCaptcha'.ucfirst($this->mode);
203 203
         $captchaHandler = new $class();
204 204
         if (method_exists($captchaHandler, 'destroyGarbage')) {
205 205
             $captchaHandler->loadConfig($this->config);
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
          */
239 239
 
240 240
         // Fail on too many attempts
241
-        if (!empty($maxAttempts) && @$_SESSION['XoopsCaptcha_attempt_' . $this->config['name']] > $maxAttempts) {
241
+        if (!empty($maxAttempts) && @$_SESSION['XoopsCaptcha_attempt_'.$this->config['name']] > $maxAttempts) {
242 242
             $form = XOOPS_CAPTCHA_TOOMANYATTEMPTS;
243 243
         // Load the form element
244 244
         } else {
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function loadForm()
255 255
     {
256
-        require_once __DIR__ . '/' . $this->mode . '.php';
257
-        $class          = 'XoopsCaptcha' . ucfirst($this->mode);
256
+        require_once __DIR__.'/'.$this->mode.'.php';
257
+        $class          = 'XoopsCaptcha'.ucfirst($this->mode);
258 258
         $captchaHandler = new $class();
259 259
         $captchaHandler->loadConfig($this->config);
260 260
 
Please login to merge, or discard this patch.
include/captcha/scripts/img.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
  * D.J.
6 6
  */
7 7
 
8
-include dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/mainfile.php';
8
+include dirname(dirname(dirname(dirname(dirname(__DIR__))))).'/mainfile.php';
9 9
 error_reporting(0);
10 10
 $xoopsLogger->activated = false;
11 11
 
12
-if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/^' . preg_quote(XOOPS_URL, '/') . '/', $_SERVER['HTTP_REFERER'])) {
12
+if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/^'.preg_quote(XOOPS_URL, '/').'/', $_SERVER['HTTP_REFERER'])) {
13 13
     exit();
14 14
 }
15 15
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         if ('bmp' === $this->mode) {
87 87
             $this->config['num_chars'] = 4;
88
-            $this->code                = mt_rand(pow(10, $this->config['num_chars'] - 1), (int)str_pad('9', $this->config['num_chars'], '9'));
88
+            $this->code                = mt_rand(pow(10, $this->config['num_chars'] - 1), (int) str_pad('9', $this->config['num_chars'], '9'));
89 89
         } else {
90 90
             $this->code = substr(md5(uniqid(mt_rand(), 1)), 0, $this->config['num_chars']);
91 91
             if (!$this->config['casesensitive']) {
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
             return;
101 101
         }
102 102
 
103
-        $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code;
104
-        $maxAttempts                          = (int)(@$_SESSION['XoopsCaptcha_maxattempts']);
103
+        $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code;
104
+        $maxAttempts                          = (int) (@$_SESSION['XoopsCaptcha_maxattempts']);
105 105
 
106 106
         // Increase the attempt records on refresh
107 107
         if (!empty($maxAttempts)) {
108
-            $_SESSION['XoopsCaptcha_attempt_' . $_SESSION['XoopsCaptcha_name']]++;
109
-            if ($_SESSION['XoopsCaptcha_attempt_' . $_SESSION['XoopsCaptcha_name']] > $maxAttempts) {
108
+            $_SESSION['XoopsCaptcha_attempt_'.$_SESSION['XoopsCaptcha_name']]++;
109
+            if ($_SESSION['XoopsCaptcha_attempt_'.$_SESSION['XoopsCaptcha_name']] > $maxAttempts) {
110 110
                 $this->invalid = true;
111 111
             }
112 112
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         if ($this->invalid) {
122 122
             header('Content-type: image/gif');
123
-            readfile(XOOPS_ROOT_PATH . '/images/subject/icon2.gif');
123
+            readfile(XOOPS_ROOT_PATH.'/images/subject/icon2.gif');
124 124
 
125 125
             return;
126 126
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             header('Content-type: image/jpeg');
191 191
             imagejpeg($this->oImage);
192 192
         } else {
193
-            imagejpeg($this->oImage, XOOPS_ROOT_PATH . '/' . $this->config['imagepath'] . '/' . $file . '.jpg');
193
+            imagejpeg($this->oImage, XOOPS_ROOT_PATH.'/'.$this->config['imagepath'].'/'.$file.'.jpg');
194 194
         }
195 195
         imagedestroy($this->oImage);
196 196
     }
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
          }
212 212
          }
213 213
          */
214
-        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
215
-        $file_path = $this->config['rootpath'] . "/{$name}";
214
+        require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
215
+        $file_path = $this->config['rootpath']."/{$name}";
216 216
         $files     = XoopsLists::getFileListAsArray($file_path);
217 217
         foreach ($files as $item) {
218 218
             if (empty($extension) || preg_match("/(\.{$extension})$/i", $item)) {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     public function loadFont()
230 230
     {
231 231
         $fonts      = $this->_getList('fonts', 'ttf');
232
-        $this->font = $this->config['rootpath'] . '/fonts/' . $fonts[array_rand($fonts)];
232
+        $this->font = $this->config['rootpath'].'/fonts/'.$fonts[array_rand($fonts)];
233 233
     }
234 234
 
235 235
     public function setImageSize()
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         imagedestroy($oImage);
256 256
 
257 257
         $this->height  = $MaxCharHeight + 2;
258
-        $this->spacing = (int)(($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']);
258
+        $this->spacing = (int) (($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']);
259 259
         $this->width   = ($this->config['num_chars'] * $MaxCharWidth) + ($this->spacing / 2);
260 260
     }
261 261
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     {
269 269
         $RandBackground = null;
270 270
         if ($backgrounds = $this->_getList('backgrounds', '(gif|jpg|png)')) {
271
-            $RandBackground = $this->config['rootpath'] . '/backgrounds/' . $backgrounds[array_rand($backgrounds)];
271
+            $RandBackground = $this->config['rootpath'].'/backgrounds/'.$backgrounds[array_rand($backgrounds)];
272 272
         }
273 273
 
274 274
         return $RandBackground;
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
     }
439 439
 }
440 440
 
441
-$config       = @include __DIR__ . '/../config.php';
441
+$config       = @include __DIR__.'/../config.php';
442 442
 $imageHandler = new \XoopsCaptchaImageHandler();
443 443
 $imageHandler->setConfig($config);
444 444
 $imageHandler->loadImage();
Please login to merge, or discard this patch.
include/captcha/formcaptcha.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
15 15
 
16
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
16
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
17 17
 
18 18
 /*
19 19
  * Usage
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $backgroundnum = null
63 63
     ) {
64 64
         if (!class_exists('XoopsCaptcaha')) {
65
-            require_once SMARTOBJECT_ROOT_PATH . '/include/captcha/captcha.php';
65
+            require_once SMARTOBJECT_ROOT_PATH.'/include/captcha/captcha.php';
66 66
         }
67 67
 
68 68
         $this->_captchaHandler = XoopsCaptcha::getInstance();
Please login to merge, or discard this patch.
include/rating.rate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 use XoopsModules\Smartobject\SmartPluginHandler;
12 12
 
13 13
 if (!defined('SMARTOBJECT_URL')) {
14
-    require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
14
+    require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
15 15
 }
16
-require_once SMARTOBJECT_ROOT_PATH . 'class/rating.php';
17
-require_once SMARTOBJECT_ROOT_PATH . 'include/functions.php';
16
+require_once SMARTOBJECT_ROOT_PATH.'class/rating.php';
17
+require_once SMARTOBJECT_ROOT_PATH.'include/functions.php';
18 18
 
19 19
 smart_loadLanguageFile('smartobject', 'rating');
20 20
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             $urls = smart_getCurrentUrls();
46 46
             $xoopsTpl->assign('smartobject_rating_current_page', $urls['full']);
47 47
             if (isset($xoTheme) && is_object($xoTheme)) {
48
-                $xoTheme->addStylesheet(SMARTOBJECT_URL . 'assets/css/module.css');
48
+                $xoTheme->addStylesheet(SMARTOBJECT_URL.'assets/css/module.css');
49 49
             } else {
50 50
                 //probleme d'inclusion de css apres le flashplayer. Style plac� dans css du theme
51 51
                 //$xoopsTpl->assign('smartobject_css',"<link rel='stylesheet' type='text/css' href='".XOOPS_URL."/modules/smartobject/assets/css/module.css'>");
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function smart_get_css_link($cssfile)
20 20
 {
21
-    $ret = '<link rel="stylesheet" type="text/css" href="' . $cssfile . '">';
21
+    $ret = '<link rel="stylesheet" type="text/css" href="'.$cssfile.'">';
22 22
 
23 23
     return $ret;
24 24
 }
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
         $seoMode = smart_getModuleModeSEO($moduleName);
110 110
         if ('rewrite' === $seoMode) {
111 111
             $seoModuleName = smart_getModuleNameForSEO($moduleName);
112
-            $ret           = XOOPS_URL . '/' . $seoModuleName . '/';
112
+            $ret           = XOOPS_URL.'/'.$seoModuleName.'/';
113 113
         } elseif ('pathinfo' === $seoMode) {
114
-            $ret = XOOPS_URL . '/modules/' . $moduleName . '/seo.php/' . $seoModuleName . '/';
114
+            $ret = XOOPS_URL.'/modules/'.$moduleName.'/seo.php/'.$seoModuleName.'/';
115 115
         } else {
116
-            $ret = XOOPS_URL . '/modules/' . $moduleName . '/';
116
+            $ret = XOOPS_URL.'/modules/'.$moduleName.'/';
117 117
         }
118 118
 
119
-        return '<a href="' . $ret . '">' . $smartModule->getVar('name') . '</a>';
119
+        return '<a href="'.$ret.'">'.$smartModule->getVar('name').'</a>';
120 120
     }
121 121
 }
122 122
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     //Verifies that a MySQL table exists
219 219
     $xoopsDB  = \XoopsDatabaseFactory::getDatabaseConnection();
220 220
     $realname = $xoopsDB->prefix($table);
221
-    $sql      = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
221
+    $sql      = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
222 222
     $ret      = $xoopsDB->queryF($sql);
223 223
     while (false !== (list($m_table) = $xoopsDB->fetchRow($ret))) {
224 224
         if ($m_table == $realname) {
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         $moduleName = smart_getCurrentModuleName();
248 248
     }
249 249
     $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
250
-    $sql     = sprintf('SELECT metavalue FROM `%s` WHERE metakey=%s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key));
250
+    $sql     = sprintf('SELECT metavalue FROM `%s` WHERE metakey=%s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key));
251 251
     $ret     = $xoopsDB->query($sql);
252 252
     if (!$ret) {
253 253
         $value = false;
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
     $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
291 291
     $ret     = smart_GetMeta($key, $moduleName);
292 292
     if ('0' === $ret || $ret > 0) {
293
-        $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
293
+        $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
294 294
     } else {
295
-        $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
295
+        $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
296 296
     }
297 297
     $ret = $xoopsDB->queryF($sql);
298 298
     if (!$ret) {
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 {
473 473
     static $smartModules;
474 474
     if (isset($smartModules[$moduleName])) {
475
-        $ret =& $smartModules[$moduleName];
475
+        $ret = & $smartModules[$moduleName];
476 476
 
477 477
         return $ret;
478 478
     }
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 {
509 509
     static $smartConfigs;
510 510
     if (isset($smartConfigs[$moduleName])) {
511
-        $ret =& $smartConfigs[$moduleName];
511
+        $ret = & $smartConfigs[$moduleName];
512 512
 
513 513
         return $ret;
514 514
     }
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
             return $ret;
537 537
         }
538 538
         $hModConfig                = xoops_getHandler('config');
539
-        $smartConfigs[$moduleName] =& $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
539
+        $smartConfigs[$moduleName] = & $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
540 540
     }
541 541
 
542 542
     return $smartConfigs[$moduleName];
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 {
563 563
     $ret = '';
564 564
     foreach ($errors as $key => $value) {
565
-        $ret .= '<br> - ' . $value;
565
+        $ret .= '<br> - '.$value;
566 566
     }
567 567
 
568 568
     return $ret;
@@ -582,17 +582,17 @@  discard block
 block discarded – undo
582 582
     if (!is_numeric($userid)) {
583 583
         return $userid;
584 584
     }
585
-    $userid = (int)$userid;
585
+    $userid = (int) $userid;
586 586
     if ($userid > 0) {
587 587
         if ($users == []) {
588 588
             //fetching users
589 589
             $memberHandler = xoops_getHandler('member');
590
-            $user          =& $memberHandler->getUser($userid);
590
+            $user          = & $memberHandler->getUser($userid);
591 591
         } else {
592 592
             if (!isset($users[$userid])) {
593 593
                 return $GLOBALS['xoopsConfig']['anonymous'];
594 594
             }
595
-            $user =& $users[$userid];
595
+            $user = & $users[$userid];
596 596
         }
597 597
         if (is_object($user)) {
598 598
             $ts        = MyTextSanitizer:: getInstance();
@@ -603,15 +603,15 @@  discard block
 block discarded – undo
603 603
                 $fullname = $user->getVar('name');
604 604
             }
605 605
             if (!empty($fullname)) {
606
-                $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
606
+                $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
607 607
             } else {
608
-                $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
608
+                $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
609 609
             }
610 610
             // add contact info: email + PM
611 611
             if ($withContact) {
612
-                $linkeduser .= ' <a href="mailto:' . $user->getVar('email') . '"><img style="vertical-align: middle;" src="' . XOOPS_URL . '/images/icons/email.gif' . '" alt="' . _CO_SOBJECT_SEND_EMAIL . '" title="' . _CO_SOBJECT_SEND_EMAIL . '"></a>';
613
-                $js         = "javascript:openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $userid . "', 'pmlite',450,370);";
614
-                $linkeduser .= ' <a href="' . $js . '"><img style="vertical-align: middle;" src="' . XOOPS_URL . '/images/icons/pm.gif' . '" alt="' . _CO_SOBJECT_SEND_PM . '" title="' . _CO_SOBJECT_SEND_PM . '"></a>';
612
+                $linkeduser .= ' <a href="mailto:'.$user->getVar('email').'"><img style="vertical-align: middle;" src="'.XOOPS_URL.'/images/icons/email.gif'.'" alt="'._CO_SOBJECT_SEND_EMAIL.'" title="'._CO_SOBJECT_SEND_EMAIL.'"></a>';
613
+                $js = "javascript:openWithSelfMain('".XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$userid."', 'pmlite',450,370);";
614
+                $linkeduser .= ' <a href="'.$js.'"><img style="vertical-align: middle;" src="'.XOOPS_URL.'/images/icons/pm.gif'.'" alt="'._CO_SOBJECT_SEND_PM.'" title="'._CO_SOBJECT_SEND_PM.'"></a>';
615 615
             }
616 616
 
617 617
             return $linkeduser;
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 function smart_adminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1)
631 631
 {
632 632
     global $xoopsModule, $xoopsConfig;
633
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
633
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
634 634
 
635 635
 
636 636
     /** @var Smartobject\Helper $helper */
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
     $helper->loadLanguage('modinfo');
640 640
     $headermenu  = [];
641 641
     $adminObject = [];
642
-    include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/menu.php';
642
+    include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/admin/menu.php';
643 643
     $tpl = new \XoopsTpl();
644 644
     $tpl->assign([
645 645
                      'headermenu'      => $headermenu,
@@ -662,11 +662,11 @@  discard block
 block discarded – undo
662 662
 function smart_collapsableBar($id = '', $title = '', $dsc = '')
663 663
 {
664 664
     global $xoopsModule;
665
-    echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"togglecollapse('" . $id . "'); toggleIcon('" . $id . "_icon')\";>";
666
-    echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a>&nbsp;" . $title . '</h3>';
667
-    echo "<div id='" . $id . "'>";
665
+    echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"togglecollapse('".$id."'); toggleIcon('".$id."_icon')\";>";
666
+    echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a>&nbsp;".$title.'</h3>';
667
+    echo "<div id='".$id."'>";
668 668
     if ('' !== $dsc) {
669
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $dsc . '</span>';
669
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$dsc.'</span>';
670 670
     }
671 671
 }
672 672
 
@@ -680,11 +680,11 @@  discard block
 block discarded – undo
680 680
     global $xoopsModule;
681 681
     $onClick = "ajaxtogglecollapse('$id')";
682 682
     //$onClick = "togglecollapse('$id'); toggleIcon('" . $id . "_icon')";
683
-    echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="' . $onClick . '">';
684
-    echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a>&nbsp;" . $title . '</h3>';
685
-    echo "<div id='" . $id . "'>";
683
+    echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="'.$onClick.'">';
684
+    echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a>&nbsp;".$title.'</h3>';
685
+    echo "<div id='".$id."'>";
686 686
     if ('' !== $dsc) {
687
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $dsc . '</span>';
687
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$dsc.'</span>';
688 688
     }
689 689
 }
690 690
 
@@ -714,13 +714,13 @@  discard block
 block discarded – undo
714 714
 {
715 715
     $urls        = smart_getCurrentUrls();
716 716
     $path        = $urls['phpself'];
717
-    $cookie_name = $path . '_smart_collaps_' . $name;
717
+    $cookie_name = $path.'_smart_collaps_'.$name;
718 718
     $cookie_name = str_replace('.', '_', $cookie_name);
719 719
     $cookie      = smart_getCookieVar($cookie_name, '');
720 720
     if ('none' === $cookie) {
721 721
         echo '
722 722
                 <script type="text/javascript"><!--
723
-                togglecollapse("' . $name . '"); toggleIcon("' . $name . '_icon");
723
+                togglecollapse("' . $name.'"); toggleIcon("'.$name.'_icon");
724 724
                     //-->
725 725
                 </script>
726 726
                 ';
@@ -786,17 +786,17 @@  discard block
 block discarded – undo
786 786
     $httphost    = $_SERVER['HTTP_HOST'];
787 787
     $querystring = $_SERVER['QUERY_STRING'];
788 788
     if ('' !== $querystring) {
789
-        $querystring = '?' . $querystring;
789
+        $querystring = '?'.$querystring;
790 790
     }
791
-    $currenturl           = $http . $httphost . $phpself . $querystring;
791
+    $currenturl           = $http.$httphost.$phpself.$querystring;
792 792
     $urls                 = [];
793 793
     $urls['http']         = $http;
794 794
     $urls['httphost']     = $httphost;
795 795
     $urls['phpself']      = $phpself;
796 796
     $urls['querystring']  = $querystring;
797
-    $urls['full_phpself'] = $http . $httphost . $phpself;
797
+    $urls['full_phpself'] = $http.$httphost.$phpself;
798 798
     $urls['full']         = $currenturl;
799
-    $urls['isHomePage']   = (XOOPS_URL . '/index.php') == ($http . $httphost . $phpself);
799
+    $urls['isHomePage']   = (XOOPS_URL.'/index.php') == ($http.$httphost.$phpself);
800 800
 
801 801
     return $urls;
802 802
 }
@@ -873,13 +873,13 @@  discard block
 block discarded – undo
873 873
 {
874 874
     global $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
875 875
 
876
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
876
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
877 877
     $tpl = new \XoopsTpl();
878 878
 
879 879
     $hModule      = xoops_getHandler('module');
880
-    $versioninfo  =& $hModule->get($xoopsModule->getVar('mid'));
881
-    $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . '';
882
-    $modfooter    = "<a href='" . $versioninfo->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/cssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>";
880
+    $versioninfo  = & $hModule->get($xoopsModule->getVar('mid'));
881
+    $modfootertxt = 'Module '.$versioninfo->getInfo('name').' - Version '.$versioninfo->getInfo('version').'';
882
+    $modfooter    = "<a href='".$versioninfo->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/assets/images/cssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>";
883 883
     $tpl->assign('modfooter', $modfooter);
884 884
 
885 885
     if (!defined('_AM_SOBJECT_XOOPS_PRO')) {
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
     }
888 888
     $smartobjectConfig = smart_getModuleConfig('smartobject');
889 889
     $tpl->assign('smartobject_enable_admin_footer', $smartobjectConfig['enable_admin_footer']);
890
-    $tpl->display(SMARTOBJECT_ROOT_PATH . 'templates/smartobject_admin_footer.tpl');
890
+    $tpl->display(SMARTOBJECT_ROOT_PATH.'templates/smartobject_admin_footer.tpl');
891 891
 }
892 892
 
893 893
 function smart_xoops_cp_footer()
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
  */
915 915
 function smart_addScript($src)
916 916
 {
917
-    echo '<script src="' . $src . '" type="text/javascript"></script>';
917
+    echo '<script src="'.$src.'" type="text/javascript"></script>';
918 918
 }
919 919
 
920 920
 /**
@@ -923,16 +923,16 @@  discard block
 block discarded – undo
923 923
 function smart_addStyle($src)
924 924
 {
925 925
     if ('smartobject' === $src) {
926
-        $src = SMARTOBJECT_URL . 'assets/css/module.css';
926
+        $src = SMARTOBJECT_URL.'assets/css/module.css';
927 927
     }
928 928
     echo smart_get_css_link($src);
929 929
 }
930 930
 
931 931
 function smart_addAdminAjaxSupport()
932 932
 {
933
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/lib/prototype.js');
934
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/scriptaculous.js');
935
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/smart.js');
933
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/lib/prototype.js');
934
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/scriptaculous.js');
935
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/smart.js');
936 936
 }
937 937
 
938 938
 /**
@@ -992,8 +992,8 @@  discard block
 block discarded – undo
992 992
 function smart_htmlnumericentities($str)
993 993
 {
994 994
     //    return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
995
-    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function ($m) {
996
-        return '&#' . ord($m[0]) . chr(59);
995
+    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function($m) {
996
+        return '&#'.ord($m[0]).chr(59);
997 997
     }, $str);
998 998
 }
999 999
 
@@ -1007,16 +1007,16 @@  discard block
 block discarded – undo
1007 1007
     static $handlers;
1008 1008
     $name = strtolower(trim($name));
1009 1009
     if (!isset($handlers[$name])) {
1010
-        if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) {
1010
+        if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/kernel/'.$name.'.php')) {
1011 1011
             require_once $hnd_file;
1012 1012
         }
1013
-        $class = 'Xoops' . ucfirst($name) . 'Handler';
1013
+        $class = 'Xoops'.ucfirst($name).'Handler';
1014 1014
         if (class_exists($class)) {
1015 1015
             $handlers[$name] = new $class($GLOBALS['xoopsDB'], 'xoops');
1016 1016
         }
1017 1017
     }
1018 1018
     if (!isset($handlers[$name]) && !$optional) {
1019
-        trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
1019
+        trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
1020 1020
     }
1021 1021
     if (isset($handlers[$name])) {
1022 1022
         return $handlers[$name];
@@ -1096,9 +1096,9 @@  discard block
 block discarded – undo
1096 1096
 {
1097 1097
     global $xoopsConfig;
1098 1098
 
1099
-    $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/' . $xoopsConfig['language'] . '/' . $file . '.php';
1099
+    $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/'.$xoopsConfig['language'].'/'.$file.'.php';
1100 1100
     if (!file_exists($filename)) {
1101
-        $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/english/' . $file . '.php';
1101
+        $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/english/'.$file.'.php';
1102 1102
     }
1103 1103
     if (file_exists($filename)) {
1104 1104
         require_once $filename;
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
     $text = preg_replace($search, $replace, $document);
1196 1196
 
1197
-    preg_replace_callback('/&#(\d+);/', function ($matches) {
1197
+    preg_replace_callback('/&#(\d+);/', function($matches) {
1198 1198
         return chr($matches[1]);
1199 1199
     }, $document);
1200 1200
 
@@ -1217,21 +1217,21 @@  discard block
 block discarded – undo
1217 1217
         $str = $match[0];
1218 1218
         if (false !== strpos($str, ',')) {
1219 1219
             // A comma exists, that makes it easy, cos we assume it separates the decimal part.
1220
-            $str = str_replace('.', '', $str);    // Erase thousand seps
1221
-            $str = str_replace(',', '.', $str);    // Convert , to . for floatval command
1220
+            $str = str_replace('.', '', $str); // Erase thousand seps
1221
+            $str = str_replace(',', '.', $str); // Convert , to . for floatval command
1222 1222
 
1223
-            return (float)$str;
1223
+            return (float) $str;
1224 1224
         } else {
1225 1225
             // No comma exists, so we have to decide, how a single dot shall be treated
1226 1226
             if (true === preg_match("/^[0-9\-]*[\.]{1}[0-9-]+$/", $str) && true === $set['single_dot_as_decimal']) {
1227 1227
                 // Treat single dot as decimal separator
1228
-                return (float)$str;
1228
+                return (float) $str;
1229 1229
             } else {
1230 1230
                 //echo "str: ".$str; echo "ret: ".str_replace('.', '', $str); echo "<br><br> ";
1231 1231
                 // Else, treat all dots as thousand seps
1232
-                $str = str_replace('.', '', $str);    // Erase thousand seps
1232
+                $str = str_replace('.', '', $str); // Erase thousand seps
1233 1233
 
1234
-                return (float)$str;
1234
+                return (float) $str;
1235 1235
             }
1236 1236
         }
1237 1237
     } else {
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
         $ret .= '.00';
1264 1264
     }
1265 1265
     if ($currencyObj) {
1266
-        $ret = $ret . ' ' . $currencyObj->getCode();
1266
+        $ret = $ret.' '.$currencyObj->getCode();
1267 1267
     }
1268 1268
 
1269 1269
     return $ret;
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
     }
1291 1291
     $ret = '';
1292 1292
     if ($moduleName) {
1293
-        $ret = "<a href='" . XOOPS_URL . "/modules/$moduleName/admin/index.php'>" . _CO_SOBJECT_ADMIN_PAGE . '</a>';
1293
+        $ret = "<a href='".XOOPS_URL."/modules/$moduleName/admin/index.php'>"._CO_SOBJECT_ADMIN_PAGE.'</a>';
1294 1294
     }
1295 1295
 
1296 1296
     return $ret;
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
  */
1302 1302
 function smart_getEditors()
1303 1303
 {
1304
-    $filename = XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php';
1304
+    $filename = XOOPS_ROOT_PATH.'/class/xoopseditor/xoopseditor.php';
1305 1305
     if (!file_exists($filename)) {
1306 1306
         return false;
1307 1307
     }
@@ -1325,9 +1325,9 @@  discard block
 block discarded – undo
1325 1325
 {
1326 1326
     $ret = [];
1327 1327
     foreach ($items as $item) {
1328
-        $ret[] = $moduleName . '_' . $item;
1328
+        $ret[] = $moduleName.'_'.$item;
1329 1329
     }
1330
-    $ret[] = $moduleName . '_meta';
1330
+    $ret[] = $moduleName.'_meta';
1331 1331
 
1332 1332
     return $ret;
1333 1333
 }
Please login to merge, or discard this patch.
include/config.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@  discard block
 block discarded – undo
21 21
 {
22 22
     $moduleDirName      = basename(dirname(__DIR__));
23 23
     $moduleDirNameUpper = strtoupper($moduleDirName);
24
-    return (object)[
25
-        'name'           => strtoupper($moduleDirName) . ' Module Configurator',
24
+    return (object) [
25
+        'name'           => strtoupper($moduleDirName).' Module Configurator',
26 26
         'paths'          => [
27 27
             'dirname'    => $moduleDirName,
28
-            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
29
-            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
30
-            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
31
-            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
32
-            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
28
+            'admin'      => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin',
29
+            'modPath'    => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName,
30
+            'modUrl'     => XOOPS_URL.'/modules/'.$moduleDirName,
31
+            'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
32
+            'uploadUrl'  => XOOPS_UPLOAD_URL.'/'.$moduleDirName,
33 33
         ],
34 34
         'uploadFolders'  => [
35
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
36
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category',
37
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots',
35
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
36
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category',
37
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots',
38 38
             //XOOPS_UPLOAD_PATH . '/flags'
39 39
         ],
40 40
         'copyBlankFiles' => [
41
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
42
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category',
43
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots',
41
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
42
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category',
43
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots',
44 44
             //XOOPS_UPLOAD_PATH . '/flags'
45 45
         ],
46 46
 
@@ -75,6 +75,6 @@  discard block
 block discarded – undo
75 75
             '/images',
76 76
         ],
77 77
         'modCopyright'    => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
78
-                     <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
78
+                     <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>',
79 79
     ];
80 80
 }
Please login to merge, or discard this patch.