Completed
Push — master ( 88111b...b3fce7 )
by Michael
05:58
created
class/Dbupdater.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     /**
144 144
      * Use to update a table
145 145
      *
146
-     * @param object $table {@link SmartDbTable} that will be updated
146
+     * @param DbTable $table {@link SmartDbTable} that will be updated
147 147
      *
148 148
      * @see DbTable
149 149
      *
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     /**
246 246
      * @param $module
247 247
      * @param $item
248
-     * @return bool
248
+     * @return false|null
249 249
      */
250 250
     public function upgradeObjectItem($module, $item)
251 251
     {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
  */
39 39
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
40 40
 if (!defined('SMARTOBJECT_ROOT_PATH')) {
41
-    require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
41
+    require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
42 42
 }
43 43
 /**
44 44
  * Include the language constants for the SmartObjectDBUpdater
45 45
  */
46 46
 global $xoopsConfig;
47
-$common_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/smartdbupdater.php';
47
+$common_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/smartdbupdater.php';
48 48
 if (!file_exists($common_file)) {
49
-    $common_file = SMARTOBJECT_ROOT_PATH . 'language/english/smartdbupdater.php';
49
+    $common_file = SMARTOBJECT_ROOT_PATH.'language/english/smartdbupdater.php';
50 50
 }
51 51
 include $common_file;
52 52
 
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
         $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to);
131 131
         $ret   = $xoopsDB->query($query);
132 132
         if (!$ret) {
133
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>';
133
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>';
134 134
 
135 135
             return false;
136 136
         } else {
137
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>';
137
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>';
138 138
 
139 139
             return true;
140 140
         }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             return false;
255 255
         }
256 256
 
257
-        $table      = new DbTable($module . '_' . $item);
257
+        $table      = new DbTable($module.'_'.$item);
258 258
         $object     = $moduleHandler->create();
259 259
         $objectVars = $object->getVars();
260 260
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 ";
276 276
                 }
277 277
             }
278
-            $structure .= 'PRIMARY KEY  (`' . $moduleHandler->keyName . '`)
278
+            $structure .= 'PRIMARY KEY  (`'.$moduleHandler->keyName.'`)
279 279
 ';
280 280
             $table->setStructure($structure);
281 281
             if (!$this->updateTable($table)) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
         ob_start();
337 337
 
338
-        $table = new DbTable($dirname . '_meta');
338
+        $table = new DbTable($dirname.'_meta');
339 339
         if (!$table->exists()) {
340 340
             $table->setStructure("
341 341
               `metakey` varchar(50) NOT NULL default '',
@@ -353,20 +353,20 @@  discard block
 block discarded – undo
353 353
         if (!$dbVersion) {
354 354
             $dbVersion = 0;
355 355
         }
356
-        $newDbVersion = constant(strtoupper($dirname . '_db_version')) ?: 0;
357
-        echo 'Database version: ' . $dbVersion . '<br>';
358
-        echo 'New database version: ' . $newDbVersion . '<br>';
356
+        $newDbVersion = constant(strtoupper($dirname.'_db_version')) ?: 0;
357
+        echo 'Database version: '.$dbVersion.'<br>';
358
+        echo 'New database version: '.$newDbVersion.'<br>';
359 359
 
360 360
         if ($newDbVersion > $dbVersion) {
361 361
             for ($i = $dbVersion + 1; $i <= $newDbVersion; ++$i) {
362
-                $upgrade_function = $dirname . '_db_upgrade_' . $i;
362
+                $upgrade_function = $dirname.'_db_upgrade_'.$i;
363 363
                 if (function_exists($upgrade_function)) {
364 364
                     $upgrade_function();
365 365
                 }
366 366
             }
367 367
         }
368 368
 
369
-        echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>';
369
+        echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>';
370 370
 
371 371
         // if there is a function to execute for this DB version, let's do it
372 372
         //$function_
Please login to merge, or discard this patch.
class/ObjectController.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 
127 127
     /**
128 128
      * @param        $smartObj
129
-     * @param        $objectid
130
-     * @param        $created_success_msg
131
-     * @param        $modified_success_msg
129
+     * @param        integer $objectid
130
+     * @param        string $created_success_msg
131
+     * @param        string $modified_success_msg
132 132
      * @param  bool  $redirect_page
133 133
      * @param  bool  $debug
134 134
      * @return mixed
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
     }
441 441
 
442 442
     /**
443
-     * @param         $smartObj
443
+     * @param         MlObject $smartObj
444 444
      * @param  bool   $onlyUrl
445 445
      * @param  bool   $withimage
446 446
      * @return string
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
     }
499 499
 
500 500
     /**
501
-     * @param $smartObj
501
+     * @param BaseSmartObject $smartObj
502 502
      * @return string
503 503
      */
504 504
     public function getPrintAndMailLink($smartObj)
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
         foreach (array_keys($smartObj->vars) as $key) {
53 53
             switch ($smartObj->vars[$key]['data_type']) {
54 54
                 case XOBJ_DTYPE_IMAGE:
55
-                    if (isset($_POST['url_' . $key]) && '' !== $_POST['url_' . $key]) {
56
-                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
57
-                        $smartObj->setVar($key, $_POST['url_' . $key]);
55
+                    if (isset($_POST['url_'.$key]) && '' !== $_POST['url_'.$key]) {
56
+                        $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e');
57
+                        $smartObj->setVar($key, $_POST['url_'.$key]);
58 58
                         if (file_exists($oldFile)) {
59 59
                             unlink($oldFile);
60 60
                         }
61 61
                     }
62
-                    if (isset($_POST['delete_' . $key]) && '1' == $_POST['delete_' . $key]) {
63
-                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
62
+                    if (isset($_POST['delete_'.$key]) && '1' == $_POST['delete_'.$key]) {
63
+                        $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e');
64 64
                         $smartObj->setVar($key, '');
65 65
                         if (file_exists($oldFile)) {
66 66
                             unlink($oldFile);
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 
71 71
                 case XOBJ_DTYPE_URLLINK:
72 72
                     $linkObj = $smartObj->getUrlLinkObj($key);
73
-                    $linkObj->setVar('caption', $_POST['caption_' . $key]);
74
-                    $linkObj->setVar('description', $_POST['desc_' . $key]);
75
-                    $linkObj->setVar('target', $_POST['target_' . $key]);
76
-                    $linkObj->setVar('url', $_POST['url_' . $key]);
73
+                    $linkObj->setVar('caption', $_POST['caption_'.$key]);
74
+                    $linkObj->setVar('description', $_POST['desc_'.$key]);
75
+                    $linkObj->setVar('target', $_POST['target_'.$key]);
76
+                    $linkObj->setVar('url', $_POST['url_'.$key]);
77 77
                     if ('' !== $linkObj->getVar('url')) {
78 78
                         $smartObj->storeUrlLinkObj($linkObj);
79 79
                     }
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
                     break;
83 83
 
84 84
                 case XOBJ_DTYPE_FILE:
85
-                    if (!isset($_FILES['upload_' . $key]['name']) || '' === $_FILES['upload_' . $key]['name']) {
85
+                    if (!isset($_FILES['upload_'.$key]['name']) || '' === $_FILES['upload_'.$key]['name']) {
86 86
                         $fileObj = $smartObj->getFileObj($key);
87
-                        $fileObj->setVar('caption', $_POST['caption_' . $key]);
88
-                        $fileObj->setVar('description', $_POST['desc_' . $key]);
89
-                        $fileObj->setVar('url', $_POST['url_' . $key]);
87
+                        $fileObj->setVar('caption', $_POST['caption_'.$key]);
88
+                        $fileObj->setVar('description', $_POST['desc_'.$key]);
89
+                        $fileObj->setVar('url', $_POST['url_'.$key]);
90 90
                         if (!('' === $fileObj->getVar('url') && '' === $fileObj->getVar('url')
91 91
                               && '' === $fileObj->getVar('url'))) {
92 92
                             $res = $smartObj->storeFileObj($fileObj);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                         $value = strtotime($_POST[$key]);
111 111
                         //if strtotime returns false, the value is already a time stamp
112 112
                         if (!$value) {
113
-                            $value = (int)$_POST[$key];
113
+                            $value = (int) $_POST[$key];
114 114
                         }
115 115
                     }
116 116
                     $smartObj->setVar($key, $value);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 if (isset($file_array['name']) && '' !== $file_array['name']
160 160
                     && in_array(str_replace('upload_', '', $name), array_keys($smartObj->vars))) {
161 161
                     if ($uploaderObj->fetchMedia($name)) {
162
-                        $uploaderObj->setTargetFileName(time() . '_' . $uploaderObj->getMediaName());
162
+                        $uploaderObj->setTargetFileName(time().'_'.$uploaderObj->getMediaName());
163 163
                         if ($uploaderObj->upload()) {
164 164
                             // Find the related field in the SmartObject
165 165
                             $related_field   = str_replace('upload_', '', $name);
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
                             if (XOBJ_DTYPE_FILE === $smartObj->vars[$related_field]['data_type']) {
169 169
                                 $object_fileurl = $smartObj->getUploadDir();
170 170
                                 $fileObj        = $smartObj->getFileObj($related_field);
171
-                                $fileObj->setVar('url', $object_fileurl . $uploaderObj->getSavedFileName());
172
-                                $fileObj->setVar('caption', $_POST['caption_' . $related_field]);
173
-                                $fileObj->setVar('description', $_POST['desc_' . $related_field]);
171
+                                $fileObj->setVar('url', $object_fileurl.$uploaderObj->getSavedFileName());
172
+                                $fileObj->setVar('caption', $_POST['caption_'.$related_field]);
173
+                                $fileObj->setVar('description', $_POST['desc_'.$related_field]);
174 174
                                 $smartObj->storeFileObj($fileObj);
175 175
                                 //todo: catch errors
176 176
                                 $smartObj->setVar($related_field, $fileObj->getVar('fileid'));
177 177
                             } else {
178
-                                $old_file = $smartObj->getUploadDir(true) . $smartObj->getVar($related_field);
178
+                                $old_file = $smartObj->getUploadDir(true).$smartObj->getVar($related_field);
179 179
                                 unlink($old_file);
180 180
                                 $smartObj->setVar($related_field, $uploaderObj->getSavedFileName());
181 181
                             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             return $smartObj;
207 207
         } else {
208 208
             if (!$storeResult) {
209
-                redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $smartObj->getHtmlErrors());
209
+                redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$smartObj->getHtmlErrors());
210 210
             }
211 211
 
212 212
             $redirect_page = $redirect_page ?: Smartobject\Utility::getPageBeforeForm();
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $debug = false,
236 236
         $x_param = false
237 237
     ) {
238
-        $objectid = isset($_POST[$this->handler->keyName]) ? (int)$_POST[$this->handler->keyName] : 0;
238
+        $objectid = isset($_POST[$this->handler->keyName]) ? (int) $_POST[$this->handler->keyName] : 0;
239 239
         if ($debug) {
240 240
             if ($x_param) {
241 241
                 $smartObj = $this->handler->getD($objectid, true, $x_param);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
     {
312 312
         global $smart_previous_page;
313 313
 
314
-        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0;
314
+        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0;
315 315
         $smartObj = $this->handler->get($objectid);
316 316
 
317 317
         if ($smartObj->isNew()) {
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
322 322
         if ($confirm) {
323 323
             if (!$this->handler->delete($smartObj)) {
324
-                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors());
324
+                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors());
325 325
             }
326 326
 
327 327
             redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_SUCCESS);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     {
355 355
         global $smart_previous_page, $xoopsTpl;
356 356
 
357
-        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0;
357
+        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0;
358 358
         $smartObj = $this->handler->get($objectid);
359 359
 
360 360
         if ($smartObj->isNew()) {
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
365 365
         if ($confirm) {
366 366
             if (!$this->handler->delete($smartObj)) {
367
-                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors());
367
+                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors());
368 368
             }
369 369
 
370 370
             redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_SUCCESS);
@@ -396,14 +396,14 @@  discard block
 block discarded – undo
396 396
      */
397 397
     public function getAdminViewItemLink(SmartObject $smartObj, $onlyUrl = false, $withimage = false)
398 398
     {
399
-        $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=view&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
399
+        $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=view&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
400 400
         if ($onlyUrl) {
401 401
             return $ret;
402 402
         } elseif ($withimage) {
403
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "viewmag.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_ADMIN_VIEW . "'  title='" . _CO_SOBJECT_ADMIN_VIEW . "'></a>";
403
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."viewmag.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_ADMIN_VIEW."'  title='"._CO_SOBJECT_ADMIN_VIEW."'></a>";
404 404
         }
405 405
 
406
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
406
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
407 407
     }
408 408
 
409 409
     /**
@@ -425,15 +425,15 @@  discard block
 block discarded – undo
425 425
         $seoIncludeId = true;
426 426
 
427 427
         if ('rewrite' === $seoMode) {
428
-            $ret = XOOPS_URL . '/' . $seoModuleName . '.' . $this->handler->_itemname . ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . '/' . $smartObj->getVar('short_url') . '.html';
428
+            $ret = XOOPS_URL.'/'.$seoModuleName.'.'.$this->handler->_itemname.($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').'/'.$smartObj->getVar('short_url').'.html';
429 429
         } elseif ('pathinfo' === $seoMode) {
430
-            $ret = SMARTOBJECT_URL . 'seo.php/' . $seoModuleName . '.' . $this->handler->_itemname . ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . '/' . $smartObj->getVar('short_url') . '.html';
430
+            $ret = SMARTOBJECT_URL.'seo.php/'.$seoModuleName.'.'.$this->handler->_itemname.($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').'/'.$smartObj->getVar('short_url').'.html';
431 431
         } else {
432
-            $ret = $this->handler->_moduleUrl . $this->handler->_page . '?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
432
+            $ret = $this->handler->_moduleUrl.$this->handler->_page.'?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
433 433
         }
434 434
 
435 435
         if (!$onlyUrl) {
436
-            $ret = "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
436
+            $ret = "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
437 437
         }
438 438
 
439 439
         return $ret;
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
      */
448 448
     public function getEditLanguageLink($smartObj, $onlyUrl = false, $withimage = true)
449 449
     {
450
-        $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName) . '&language=' . $smartObj->getVar('language');
450
+        $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName).'&language='.$smartObj->getVar('language');
451 451
         if ($onlyUrl) {
452 452
             return $ret;
453 453
         } elseif ($withimage) {
454
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "wizard.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_LANGUAGE_MODIFY . "'  title='" . _CO_SOBJECT_LANGUAGE_MODIFY . "'></a>";
454
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."wizard.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_LANGUAGE_MODIFY."'  title='"._CO_SOBJECT_LANGUAGE_MODIFY."'></a>";
455 455
         }
456 456
 
457
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
457
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
458 458
     }
459 459
 
460 460
     /**
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
     public function getEditItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false)
468 468
     {
469 469
         $admin_side = $userSide ? '' : 'admin/';
470
-        $ret        = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
470
+        $ret        = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
471 471
         if ($onlyUrl) {
472 472
             return $ret;
473 473
         } elseif ($withimage) {
474
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "edit.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_MODIFY . "'  title='" . _CO_SOBJECT_MODIFY . "'></a>";
474
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."edit.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_MODIFY."'  title='"._CO_SOBJECT_MODIFY."'></a>";
475 475
         }
476 476
 
477
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
477
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
478 478
     }
479 479
 
480 480
     /**
@@ -487,14 +487,14 @@  discard block
 block discarded – undo
487 487
     public function getDeleteItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false)
488 488
     {
489 489
         $admin_side = $userSide ? '' : 'admin/';
490
-        $ret        = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=del&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
490
+        $ret        = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=del&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
491 491
         if ($onlyUrl) {
492 492
             return $ret;
493 493
         } elseif ($withimage) {
494
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "editdelete.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_DELETE . "'  title='" . _CO_SOBJECT_DELETE . "'></a>";
494
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."editdelete.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_DELETE."'  title='"._CO_SOBJECT_DELETE."'></a>";
495 495
         }
496 496
 
497
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
497
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
498 498
     }
499 499
 
500 500
     /**
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
     {
506 506
         global $xoopsConfig;
507 507
 
508
-        $printlink = $this->handler->_moduleUrl . 'print.php?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
509
-        $js        = "javascript:openWithSelfMain('" . $printlink . "', 'smartpopup', 700, 519);";
510
-        $printlink = '<a href="' . $js . '"><img  src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'fileprint.png" alt="" style="vertical-align: middle;"></a>';
508
+        $printlink = $this->handler->_moduleUrl.'print.php?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
509
+        $js        = "javascript:openWithSelfMain('".$printlink."', 'smartpopup', 700, 519);";
510
+        $printlink = '<a href="'.$js.'"><img  src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'fileprint.png" alt="" style="vertical-align: middle;"></a>';
511 511
 
512 512
         $smartModule = Smartobject\Utility::getModuleInfo($smartObj->handler->_moduleName);
513 513
         $link        = Smartobject\Utility::getCurrentPage();
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                        . _CO_SOBJECT_EMAIL
527 527
                        . '" style="vertical-align: middle;"></a>';
528 528
 
529
-        $ret = '<span id="smartobject_print_button">' . $printlink . '&nbsp;</span>' . '<span id="smartobject_mail_button">' . $friendlink . '</span>';
529
+        $ret = '<span id="smartobject_print_button">'.$printlink.'&nbsp;</span>'.'<span id="smartobject_mail_button">'.$friendlink.'</span>';
530 530
 
531 531
         return $ret;
532 532
     }
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
      */
537 537
     public function getModuleItemString()
538 538
     {
539
-        $ret = $this->handler->_moduleName . '_' . $this->handler->_itemname;
539
+        $ret = $this->handler->_moduleName.'_'.$this->handler->_itemname;
540 540
 
541 541
         return $ret;
542 542
     }
Please login to merge, or discard this patch.
class/SingleView.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     /**
34 34
      * Constructor
35
-     * @param       $object
35
+     * @param       BaseSmartObject $object
36 36
      * @param bool  $userSide
37 37
      * @param array $actions
38 38
      * @param bool  $headerAsRow
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-     * @param $rowObj
49
+     * @param ObjectRow $rowObj
50 50
      */
51 51
     public function addRow($rowObj)
52 52
     {
Please login to merge, or discard this patch.
class/Table.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     }
102 102
 
103 103
     /**
104
-     * @param $columnObj
104
+     * @param ObjectColumn $columnObj
105 105
      */
106 106
     public function addColumn($columnObj)
107 107
     {
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
     }
110 110
 
111 111
     /**
112
-     * @param $name
113
-     * @param $location
112
+     * @param string $name
113
+     * @param string $location
114 114
      * @param $value
115 115
      */
116 116
     public function addIntroButton($name, $location, $value)
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function addActionButton($op, $caption = false, $text = false)
94 94
     {
95
-        $action                 = [
95
+        $action = [
96 96
             'op'      => $op,
97 97
             'caption' => $caption,
98 98
             'text'    => $text
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $current_urls               = Smartobject\Utility::getCurrentUrls();
129 129
         $current_url                = $current_urls['full'];
130
-        $this->_printerFriendlyPage = $current_url . '&print';
130
+        $this->_printerFriendlyPage = $current_url.'&print';
131 131
     }
132 132
 
133 133
     /**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function addDefaultIntroButton($caption)
162 162
     {
163
-        $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page . '?op=mod', $caption);
163
+        $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page.'?op=mod', $caption);
164 164
     }
165 165
 
166 166
     /**
@@ -185,9 +185,9 @@  discard block
 block discarded – undo
185 185
     public function getDefaultSort()
186 186
     {
187 187
         if ($this->_sortsel) {
188
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel);
188
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel);
189 189
         } else {
190
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_objectHandler->identifierName);
190
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_objectHandler->identifierName);
191 191
         }
192 192
     }
193 193
 
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
     public function getDefaultOrder()
206 206
     {
207 207
         if ($this->_ordersel) {
208
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel);
208
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel);
209 209
         } else {
210
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', 'ASC');
210
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', 'ASC');
211 211
         }
212 212
     }
213 213
 
@@ -256,21 +256,21 @@  discard block
 block discarded – undo
256 256
 
257 257
     public function setSortOrder()
258 258
     {
259
-        $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] : $this->getDefaultSort();
259
+        $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] : $this->getDefaultSort();
260 260
         //$this->_sortsel = isset($_POST['sortsel']) ? $_POST['sortsel']: $this->_sortsel;
261
-        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel);
261
+        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel);
262 262
         $fieldsForSorting = $this->_tempObject->getFieldsForSorting($this->_sortsel);
263 263
 
264 264
         if (isset($this->_tempObject->vars[$this->_sortsel]['itemName'])
265 265
             && $this->_tempObject->vars[$this->_sortsel]['itemName']) {
266
-            $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'] . '.' . $this->_sortsel);
266
+            $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'].'.'.$this->_sortsel);
267 267
         } else {
268
-            $this->_criteria->setSort($this->_objectHandler->_itemname . '.' . $this->_sortsel);
268
+            $this->_criteria->setSort($this->_objectHandler->_itemname.'.'.$this->_sortsel);
269 269
         }
270 270
 
271
-        $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : $this->getDefaultOrder();
271
+        $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : $this->getDefaultOrder();
272 272
         //$this->_ordersel = isset($_POST['ordersel']) ? $_POST['ordersel']:$this->_ordersel;
273
-        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel);
273
+        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel);
274 274
         $ordersArray = $this->getOrdersArray();
275 275
         $this->_criteria->setOrder($this->_ordersel);
276 276
     }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                         //$object->initiateCustomFields();
321 321
                     }
322 322
                     if ('checked' === $column->_keyname) {
323
-                        $value = '<input type ="checkbox" name="selected_smartobjects[]" value="' . $object->id() . '">';
323
+                        $value = '<input type ="checkbox" name="selected_smartobjects[]" value="'.$object->id().'">';
324 324
                     } elseif ($column->_customMethodForValue
325 325
                               && method_exists($object, $column->_customMethodForValue)) {
326 326
                         $method = $column->_customMethodForValue;
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
     public function getDefaultFilter()
406 406
     {
407 407
         if ($this->_filtersel) {
408
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
408
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel);
409 409
         } else {
410
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', 'default');
410
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', 'default');
411 411
         }
412 412
     }
413 413
 
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
     public function getDefaultFilter2()
458 458
     {
459 459
         if ($this->_filtersel2) {
460
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2);
460
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2);
461 461
         } else {
462
-            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', 'default');
462
+            return Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', 'default');
463 463
         }
464 464
     }
465 465
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
      */
588 588
     public function render($fetchOnly = false, $debug = false)
589 589
     {
590
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
590
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
591 591
 
592 592
         $this->_tpl = new \XoopsTpl();
593 593
 
@@ -598,24 +598,24 @@  discard block
 block discarded – undo
598 598
          */
599 599
         $this->_tempObject = $this->_objectHandler->create();
600 600
 
601
-        $this->_criteria->setStart(isset($_GET['start' . $this->_objectHandler->keyName]) ? (int)$_GET['start' . $this->_objectHandler->keyName] : 0);
601
+        $this->_criteria->setStart(isset($_GET['start'.$this->_objectHandler->keyName]) ? (int) $_GET['start'.$this->_objectHandler->keyName] : 0);
602 602
 
603 603
         $this->setSortOrder();
604 604
 
605 605
         if (!$this->_isTree) {
606
-            $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'] . '_limitsel', '15');
606
+            $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : Smartobject\Utility::getCookieVar($_SERVER['PHP_SELF'].'_limitsel', '15');
607 607
         } else {
608 608
             $this->_limitsel = 'all';
609 609
         }
610 610
 
611 611
         $this->_limitsel = isset($_POST['limitsel']) ? $_POST['limitsel'] : $this->_limitsel;
612
-        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'] . '_limitsel', $this->_limitsel);
612
+        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'].'_limitsel', $this->_limitsel);
613 613
         $limitsArray = $this->getLimitsArray();
614 614
         $this->_criteria->setLimit($this->_limitsel);
615 615
 
616 616
         $this->_filtersel = isset($_GET['filtersel']) ? $_GET['filtersel'] : $this->getDefaultFilter();
617 617
         $this->_filtersel = isset($_POST['filtersel']) ? $_POST['filtersel'] : $this->_filtersel;
618
-        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
618
+        Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel);
619 619
         $filtersArray = $this->getFiltersArray();
620 620
 
621 621
         if ($filtersArray) {
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
                     $filters2Array = $this->getFilters2Array();
642 642
                     $this->_tpl->assign('smartobject_optionssel_filters2Array', $filters2Array);
643 643
 
644
-                    Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2);
644
+                    Smartobject\Utility::setCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2);
645 645
                     if ('default' !== $this->_filtersel2) {
646 646
                         $this->_criteria->add(new \Criteria($this->_filtersel, $this->_filtersel2));
647 647
                     }
@@ -650,21 +650,21 @@  discard block
 block discarded – undo
650 650
         }
651 651
         // Check if we have a quicksearch
652 652
 
653
-        if (isset($_POST['quicksearch_' . $this->_id]) && '' != $_POST['quicksearch_' . $this->_id]) {
653
+        if (isset($_POST['quicksearch_'.$this->_id]) && '' != $_POST['quicksearch_'.$this->_id]) {
654 654
             $quicksearch_criteria = new \CriteriaCompo();
655 655
             if (is_array($this->_quickSearch['fields'])) {
656 656
                 foreach ($this->_quickSearch['fields'] as $v) {
657
-                    $quicksearch_criteria->add(new \Criteria($v, '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'), 'OR');
657
+                    $quicksearch_criteria->add(new \Criteria($v, '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'), 'OR');
658 658
                 }
659 659
             } else {
660
-                $quicksearch_criteria->add(new \Criteria($this->_quickSearch['fields'], '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'));
660
+                $quicksearch_criteria->add(new \Criteria($this->_quickSearch['fields'], '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'));
661 661
             }
662 662
             $this->_criteria->add($quicksearch_criteria);
663 663
         }
664 664
 
665 665
         $this->_objects = $this->fetchObjects($debug);
666 666
 
667
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
667
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
668 668
         if ($this->_criteria->getLimit() > 0) {
669 669
 
670 670
             /**
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
              */
681 681
             $params_of_the_options_sel = [];
682 682
 
683
-            $not_needed_params = ['sortsel', 'limitsel', 'ordersel', 'start' . $this->_objectHandler->keyName];
683
+            $not_needed_params = ['sortsel', 'limitsel', 'ordersel', 'start'.$this->_objectHandler->keyName];
684 684
             foreach ($_GET as $k => $v) {
685 685
                 if (!in_array($k, $not_needed_params)) {
686 686
                     $new_get_array[]             = "$k=$v";
@@ -691,12 +691,12 @@  discard block
 block discarded – undo
691 691
             /**
692 692
              * Adding the new params of the pagenav
693 693
              */
694
-            $new_get_array[] = 'sortsel=' . $this->_sortsel;
695
-            $new_get_array[] = 'ordersel=' . $this->_ordersel;
696
-            $new_get_array[] = 'limitsel=' . $this->_limitsel;
694
+            $new_get_array[] = 'sortsel='.$this->_sortsel;
695
+            $new_get_array[] = 'ordersel='.$this->_ordersel;
696
+            $new_get_array[] = 'limitsel='.$this->_limitsel;
697 697
             $otherParams     = implode('&', $new_get_array);
698 698
 
699
-            $pagenav = new \XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start' . $this->_objectHandler->keyName, $otherParams);
699
+            $pagenav = new \XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start'.$this->_objectHandler->keyName, $otherParams);
700 700
             $this->_tpl->assign('smartobject_pagenav', $pagenav->renderNav());
701 701
         }
702 702
         $this->renderOptionSelection($limitsArray, $params_of_the_options_sel);
@@ -732,20 +732,20 @@  discard block
 block discarded – undo
732 732
             $aColumn['align'] = $column->getAlign();
733 733
             $aColumn['key']   = $column->getKeyName();
734 734
             if ('checked' === $column->_keyname) {
735
-                $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"' . ' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_' . $this->_id . ', \'selected_smartobjects\');">';
735
+                $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"'.' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_'.$this->_id.', \'selected_smartobjects\');">';
736 736
             } elseif ($column->getCustomCaption()) {
737 737
                 $aColumn['caption'] = $column->getCustomCaption();
738 738
             } else {
739 739
                 $aColumn['caption'] = isset($this->_tempObject->vars[$column->getKeyName()]['form_caption']) ? $this->_tempObject->vars[$column->getKeyName()]['form_caption'] : $column->getKeyName();
740 740
             }
741 741
             // Are we doing a GET sort on this column ?
742
-            $getSort = (isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'])
743
-                        && $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] == $column->getKeyName())
742
+            $getSort = (isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel'])
743
+                        && $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] == $column->getKeyName())
744 744
                        || ($this->_sortsel == $column->getKeyName());
745
-            $order   = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : 'DESC';
745
+            $order   = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : 'DESC';
746 746
 
747
-            if (isset($_REQUEST['quicksearch_' . $this->_id]) && '' != $_REQUEST['quicksearch_' . $this->_id]) {
748
-                $qs_param = '&quicksearch_' . $this->_id . '=' . $_REQUEST['quicksearch_' . $this->_id];
747
+            if (isset($_REQUEST['quicksearch_'.$this->_id]) && '' != $_REQUEST['quicksearch_'.$this->_id]) {
748
+                $qs_param = '&quicksearch_'.$this->_id.'='.$_REQUEST['quicksearch_'.$this->_id];
749 749
             }
750 750
             if (!$this->_enableColumnsSorting || 'checked' === $column->_keyname || !$column->isSortable()) {
751 751
                 $aColumn['caption'] = $aColumn['caption'];
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
                                       . $orderArray[$order]['image']
773 773
                                       . '" alt="ASC"></a>';
774 774
             } else {
775
-                $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=ASC' . $qs_param . '&' . $new_query_string . '">' . $aColumn['caption'] . '</a>';
775
+                $aColumn['caption'] = '<a href="'.$current_url.'?'.$this->_objectHandler->_itemname.'_'.'sortsel='.$column->getKeyName().'&'.$this->_objectHandler->_itemname.'_'.'ordersel=ASC'.$qs_param.'&'.$new_query_string.'">'.$aColumn['caption'].'</a>';
776 776
             }
777 777
             $aColumns[] = $aColumn;
778 778
         }
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
 
803 803
         $smartobjectTable_template = $this->_customTemplate ?: 'smartobject_smarttable_display.tpl';
804 804
         if ($fetchOnly) {
805
-            return $this->_tpl->fetch('db:' . $smartobjectTable_template);
805
+            return $this->_tpl->fetch('db:'.$smartobjectTable_template);
806 806
         } else {
807
-            $this->_tpl->display('db:' . $smartobjectTable_template);
807
+            $this->_tpl->display('db:'.$smartobjectTable_template);
808 808
         }
809 809
     }
810 810
 
Please login to merge, or discard this patch.
class/Utility.php 2 patches
Doc Comments   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     }
337 337
 
338 338
     /**
339
-     * @param              $key
339
+     * @param              string $key
340 340
      * @param  bool        $moduleName
341 341
      * @param  string      $default
342 342
      * @return null|string
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 
399 399
     /**
400 400
      * Thanks to the NewBB2 Development Team
401
-     * @param $target
401
+     * @param string $target
402 402
      * @return bool
403 403
      */
404 404
     public static function mkdirAsAdmin($target)
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 
552 552
     /**
553 553
      * @param $dirname
554
-     * @return bool
554
+     * @return boolean|null
555 555
      */
556 556
     public static function deleteFile($dirname)
557 557
     {
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
     }
745 745
 
746 746
     /**
747
-     * @param $name
747
+     * @param string $name
748 748
      */
749 749
     public static function closeCollapsable($name)
750 750
     {
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
     }
755 755
 
756 756
     /**
757
-     * @param     $name
757
+     * @param     string $name
758 758
      * @param     $value
759 759
      * @param int $time
760 760
      */
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
     }
769 769
 
770 770
     /**
771
-     * @param         $name
771
+     * @param         string $name
772 772
      * @param  string $default
773 773
      * @return string
774 774
      */
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
     }
918 918
 
919 919
     /**
920
-     * @param $src
920
+     * @param string $src
921 921
      */
922 922
     public static function addScript($src)
923 923
     {
@@ -1096,8 +1096,8 @@  discard block
 block discarded – undo
1096 1096
     }
1097 1097
 
1098 1098
     /**
1099
-     * @param $module
1100
-     * @param $file
1099
+     * @param string $module
1100
+     * @param string $file
1101 1101
      */
1102 1102
     public static function loadLanguageFile($module, $file)
1103 1103
     {
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
      * This function should be able to cover almost all floats that appear in an european environment.
1216 1216
      * @param            $str
1217 1217
      * @param  bool      $set
1218
-     * @return float|int
1218
+     * @return double
1219 1219
      */
1220 1220
     public static function getFloat($str, $set = false)
1221 1221
     {
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
     /**
1251 1251
      * @param                         $var
1252 1252
      * @param  bool                   $currencyObj
1253
-     * @return float|int|mixed|string
1253
+     * @return string
1254 1254
      */
1255 1255
     public static function getCurrency($var, $currencyObj = false)
1256 1256
     {
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 
1279 1279
     /**
1280 1280
      * @param $var
1281
-     * @return float|int|mixed|string
1281
+     * @return string
1282 1282
      */
1283 1283
     public static function float($var)
1284 1284
     {
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
     /**
1327 1327
      * @param $moduleName
1328 1328
      * @param $items
1329
-     * @return array
1329
+     * @return string[]
1330 1330
      */
1331 1331
     public static function getTablesArray($moduleName, $items)
1332 1332
     {
Please login to merge, or discard this patch.
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public static function getCssLink($cssfile)
27 27
     {
28
-        $ret = '<link rel="stylesheet" type="text/css" href="' . $cssfile . '">';
28
+        $ret = '<link rel="stylesheet" type="text/css" href="'.$cssfile.'">';
29 29
 
30 30
         return $ret;
31 31
     }
@@ -116,14 +116,14 @@  discard block
 block discarded – undo
116 116
             $seoMode = static::getModuleModeSEO($moduleName);
117 117
             if ('rewrite' === $seoMode) {
118 118
                 $seoModuleName = static::getModuleNameForSEO($moduleName);
119
-                $ret           = XOOPS_URL . '/' . $seoModuleName . '/';
119
+                $ret           = XOOPS_URL.'/'.$seoModuleName.'/';
120 120
             } elseif ('pathinfo' === $seoMode) {
121
-                $ret = XOOPS_URL . '/modules/' . $moduleName . '/seo.php/' . $seoModuleName . '/';
121
+                $ret = XOOPS_URL.'/modules/'.$moduleName.'/seo.php/'.$seoModuleName.'/';
122 122
             } else {
123
-                $ret = XOOPS_URL . '/modules/' . $moduleName . '/';
123
+                $ret = XOOPS_URL.'/modules/'.$moduleName.'/';
124 124
             }
125 125
 
126
-            return '<a href="' . $ret . '">' . $smartModule->getVar('name') . '</a>';
126
+            return '<a href="'.$ret.'">'.$smartModule->getVar('name').'</a>';
127 127
         }
128 128
     }
129 129
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         //Verifies that a MySQL table exists
226 226
         $xoopsDB  = \XoopsDatabaseFactory::getDatabaseConnection();
227 227
         $realname = $xoopsDB->prefix($table);
228
-        $sql      = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
228
+        $sql      = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
229 229
         $ret      = $xoopsDB->queryF($sql);
230 230
         while (false !== (list($m_table) = $xoopsDB->fetchRow($ret))) {
231 231
             if ($m_table == $realname) {
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $moduleName = static::getCurrentModuleName();
255 255
         }
256 256
         $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
257
-        $sql     = sprintf('SELECT metavalue FROM `%s` WHERE metakey=%s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key));
257
+        $sql     = sprintf('SELECT metavalue FROM `%s` WHERE metakey=%s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key));
258 258
         $ret     = $xoopsDB->query($sql);
259 259
         if (!$ret) {
260 260
             $value = false;
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
         $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
298 298
         $ret     = static::getMeta($key, $moduleName);
299 299
         if ('0' === $ret || $ret > 0) {
300
-            $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
300
+            $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
301 301
         } else {
302
-            $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
302
+            $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
303 303
         }
304 304
         $ret = $xoopsDB->queryF($sql);
305 305
         if (!$ret) {
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
     {
480 480
         static $smartModules;
481 481
         if (isset($smartModules[$moduleName])) {
482
-            $ret =& $smartModules[$moduleName];
482
+            $ret = & $smartModules[$moduleName];
483 483
 
484 484
             return $ret;
485 485
         }
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
     {
516 516
         static $smartConfigs;
517 517
         if (isset($smartConfigs[$moduleName])) {
518
-            $ret =& $smartConfigs[$moduleName];
518
+            $ret = & $smartConfigs[$moduleName];
519 519
 
520 520
             return $ret;
521 521
         }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                 return $ret;
544 544
             }
545 545
             $hModConfig                = xoops_getHandler('config');
546
-            $smartConfigs[$moduleName] =& $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
546
+            $smartConfigs[$moduleName] = & $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
547 547
         }
548 548
 
549 549
         return $smartConfigs[$moduleName];
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
     {
570 570
         $ret = '';
571 571
         foreach ($errors as $key => $value) {
572
-            $ret .= '<br> - ' . $value;
572
+            $ret .= '<br> - '.$value;
573 573
         }
574 574
 
575 575
         return $ret;
@@ -589,17 +589,17 @@  discard block
 block discarded – undo
589 589
         if (!is_numeric($userid)) {
590 590
             return $userid;
591 591
         }
592
-        $userid = (int)$userid;
592
+        $userid = (int) $userid;
593 593
         if ($userid > 0) {
594 594
             if ($users == []) {
595 595
                 //fetching users
596 596
                 $memberHandler = xoops_getHandler('member');
597
-                $user          =& $memberHandler->getUser($userid);
597
+                $user          = & $memberHandler->getUser($userid);
598 598
             } else {
599 599
                 if (!isset($users[$userid])) {
600 600
                     return $GLOBALS['xoopsConfig']['anonymous'];
601 601
                 }
602
-                $user =& $users[$userid];
602
+                $user = & $users[$userid];
603 603
             }
604 604
             if (is_object($user)) {
605 605
                 $ts        = \MyTextSanitizer:: getInstance();
@@ -610,15 +610,15 @@  discard block
 block discarded – undo
610 610
                     $fullname = $user->getVar('name');
611 611
                 }
612 612
                 if (!empty($fullname)) {
613
-                    $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
613
+                    $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
614 614
                 } else {
615
-                    $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
615
+                    $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
616 616
                 }
617 617
                 // add contact info: email + PM
618 618
                 if ($withContact) {
619
-                    $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>';
620
-                    $js         = "javascript:openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $userid . "', 'pmlite',450,370);";
621
-                    $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>';
619
+                    $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>';
620
+                    $js = "javascript:openWithSelfMain('".XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$userid."', 'pmlite',450,370);";
621
+                    $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>';
622 622
                 }
623 623
 
624 624
                 return $linkeduser;
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
     public static function getAdminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1)
638 638
     {
639 639
         global $xoopsModule, $xoopsConfig;
640
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
640
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
641 641
 
642 642
 
643 643
         /** @var Smartobject\Helper $helper */
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
         $helper->loadLanguage('modinfo');
647 647
         $headermenu  = [];
648 648
         $adminObject = [];
649
-        include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/menu.php';
649
+        include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/admin/menu.php';
650 650
         $tpl = new \XoopsTpl();
651 651
         $tpl->assign([
652 652
                          'headermenu'      => $headermenu,
@@ -669,11 +669,11 @@  discard block
 block discarded – undo
669 669
     public static function getCollapsableBar($id = '', $title = '', $dsc = '')
670 670
     {
671 671
         global $xoopsModule;
672
-        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')\";>";
673
-        echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a>&nbsp;" . $title . '</h3>';
674
-        echo "<div id='" . $id . "'>";
672
+        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')\";>";
673
+        echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a>&nbsp;".$title.'</h3>';
674
+        echo "<div id='".$id."'>";
675 675
         if ('' !== $dsc) {
676
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $dsc . '</span>';
676
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$dsc.'</span>';
677 677
         }
678 678
     }
679 679
 
@@ -687,11 +687,11 @@  discard block
 block discarded – undo
687 687
         global $xoopsModule;
688 688
         $onClick = "ajaxtogglecollapse('$id')";
689 689
         //$onClick = "togglecollapse('$id'); toggleIcon('" . $id . "_icon')";
690
-        echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="' . $onClick . '">';
691
-        echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a>&nbsp;" . $title . '</h3>';
692
-        echo "<div id='" . $id . "'>";
690
+        echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="'.$onClick.'">';
691
+        echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a>&nbsp;".$title.'</h3>';
692
+        echo "<div id='".$id."'>";
693 693
         if ('' !== $dsc) {
694
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $dsc . '</span>';
694
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$dsc.'</span>';
695 695
         }
696 696
     }
697 697
 
@@ -721,13 +721,13 @@  discard block
 block discarded – undo
721 721
     {
722 722
         $urls        = static::getCurrentUrls();
723 723
         $path        = $urls['phpself'];
724
-        $cookie_name = $path . '_smart_collaps_' . $name;
724
+        $cookie_name = $path.'_smart_collaps_'.$name;
725 725
         $cookie_name = str_replace('.', '_', $cookie_name);
726 726
         $cookie      = static::getCookieVar($cookie_name, '');
727 727
         if ('none' === $cookie) {
728 728
             echo '
729 729
                 <script type="text/javascript"><!--
730
-                togglecollapse("' . $name . '"); toggleIcon("' . $name . '_icon");
730
+                togglecollapse("' . $name.'"); toggleIcon("'.$name.'_icon");
731 731
                     //-->
732 732
                 </script>
733 733
                 ';
@@ -793,17 +793,17 @@  discard block
 block discarded – undo
793 793
         $httphost    = $_SERVER['HTTP_HOST'];
794 794
         $querystring = $_SERVER['QUERY_STRING'];
795 795
         if ('' !== $querystring) {
796
-            $querystring = '?' . $querystring;
796
+            $querystring = '?'.$querystring;
797 797
         }
798
-        $currenturl           = $http . $httphost . $phpself . $querystring;
798
+        $currenturl           = $http.$httphost.$phpself.$querystring;
799 799
         $urls                 = [];
800 800
         $urls['http']         = $http;
801 801
         $urls['httphost']     = $httphost;
802 802
         $urls['phpself']      = $phpself;
803 803
         $urls['querystring']  = $querystring;
804
-        $urls['full_phpself'] = $http . $httphost . $phpself;
804
+        $urls['full_phpself'] = $http.$httphost.$phpself;
805 805
         $urls['full']         = $currenturl;
806
-        $urls['isHomePage']   = (XOOPS_URL . '/index.php') == ($http . $httphost . $phpself);
806
+        $urls['isHomePage']   = (XOOPS_URL.'/index.php') == ($http.$httphost.$phpself);
807 807
 
808 808
         return $urls;
809 809
     }
@@ -880,13 +880,13 @@  discard block
 block discarded – undo
880 880
     {
881 881
         global $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
882 882
 
883
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
883
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
884 884
         $tpl = new \XoopsTpl();
885 885
 
886 886
         $hModule      = xoops_getHandler('module');
887
-        $versioninfo  =& $hModule->get($xoopsModule->getVar('mid'));
888
-        $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . '';
889
-        $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>";
887
+        $versioninfo  = & $hModule->get($xoopsModule->getVar('mid'));
888
+        $modfootertxt = 'Module '.$versioninfo->getInfo('name').' - Version '.$versioninfo->getInfo('version').'';
889
+        $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>";
890 890
         $tpl->assign('modfooter', $modfooter);
891 891
 
892 892
         if (!defined('_AM_SOBJECT_XOOPS_PRO')) {
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
         }
895 895
         $smartobjectConfig = static::getModuleConfig('smartobject');
896 896
         $tpl->assign('smartobject_enable_admin_footer', $smartobjectConfig['enable_admin_footer']);
897
-        $tpl->display(SMARTOBJECT_ROOT_PATH . 'templates/smartobject_admin_footer.tpl');
897
+        $tpl->display(SMARTOBJECT_ROOT_PATH.'templates/smartobject_admin_footer.tpl');
898 898
     }
899 899
 
900 900
     public static function getXoopsCpFooter()
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
      */
922 922
     public static function addScript($src)
923 923
     {
924
-        echo '<script src="' . $src . '" type="text/javascript"></script>';
924
+        echo '<script src="'.$src.'" type="text/javascript"></script>';
925 925
     }
926 926
 
927 927
     /**
@@ -930,16 +930,16 @@  discard block
 block discarded – undo
930 930
     public static function addStyle($src)
931 931
     {
932 932
         if ('smartobject' === $src) {
933
-            $src = SMARTOBJECT_URL . 'assets/css/module.css';
933
+            $src = SMARTOBJECT_URL.'assets/css/module.css';
934 934
         }
935 935
         echo static::getCssLink($src);
936 936
     }
937 937
 
938 938
     public static function addAdminAjaxSupport()
939 939
     {
940
-        static::addScript(SMARTOBJECT_URL . 'include/scriptaculous/lib/prototype.js');
941
-        static::addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/scriptaculous.js');
942
-        static::addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/smart.js');
940
+        static::addScript(SMARTOBJECT_URL.'include/scriptaculous/lib/prototype.js');
941
+        static::addScript(SMARTOBJECT_URL.'include/scriptaculous/src/scriptaculous.js');
942
+        static::addScript(SMARTOBJECT_URL.'include/scriptaculous/src/smart.js');
943 943
     }
944 944
 
945 945
     /**
@@ -999,8 +999,8 @@  discard block
 block discarded – undo
999 999
     public static function getHtmlnumericentities($str)
1000 1000
     {
1001 1001
         //    return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
1002
-        return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function ($m) {
1003
-            return '&#' . ord($m[0]) . chr(59);
1002
+        return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function($m) {
1003
+            return '&#'.ord($m[0]).chr(59);
1004 1004
         }, $str);
1005 1005
     }
1006 1006
 
@@ -1014,16 +1014,16 @@  discard block
 block discarded – undo
1014 1014
         static $handlers;
1015 1015
         $name = strtolower(trim($name));
1016 1016
         if (!isset($handlers[$name])) {
1017
-            if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) {
1017
+            if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/kernel/'.$name.'.php')) {
1018 1018
                 require_once $hnd_file;
1019 1019
             }
1020
-            $class = 'Xoops' . ucfirst($name) . 'Handler';
1020
+            $class = 'Xoops'.ucfirst($name).'Handler';
1021 1021
             if (class_exists($class)) {
1022 1022
                 $handlers[$name] = new $class($GLOBALS['xoopsDB'], 'xoops');
1023 1023
             }
1024 1024
         }
1025 1025
         if (!isset($handlers[$name]) && !$optional) {
1026
-            trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
1026
+            trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
1027 1027
         }
1028 1028
         if (isset($handlers[$name])) {
1029 1029
             return $handlers[$name];
@@ -1103,9 +1103,9 @@  discard block
 block discarded – undo
1103 1103
     {
1104 1104
         global $xoopsConfig;
1105 1105
 
1106
-        $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/' . $xoopsConfig['language'] . '/' . $file . '.php';
1106
+        $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/'.$xoopsConfig['language'].'/'.$file.'.php';
1107 1107
         if (!file_exists($filename)) {
1108
-            $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/english/' . $file . '.php';
1108
+            $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/english/'.$file.'.php';
1109 1109
         }
1110 1110
         if (file_exists($filename)) {
1111 1111
             require_once $filename;
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
         $text = preg_replace($search, $replace, $document);
1203 1203
 
1204
-        preg_replace_callback('/&#(\d+);/', function ($matches) {
1204
+        preg_replace_callback('/&#(\d+);/', function($matches) {
1205 1205
             return chr($matches[1]);
1206 1206
         }, $document);
1207 1207
 
@@ -1224,21 +1224,21 @@  discard block
 block discarded – undo
1224 1224
             $str = $match[0];
1225 1225
             if (false !== strpos($str, ',')) {
1226 1226
                 // A comma exists, that makes it easy, cos we assume it separates the decimal part.
1227
-                $str = str_replace('.', '', $str);    // Erase thousand seps
1228
-                $str = str_replace(',', '.', $str);    // Convert , to . for floatval command
1227
+                $str = str_replace('.', '', $str); // Erase thousand seps
1228
+                $str = str_replace(',', '.', $str); // Convert , to . for floatval command
1229 1229
 
1230
-                return (float)$str;
1230
+                return (float) $str;
1231 1231
             } else {
1232 1232
                 // No comma exists, so we have to decide, how a single dot shall be treated
1233 1233
                 if (true === preg_match("/^[0-9\-]*[\.]{1}[0-9-]+$/", $str) && true === $set['single_dot_as_decimal']) {
1234 1234
                     // Treat single dot as decimal separator
1235
-                    return (float)$str;
1235
+                    return (float) $str;
1236 1236
                 } else {
1237 1237
                     //echo "str: ".$str; echo "ret: ".str_replace('.', '', $str); echo "<br><br> ";
1238 1238
                     // Else, treat all dots as thousand seps
1239
-                    $str = str_replace('.', '', $str);    // Erase thousand seps
1239
+                    $str = str_replace('.', '', $str); // Erase thousand seps
1240 1240
 
1241
-                    return (float)$str;
1241
+                    return (float) $str;
1242 1242
                 }
1243 1243
             }
1244 1244
         } else {
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
             $ret .= '.00';
1271 1271
         }
1272 1272
         if ($currencyObj) {
1273
-            $ret = $ret . ' ' . $currencyObj->getCode();
1273
+            $ret = $ret.' '.$currencyObj->getCode();
1274 1274
         }
1275 1275
 
1276 1276
         return $ret;
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
         }
1298 1298
         $ret = '';
1299 1299
         if ($moduleName) {
1300
-            $ret = "<a href='" . XOOPS_URL . "/modules/$moduleName/admin/index.php'>" . _CO_SOBJECT_ADMIN_PAGE . '</a>';
1300
+            $ret = "<a href='".XOOPS_URL."/modules/$moduleName/admin/index.php'>"._CO_SOBJECT_ADMIN_PAGE.'</a>';
1301 1301
         }
1302 1302
 
1303 1303
         return $ret;
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
      */
1309 1309
     public static function getEditors()
1310 1310
     {
1311
-        $filename = XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php';
1311
+        $filename = XOOPS_ROOT_PATH.'/class/xoopseditor/xoopseditor.php';
1312 1312
         if (!file_exists($filename)) {
1313 1313
             return false;
1314 1314
         }
@@ -1332,9 +1332,9 @@  discard block
 block discarded – undo
1332 1332
     {
1333 1333
         $ret = [];
1334 1334
         foreach ($items as $item) {
1335
-            $ret[] = $moduleName . '_' . $item;
1335
+            $ret[] = $moduleName.'_'.$item;
1336 1336
         }
1337
-        $ret[] = $moduleName . '_meta';
1337
+        $ret[] = $moduleName.'_meta';
1338 1338
 
1339 1339
         return $ret;
1340 1340
     }
Please login to merge, or discard this patch.
sendlink.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@  discard block
 block discarded – undo
9 9
 
10 10
 use XoopsModules\Smartobject\ObjectController;
11 11
 
12
-require_once __DIR__ . '/header.php';
12
+require_once __DIR__.'/header.php';
13 13
 //require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php';
14 14
 //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php';
15
-require_once XOOPS_ROOT_PATH . '/class/template.php';
15
+require_once XOOPS_ROOT_PATH.'/class/template.php';
16 16
 
17 17
 $xoopsTpl                = new \XoopsTpl();
18 18
 $myts                    = \MyTextSanitizer::getInstance();
19 19
 $xoopsConfig['sitename'] = $myts->displayTarea($xoopsConfig['sitename']);
20 20
 
21 21
 xoops_header(false);
22
-echo Smartobject\Utility::getCssLink(SMARTOBJECT_URL . 'assets/css/module.css');
22
+echo Smartobject\Utility::getCssLink(SMARTOBJECT_URL.'assets/css/module.css');
23 23
 echo '</head><body>';
24 24
 
25 25
 $smartobjectLinkHandler = Smartobject\Helper::getInstance()->getHandler('link', 'smartobject');
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
         $xoopsMailer = xoops_getMailer();
44 44
         $xoopsMailer->useMail();
45
-        $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template');
45
+        $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template');
46 46
 
47 47
         $xoopsMailer->setTemplate('sendlink.tpl');
48 48
         $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']);
49 49
         $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name'));
50 50
         $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name'));
51
-        $xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
51
+        $xoopsMailer->assign('SITEURL', XOOPS_URL.'/');
52 52
         $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
53 53
         $xoopsMailer->assign('MESSAGE', $_POST['body']);
54 54
         $xoopsMailer->setToEmails($linkObj->getVar('to_email'));
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename'])));
58 58
 
59 59
         if (!$xoopsMailer->send(true)) {
60
-            $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true));
60
+            $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']).'<br>'.$xoopsMailer->getErrors(true));
61 61
         } else {
62 62
             $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS);
63 63
         }
Please login to merge, or discard this patch.
class/BaseSmartObject.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
17 17
 
18
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
18
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
19 19
 
20 20
 if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) {
21 21
     define('XOBJ_DTYPE_SIMPLE_ARRAY', 101);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function closeSection($section_name)
116 116
     {
117
-        $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
117
+        $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
118 118
     }
119 119
 
120 120
     /**
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
         }
153 153
         parent::initVar($key, $data_type, $value, $required, $maxlength, $options);
154 154
         if ($this->handler && (!$form_caption || '' === $form_caption)) {
155
-            $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key);
155
+            $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key);
156 156
             if (defined($dyn_form_caption)) {
157 157
                 $form_caption = constant($dyn_form_caption);
158 158
             }
159 159
         }
160 160
         if ($this->handler && (!$form_dsc || '' === $form_dsc)) {
161
-            $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC');
161
+            $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC');
162 162
             if (defined($dyn_form_dsc)) {
163 163
                 $form_dsc = constant($dyn_form_dsc);
164 164
             }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
     public function toArray()
455 455
     {
456 456
         $ret  = [];
457
-        $vars =& $this->getVars();
457
+        $vars = & $this->getVars();
458 458
         foreach ($vars as $key => $var) {
459 459
             $value     = $this->getVar($key);
460 460
             $ret[$key] = $value;
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             }
504 504
         } else {
505 505
             if ($prefix) {
506
-                $err_str = '[' . $prefix . '] ' . $err_str;
506
+                $err_str = '['.$prefix.'] '.$err_str;
507 507
             }
508 508
             parent::setErrors($err_str);
509 509
         }
@@ -831,8 +831,8 @@  discard block
 block discarded – undo
831 831
                             $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
832 832
                             continue 2;
833 833
                         }
834
-                        if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) {
835
-                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength']));
834
+                        if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) {
835
+                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength']));
836 836
                             continue 2;
837 837
                         }
838 838
                         if (!$v['not_gpc']) {
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                         break;
862 862
                     case XOBJ_DTYPE_INT:
863 863
                     case XOBJ_DTYPE_TIME_ONLY:
864
-                        $cleanv = (int)$cleanv;
864
+                        $cleanv = (int) $cleanv;
865 865
                         break;
866 866
 
867 867
                     case XOBJ_DTYPE_CURRENCY:
@@ -892,10 +892,10 @@  discard block
 block discarded – undo
892 892
                             continue 2;
893 893
                         }
894 894
                         if ('' !== $cleanv && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
895
-                            $cleanv = 'http://' . $cleanv;
895
+                            $cleanv = 'http://'.$cleanv;
896 896
                         }
897 897
                         if (!$v['not_gpc']) {
898
-                            $cleanv =& $ts->stripSlashesGPC($cleanv);
898
+                            $cleanv = & $ts->stripSlashesGPC($cleanv);
899 899
                         }
900 900
                         break;
901 901
                     case XOBJ_DTYPE_SIMPLE_ARRAY:
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
                     case XOBJ_DTYPE_STIME:
908 908
                     case XOBJ_DTYPE_MTIME:
909 909
                     case XOBJ_DTYPE_LTIME:
910
-                        $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv);
910
+                        $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv);
911 911
                         if (!($cleanv > 0)) {
912 912
                             $cleanv = strtotime($cleanv);
913 913
                         }
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
                         break;
917 917
                 }
918 918
             }
919
-            $this->cleanVars[$k] =& $cleanv;
919
+            $this->cleanVars[$k] = & $cleanv;
920 920
             unset($cleanv);
921 921
         }
922 922
         if (count($this->_errors) > 0) {
@@ -1141,10 +1141,10 @@  discard block
 block discarded – undo
1141 1141
                 }
1142 1142
                 break;
1143 1143
             case XOBJ_DTYPE_SIMPLE_ARRAY:
1144
-                $ret =& explode('|', $ret);
1144
+                $ret = & explode('|', $ret);
1145 1145
                 break;
1146 1146
             case XOBJ_DTYPE_ARRAY:
1147
-                $ret =& unserialize($ret);
1147
+                $ret = & unserialize($ret);
1148 1148
                 break;
1149 1149
             case XOBJ_DTYPE_SOURCE:
1150 1150
                 switch (strtolower($format)) {
Please login to merge, or discard this patch.
class/PersistableObjectHandler.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -150,18 +150,18 @@  discard block
 block discarded – undo
150 150
 
151 151
         $this->_itemname      = $itemname;
152 152
         $this->_moduleName    = $modulename;
153
-        $this->table          = $db->prefix($modulename . '_' . $itemname);
153
+        $this->table          = $db->prefix($modulename.'_'.$itemname);
154 154
         $this->keyName        = $keyname;
155 155
 //        $this->className      = ucfirst($modulename) . ucfirst($itemname);
156 156
         $this->className      = $itemname;
157 157
 
158 158
         $this->identifierName = $idenfierName;
159 159
         $this->summaryName    = $summaryName;
160
-        $this->_page          = $itemname . '.php';
161
-        $this->_modulePath    = XOOPS_ROOT_PATH . '/modules/' . $this->_moduleName . '/';
162
-        $this->_moduleUrl     = XOOPS_URL . '/modules/' . $this->_moduleName . '/';
163
-        $this->_uploadPath    = XOOPS_UPLOAD_PATH . '/' . $this->_moduleName . '/';
164
-        $this->_uploadUrl     = XOOPS_UPLOAD_URL . '/' . $this->_moduleName . '/';
160
+        $this->_page          = $itemname.'.php';
161
+        $this->_modulePath    = XOOPS_ROOT_PATH.'/modules/'.$this->_moduleName.'/';
162
+        $this->_moduleUrl     = XOOPS_URL.'/modules/'.$this->_moduleName.'/';
163
+        $this->_uploadPath    = XOOPS_UPLOAD_PATH.'/'.$this->_moduleName.'/';
164
+        $this->_uploadUrl     = XOOPS_UPLOAD_URL.'/'.$this->_moduleName.'/';
165 165
     }
166 166
 
167 167
     /**
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $smartPermissionsHandler = new PermissionHandler($this);
204 204
         $grantedItems            = $smartPermissionsHandler->getGrantedItems($perm_name);
205 205
         if (count($grantedItems) > 0) {
206
-            $criteria->add(new \Criteria($this->keyName, '(' . implode(', ', $grantedItems) . ')', 'IN'));
206
+            $criteria->add(new \Criteria($this->keyName, '('.implode(', ', $grantedItems).')', 'IN'));
207 207
 
208 208
             return true;
209 209
         } else {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     {
244 244
 //        $obj0 = new $this->className($this);
245 245
 
246
-        $obj =  new $this->className;
246
+        $obj = new $this->className;
247 247
 
248 248
         $obj->setImageDir($this->getImageUrl(), $this->getImagePath());
249 249
         if (!$obj->handler) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function getImageUrl()
264 264
     {
265
-        return $this->_uploadUrl . $this->_itemname . '/';
265
+        return $this->_uploadUrl.$this->_itemname.'/';
266 266
     }
267 267
 
268 268
     /**
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
      */
271 271
     public function getImagePath()
272 272
     {
273
-        $dir = $this->_uploadPath . $this->_itemname;
273
+        $dir = $this->_uploadPath.$this->_itemname;
274 274
         if (!file_exists($dir)) {
275 275
             Smartobject\Utility::mkdirAsAdmin($dir);
276 276
         }
277 277
 
278
-        return $dir . '/';
278
+        return $dir.'/';
279 279
     }
280 280
 
281 281
     /**
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         if ($debug) {
315 315
             $obj_array = $this->getObjectsD($criteria, false, $as_object);
316 316
         } else {
317
-            $obj_array =& $this->getObjects($criteria, false, $as_object);
317
+            $obj_array = & $this->getObjects($criteria, false, $as_object);
318 318
             //patch: weird bug of indexing by id even if id_as_key = false;
319 319
             if (!isset($obj_array[0]) && is_object($obj_array[$id])) {
320 320
                 $obj_array[0] = $obj_array[$id];
@@ -368,13 +368,13 @@  discard block
 block discarded – undo
368 368
         if ($this->generalSQL) {
369 369
             $sql = $this->generalSQL;
370 370
         } elseif (!$sql) {
371
-            $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname;
371
+            $sql = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname;
372 372
         }
373 373
 
374 374
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
375
-            $sql .= ' ' . $criteria->renderWhere();
375
+            $sql .= ' '.$criteria->renderWhere();
376 376
             if ('' !== $criteria->getSort()) {
377
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
377
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
378 378
             }
379 379
             $limit = $criteria->getLimit();
380 380
             $start = $criteria->getStart();
@@ -403,12 +403,12 @@  discard block
 block discarded – undo
403 403
         $ret = [];
404 404
 
405 405
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
406
-            $sql .= ' ' . $criteria->renderWhere();
406
+            $sql .= ' '.$criteria->renderWhere();
407 407
             if ($criteria->groupby) {
408 408
                 $sql .= $criteria->getGroupby();
409 409
             }
410 410
             if ('' !== $criteria->getSort()) {
411
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
411
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
412 412
             }
413 413
         }
414 414
         if ($debug) {
@@ -481,18 +481,18 @@  discard block
 block discarded – undo
481 481
             $obj->assignVars($myrow);
482 482
             if (!$id_as_key) {
483 483
                 if ($as_object) {
484
-                    $ret[] =& $obj;
484
+                    $ret[] = & $obj;
485 485
                 } else {
486 486
                     $ret[] = $obj->toArray();
487 487
                 }
488 488
             } else {
489 489
                 if ($as_object) {
490
-                    $value =& $obj;
490
+                    $value = & $obj;
491 491
                 } else {
492 492
                     $value = $obj->toArray();
493 493
                 }
494 494
                 if ('parentid' === $id_as_key) {
495
-                    $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] =& $value;
495
+                    $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] = & $value;
496 496
                 } else {
497 497
                     $ret[$obj->getVar($this->keyName)] = $value;
498 498
                 }
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
             $criteria->setSort($this->getIdentifierName());
536 536
         }
537 537
 
538
-        $sql = 'SELECT ' . (is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName);
538
+        $sql = 'SELECT '.(is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName);
539 539
         if (!empty($this->identifierName)) {
540
-            $sql .= ', ' . $this->getIdentifierName();
540
+            $sql .= ', '.$this->getIdentifierName();
541 541
         }
542
-        $sql .= ' FROM ' . $this->table . ' AS ' . $this->_itemname;
542
+        $sql .= ' FROM '.$this->table.' AS '.$this->_itemname;
543 543
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
544
-            $sql .= ' ' . $criteria->renderWhere();
544
+            $sql .= ' '.$criteria->renderWhere();
545 545
             if ('' !== $criteria->getSort()) {
546
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
546
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
547 547
             }
548 548
             $limit = $criteria->getLimit();
549 549
             $start = $criteria->getStart();
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
581 581
             if ('' !== $criteria->groupby) {
582 582
                 $groupby = true;
583
-                $field   = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used
583
+                $field   = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used
584 584
             }
585 585
         }
586 586
         /**
@@ -591,10 +591,10 @@  discard block
 block discarded – undo
591 591
             $sql = $this->generalSQL;
592 592
             $sql = str_replace('SELECT *', 'SELECT COUNT(*)', $sql);
593 593
         } else {
594
-            $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table . ' AS ' . $this->_itemname;
594
+            $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table.' AS '.$this->_itemname;
595 595
         }
596 596
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
597
-            $sql .= ' ' . $criteria->renderWhere();
597
+            $sql .= ' '.$criteria->renderWhere();
598 598
             if ('' !== $criteria->groupby) {
599 599
                 $sql .= $criteria->getGroupby();
600 600
             }
@@ -637,13 +637,13 @@  discard block
 block discarded – undo
637 637
         if (is_array($this->keyName)) {
638 638
             $clause = [];
639 639
             for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) {
640
-                $clause[] = $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]);
640
+                $clause[] = $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]);
641 641
             }
642 642
             $whereclause = implode(' AND ', $clause);
643 643
         } else {
644
-            $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName);
644
+            $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName);
645 645
         }
646
-        $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause;
646
+        $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause;
647 647
         if (false !== $force) {
648 648
             $result = $this->db->queryF($sql);
649 649
         } else {
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
              * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
705 705
              */
706 706
             if (!is_a($obj, $this->className)) {
707
-                $obj->setError(get_class($obj) . ' Differs from ' . $this->className);
707
+                $obj->setError(get_class($obj).' Differs from '.$this->className);
708 708
 
709 709
                 return false;
710 710
             }
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
         $fieldsToStoreInDB = [];
766 766
         foreach ($obj->cleanVars as $k => $v) {
767 767
             if (XOBJ_DTYPE_INT == $obj->vars[$k]['data_type']) {
768
-                $cleanvars[$k] = (int)$v;
768
+                $cleanvars[$k] = (int) $v;
769 769
             } elseif (is_array($v)) {
770 770
                 $cleanvars[$k] = $this->db->quoteString(implode(',', $v));
771 771
             } else {
@@ -778,13 +778,13 @@  discard block
 block discarded – undo
778 778
         if ($obj->isNew()) {
779 779
             if (!is_array($this->keyName)) {
780 780
                 if ($cleanvars[$this->keyName] < 1) {
781
-                    $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq');
781
+                    $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq');
782 782
                 }
783 783
             }
784 784
 
785
-            $sql = 'INSERT INTO ' . $this->table . ' (' . implode(',', array_keys($fieldsToStoreInDB)) . ') VALUES (' . implode(',', array_values($fieldsToStoreInDB)) . ')';
785
+            $sql = 'INSERT INTO '.$this->table.' ('.implode(',', array_keys($fieldsToStoreInDB)).') VALUES ('.implode(',', array_values($fieldsToStoreInDB)).')';
786 786
         } else {
787
-            $sql = 'UPDATE ' . $this->table . ' SET';
787
+            $sql = 'UPDATE '.$this->table.' SET';
788 788
             foreach ($fieldsToStoreInDB as $key => $value) {
789 789
                 if ((!is_array($this->keyName) && $key == $this->keyName)
790 790
                     || (is_array($this->keyName)
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
                 if (isset($notfirst)) {
795 795
                     $sql .= ',';
796 796
                 }
797
-                $sql      .= ' ' . $key . ' = ' . $value;
797
+                $sql .= ' '.$key.' = '.$value;
798 798
                 $notfirst = true;
799 799
             }
800 800
             if (is_array($this->keyName)) {
@@ -803,12 +803,12 @@  discard block
 block discarded – undo
803 803
                     if ($i > 0) {
804 804
                         $whereclause .= ' AND ';
805 805
                     }
806
-                    $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]);
806
+                    $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]);
807 807
                 }
808 808
             } else {
809
-                $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName);
809
+                $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName);
810 810
             }
811
-            $sql .= ' WHERE ' . $whereclause;
811
+            $sql .= ' WHERE '.$whereclause;
812 812
         }
813 813
 
814 814
         if ($debug) {
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
      */
882 882
     public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false)
883 883
     {
884
-        $set_clause = $fieldname . ' = ';
884
+        $set_clause = $fieldname.' = ';
885 885
         if (is_numeric($fieldvalue)) {
886 886
             $set_clause .= $fieldvalue;
887 887
         } elseif (is_array($fieldvalue)) {
@@ -889,9 +889,9 @@  discard block
 block discarded – undo
889 889
         } else {
890 890
             $set_clause .= $this->db->quoteString($fieldvalue);
891 891
         }
892
-        $sql = 'UPDATE ' . $this->table . ' SET ' . $set_clause;
892
+        $sql = 'UPDATE '.$this->table.' SET '.$set_clause;
893 893
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
894
-            $sql .= ' ' . $criteria->renderWhere();
894
+            $sql .= ' '.$criteria->renderWhere();
895 895
         }
896 896
         if (false !== $force) {
897 897
             $result = $this->db->queryF($sql);
@@ -915,8 +915,8 @@  discard block
 block discarded – undo
915 915
     public function deleteAll(CriteriaElement $criteria = null)
916 916
     {
917 917
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
918
-            $sql = 'DELETE FROM ' . $this->table;
919
-            $sql .= ' ' . $criteria->renderWhere();
918
+            $sql = 'DELETE FROM '.$this->table;
919
+            $sql .= ' '.$criteria->renderWhere();
920 920
             if (!$this->db->query($sql)) {
921 921
                 return false;
922 922
             }
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
      */
950 950
     public function getModuleItemString()
951 951
     {
952
-        $ret = $this->_moduleName . '_' . $this->_itemname;
952
+        $ret = $this->_moduleName.'_'.$this->_itemname;
953 953
 
954 954
         return $ret;
955 955
     }
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     {
962 962
         if (isset($object->vars['counter'])) {
963 963
             $new_counter = $object->getVar('counter') + 1;
964
-            $sql         = 'UPDATE ' . $this->table . ' SET counter=' . $new_counter . ' WHERE ' . $this->keyName . '=' . $object->id();
964
+            $sql         = 'UPDATE '.$this->table.' SET counter='.$new_counter.' WHERE '.$this->keyName.'='.$object->id();
965 965
             $this->query($sql, null, true);
966 966
         }
967 967
     }
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
     public function getIdentifierName($withprefix = true)
1006 1006
     {
1007 1007
         if ($withprefix) {
1008
-            return $this->_itemname . '.' . $this->identifierName;
1008
+            return $this->_itemname.'.'.$this->identifierName;
1009 1009
         } else {
1010 1010
             return $this->identifierName;
1011 1011
         }
Please login to merge, or discard this patch.
class/Category.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         global $myts;
98 98
         $objectArray = parent::toArray();
99 99
         if ($objectArray['image']) {
100
-            $objectArray['image'] = $this->getImageDir() . $objectArray['image'];
100
+            $objectArray['image'] = $this->getImageDir().$objectArray['image'];
101 101
         }
102 102
 
103 103
         return $objectArray;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     exit;
131 131
                 }
132 132
                 $parentid = $parentObj->getVar('parentid');
133
-                $ret      = $parentObj->getCategoryPath($withAllLink, $currentCategory) . ' > ' . $ret;
133
+                $ret      = $parentObj->getCategoryPath($withAllLink, $currentCategory).' > '.$ret;
134 134
             }
135 135
             $this->_categoryPath = $ret;
136 136
         }
Please login to merge, or discard this patch.