Completed
Push — master ( bf34f3...88111b )
by Michael
03:08
created
class/SmartObjectController.php 1 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 ?: smart_get_page_before_form();
@@ -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 = smart_getModuleInfo($smartObj->handler->_moduleName);
513 513
         $link        = smart_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/SmartExportRenderer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
             }
237 237
         } while (false);
238 238
         if ($needQuote) {
239
-            $val = '"' . $val . '"';
239
+            $val = '"'.$val.'"';
240 240
         }
241 241
 
242 242
         return $val;
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
             case 'csv':
251 251
                 $separator      = isset($this->options['separator']) ? $this->options['separator'] : ';';
252 252
                 $firstRow       = implode($separator, $this->data['columnsHeaders']);
253
-                $exportFileData .= $firstRow . "\r\n";
253
+                $exportFileData .= $firstRow."\r\n";
254 254
 
255 255
                 foreach ($this->data['rows'] as $cols) {
256
-                    $exportFileData .= $this->arrayToCsvString($cols, $separator) . "\r\n";
256
+                    $exportFileData .= $this->arrayToCsvString($cols, $separator)."\r\n";
257 257
                 }
258 258
                 break;
259 259
         }
@@ -278,19 +278,19 @@  discard block
 block discarded – undo
278 278
     public function saveCsv($content)
279 279
     {
280 280
         if (!$this->filepath) {
281
-            $this->filepath = XOOPS_UPLOAD_PATH . '/';
281
+            $this->filepath = XOOPS_UPLOAD_PATH.'/';
282 282
         }
283 283
         if (!$this->filename) {
284 284
             $this->filename .= time();
285 285
             $this->filename .= '.csv';
286 286
         }
287 287
 
288
-        $fullFileName = $this->filepath . $this->filename;
288
+        $fullFileName = $this->filepath.$this->filename;
289 289
 
290 290
         if (!$handle = fopen($fullFileName, 'a+')) {
291
-            trigger_error('Unable to open ' . $fullFileName, E_USER_WARNING);
291
+            trigger_error('Unable to open '.$fullFileName, E_USER_WARNING);
292 292
         } elseif (false === fwrite($handle, $content)) {
293
-            trigger_error('Unable to write in ' . $fullFileName, E_USER_WARNING);
293
+            trigger_error('Unable to write in '.$fullFileName, E_USER_WARNING);
294 294
         } else {
295 295
             $mimeType  = 'text/csv';
296 296
             $file      = strrev($this->filename);
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             } else {
301 301
                 $file_name = $temp_name;
302 302
             }
303
-            $fullFileName = $this->filepath . stripslashes(trim($this->filename));
303
+            $fullFileName = $this->filepath.stripslashes(trim($this->filename));
304 304
 
305 305
             if (ini_get('zlib.output_compression')) {
306 306
                 ini_set('zlib.output_compression', 'Off');
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
             header('Cache-Control: private', false);
312 312
             header('Content-Transfer-Encoding: binary');
313 313
             if (isset($mimeType)) {
314
-                header('Content-Type: ' . $mimeType);
314
+                header('Content-Type: '.$mimeType);
315 315
             }
316 316
 
317
-            header('Content-Disposition: attachment; filename=' . $file_name);
317
+            header('Content-Disposition: attachment; filename='.$file_name);
318 318
 
319 319
             if (isset($mimeType) && false !== strpos($mimeType, 'text/')) {
320 320
                 $fp = fopen($fullFileName, 'r');
Please login to merge, or discard this patch.
class/SmartHighlighter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
         if ($this->singlewords) {
79 79
             $keywords = explode(' ', $this->preg_keywords);
80 80
             foreach ($keywords as $keyword) {
81
-                $patterns[] = '/(?' . '>' . $keyword . '+)/si';
81
+                $patterns[] = '/(?'.'>'.$keyword.'+)/si';
82 82
             }
83 83
         } else {
84
-            $patterns[] = '/(?' . '>' . $this->preg_keywords . '+)/si';
84
+            $patterns[] = '/(?'.'>'.$this->preg_keywords.'+)/si';
85 85
         }
86 86
 
87 87
         $result = $replace_matches[0];
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function highlight($buffer)
106 106
     {
107
-        $buffer              = '>' . $buffer . '<';
107
+        $buffer              = '>'.$buffer.'<';
108 108
         $this->preg_keywords = preg_replace('/[^\w ]/si', '', $this->keywords);
109
-        $buffer              = preg_replace_callback("/(\>(((?" . ">[^><]+)|(?R))*)\<)/is", [&$this, 'replace'], $buffer);
109
+        $buffer              = preg_replace_callback("/(\>(((?".">[^><]+)|(?R))*)\<)/is", [&$this, 'replace'], $buffer);
110 110
         $buffer              = substr($buffer, 1, -1);
111 111
 
112 112
         return $buffer;
Please login to merge, or discard this patch.
class/Form/SmartObjectForm.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 use XoopsModules\Smartobject\Form\Elements\SmartFormSectionClose;
26 26
 use XoopsModules\Smartobject\Form\Elements\SmartFormUrlLinkElement;
27 27
 
28
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
28
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
29 29
 //require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsection.php';
30 30
 //require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsectionclose.php';
31 31
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $cancel_js_action = false,
71 71
         $captcha = false
72 72
     ) {
73
-        $this->targetObject           =& $target;
73
+        $this->targetObject           = & $target;
74 74
         $this->form_fields            = $form_fields;
75 75
         $this->_cancel_js_action      = $cancel_js_action;
76 76
         $this->_captcha               = $captcha;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     public function addCaptcha()
100 100
     {
101
-        require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/formcaptcha.php';
101
+        require_once SMARTOBJECT_ROOT_PATH.'include/captcha/formcaptcha.php';
102 102
         $this->addElement(new \XoopsFormCaptcha(), true);
103 103
     }
104 104
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function addCustomButton($name, $caption, $onclick = false)
111 111
     {
112
-        $custom_button_array    = [
112
+        $custom_button_array = [
113 113
             'name'    => $name,
114 114
             'caption' => $caption,
115 115
             'onclick' => $onclick
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         if ($key) {
131 131
             if ($this->targetObject->vars[$key]['readonly']) {
132 132
                 $formElement->setExtra('disabled="disabled"');
133
-                $formElement->setName($key . '-readonly');
133
+                $formElement->setName($key.'-readonly');
134 134
                 // Since this element is disable, we still want to pass it's value in the form
135 135
                 $hidden = new \XoopsFormHidden($key, $this->targetObject->vars[$key]['value']);
136 136
                 $this->addElement($hidden);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 $this->addElement($hidden);
142 142
                 $otherExtra      = isset($var['form_extra']) ? $var['form_extra'] : '';
143 143
                 $onchangedString = "this.form.elements.changedField.value='$key'; this.form.elements.op.value='changedField'; submit()";
144
-                $formElement->setExtra('onchange="' . $onchangedString . '"' . ' ' . $otherExtra);
144
+                $formElement->setExtra('onchange="'.$onchangedString.'"'.' '.$otherExtra);
145 145
             } else {
146 146
                 if (isset($var['form_extra'])) {
147 147
                     $formElement->setExtra($var['form_extra']);
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
             asort($group_list);
309 309
             foreach ($permissions as $permission) {
310 310
                 if ($this->targetObject->isNew()) {
311
-                    if (isset($smartModuleConfig['def_perm_' . $permission['perm_name']])) {
312
-                        $groups_value = $smartModuleConfig['def_perm_' . $permission['perm_name']];
311
+                    if (isset($smartModuleConfig['def_perm_'.$permission['perm_name']])) {
312
+                        $groups_value = $smartModuleConfig['def_perm_'.$permission['perm_name']];
313 313
                     }
314 314
                 } else {
315 315
                     $groups_value = $this->targetObject->getGroupPerm($permission['perm_name']);
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         } else {
342 342
             $butt_create = new \XoopsFormButton('', 'modify_button', $submit_button_caption, 'submit');
343 343
         }
344
-        $butt_create->setExtra('onclick="this.form.elements.op.value=\'' . $form_name . '\'"');
344
+        $butt_create->setExtra('onclick="this.form.elements.op.value=\''.$form_name.'\'"');
345 345
         $button_tray->addElement($butt_create);
346 346
 
347 347
         //creating custom buttons
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             foreach ($this->_custom_button as $custom_button) {
350 350
                 $butt_custom = new \XoopsFormButton('', $custom_button['name'], $custom_button['caption'], 'submit');
351 351
                 if ($custom_button['onclick']) {
352
-                    $butt_custom->setExtra('onclick="' . $custom_button['onclick'] . '"');
352
+                    $butt_custom->setExtra('onclick="'.$custom_button['onclick'].'"');
353 353
                 }
354 354
                 $button_tray->addElement($butt_custom);
355 355
                 unset($butt_custom);
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         // creating the "cancel" button
360 360
         $butt_cancel = new \XoopsFormButton('', 'cancel_button', _CO_SOBJECT_CANCEL, 'button');
361 361
         if ($this->_cancel_js_action) {
362
-            $butt_cancel->setExtra('onclick="' . $this->_cancel_js_action . '"');
362
+            $butt_cancel->setExtra('onclick="'.$this->_cancel_js_action.'"');
363 363
         } else {
364 364
             $butt_cancel->setExtra('onclick="history.go(-1)"');
365 365
         }
@@ -461,21 +461,21 @@  discard block
 block discarded – undo
461 461
                 break;
462 462
 
463 463
             default:
464
-                $classname = 'SmartForm' . ucfirst($controlName) . 'Element';
464
+                $classname = 'SmartForm'.ucfirst($controlName).'Element';
465 465
                 if (!class_exists($classname)) {
466
-                    if (file_exists(SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php')) {
466
+                    if (file_exists(SMARTOBJECT_ROOT_PATH.'class/form/elements/'.strtolower($classname).'.php')) {
467 467
 //                        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php';
468 468
                     } else {
469 469
                         // perhaps this is a control created by the module
470 470
                         $moduleName             = $this->targetObject->handler->_moduleName;
471
-                        $moduleFormElementsPath = $this->targetObject->handler->_modulePath . 'class/form/elements/';
472
-                        $classname              = ucfirst($moduleName) . ucfirst($controlName) . 'Element';
473
-                        $classFileName          = strtolower($classname) . '.php';
471
+                        $moduleFormElementsPath = $this->targetObject->handler->_modulePath.'class/form/elements/';
472
+                        $classname              = ucfirst($moduleName).ucfirst($controlName).'Element';
473
+                        $classFileName          = strtolower($classname).'.php';
474 474
 
475
-                        if (file_exists($moduleFormElementsPath . $classFileName)) {
475
+                        if (file_exists($moduleFormElementsPath.$classFileName)) {
476 476
 //                            require_once $moduleFormElementsPath . $classFileName;
477 477
                         } else {
478
-                            trigger_error($classname . ' Not found', E_USER_WARNING);
478
+                            trigger_error($classname.' Not found', E_USER_WARNING);
479 479
 
480 480
                             return new \XoopsFormLabel(); //Empty object
481 481
                         }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
         $editor_configs['height'] = '400px';
545 545
 
546 546
         $dhtml            = true;
547
-        $xoopseditorclass = XOOPS_ROOT_PATH . '/class/xoopsform/formeditor.php';
547
+        $xoopseditorclass = XOOPS_ROOT_PATH.'/class/xoopsform/formeditor.php';
548 548
 
549 549
         if (file_exists($xoopseditorclass)) {
550 550
             require_once $xoopseditorclass;
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
 
555 555
                 case 'tiny':
556 556
                     if (!$xoops22) {
557
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php')) {
558
-                            require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php';
557
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php')) {
558
+                            require_once XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php';
559 559
                             $editor = new \XoopsFormTinymce([
560 560
                                                                     'caption' => $caption,
561 561
                                                                     'name'    => $name,
@@ -662,10 +662,10 @@  discard block
 block discarded – undo
662 662
         $size         = $multiple ? 5 : 1;
663 663
         $theme_select = new \XoopsFormSelect($var['form_caption'], $key, $this->targetObject->getVar($key), $size, $multiple);
664 664
 
665
-        $handle  = opendir(XOOPS_THEME_PATH . '/');
665
+        $handle  = opendir(XOOPS_THEME_PATH.'/');
666 666
         $dirlist = [];
667 667
         while (false !== ($file = readdir($handle))) {
668
-            if (is_dir(XOOPS_THEME_PATH . '/' . $file) && !preg_match('/^[.]{1,2}$/', $file)
668
+            if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match('/^[.]{1,2}$/', $file)
669 669
                 && 'cvs' !== strtolower($file)) {
670 670
                 $dirlist[$file] = $file;
671 671
             }
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
     {
688 688
         foreach ($this->_elements as $eleObj) {
689 689
             if ($eleObj->getName() == $keyname) {
690
-                $ret =& $eleObj;
690
+                $ret = & $eleObj;
691 691
                 break;
692 692
             }
693 693
         }
@@ -704,9 +704,9 @@  discard block
 block discarded – undo
704 704
     {
705 705
         $required = $this->getRequired();
706 706
         $ret      = "
707
-            <form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "' onsubmit='return xoopsFormValidate_" . $this->getName() . "(this);'" . $this->getExtra() . ">
707
+            <form name='" . $this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' onsubmit='return xoopsFormValidate_".$this->getName()."(this);'".$this->getExtra().">
708 708
             <table width='100%' class='outer' cellspacing='1'>
709
-            <tr><th colspan='2'>" . $this->getTitle() . '</th></tr>
709
+            <tr><th colspan='2'>" . $this->getTitle().'</th></tr>
710 710
         ';
711 711
         $hidden   = '';
712 712
         $class    = 'even';
@@ -715,11 +715,11 @@  discard block
 block discarded – undo
715 715
                 $ret .= $ele;
716 716
             } elseif (!$ele->isHidden()) {
717 717
                 //$class = ( $class == 'even' ) ? 'odd': 'even';
718
-                $ret .= "<tr id='" . $ele->getName() . "' valign='top' align='left'><td class='head'>" . $ele->getCaption();
718
+                $ret .= "<tr id='".$ele->getName()."' valign='top' align='left'><td class='head'>".$ele->getCaption();
719 719
                 if ('' !== $ele->getDescription()) {
720
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $ele->getDescription() . '</span>';
720
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
721 721
                 }
722
-                $ret .= "</td><td class='$class'>" . $ele->render() . "</td></tr>\n";
722
+                $ret .= "</td><td class='$class'>".$ele->render()."</td></tr>\n";
723 723
             } else {
724 724
                 $hidden .= $ele->render();
725 725
             }
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
             'name'       => $this->getName(),
768 768
             'action'     => $this->getAction(),
769 769
             'method'     => $this->getMethod(),
770
-            'extra'      => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '(this);"' . $this->getExtra(),
770
+            'extra'      => 'onsubmit="return xoopsFormValidate_'.$this->getName().'(this);"'.$this->getExtra(),
771 771
             'javascript' => $js,
772 772
             'elements'   => $elements
773 773
         ]);
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
         }
786 786
         $myts     = \MyTextSanitizer::getInstance();
787 787
         $formname = $this->getName();
788
-        $js       .= "function xoopsFormValidate_{$formname}(myform) {";
788
+        $js .= "function xoopsFormValidate_{$formname}(myform) {";
789 789
         // First, output code to check required elements
790 790
         $elements = $this->getRequired();
791 791
         foreach ($elements as $elt) {
@@ -836,15 +836,15 @@  discard block
 block discarded – undo
836 836
                         window.alert(\"{$eltmsg}\"); myform['{$eltname}'][0].focus(); return false; }\n";
837 837
                 }
838 838
             } else {
839
-                $js .= "if ( myform.{$eltname}.value == \"\" ) " . "{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
839
+                $js .= "if ( myform.{$eltname}.value == \"\" ) "."{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
840 840
             }
841 841
         }
842 842
         // Now, handle custom validation code
843
-        $elements =& $this->getElements(true);
843
+        $elements = & $this->getElements(true);
844 844
         foreach ($elements as $elt) {
845 845
             if (method_exists($elt, 'renderValidationJS') && 'xoopsformcheckbox' !== strtolower(get_class($elt))) {
846 846
                 if ($eltjs = $elt->renderValidationJS()) {
847
-                    $js .= $eltjs . "\n";
847
+                    $js .= $eltjs."\n";
848 848
                 }
849 849
             }
850 850
         }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormUploadElement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
      */
29 29
     public function render()
30 30
     {
31
-        return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
32
-                <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . ">
33
-                <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'>";
31
+        return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'>
32
+                <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra().">
33
+                <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."'>";
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormCheckElement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,15 +18,15 @@  discard block
 block discarded – undo
18 18
     {
19 19
         $ret = '';
20 20
         if (count($this->getOptions()) > 1 && '[]' !== substr($this->getName(), -2, 2)) {
21
-            $newname = $this->getName() . '[]';
21
+            $newname = $this->getName().'[]';
22 22
             $this->setName($newname);
23 23
         }
24 24
         foreach ($this->getOptions() as $value => $name) {
25
-            $ret .= "<input type='checkbox' name='" . $this->getName() . "' value='" . $value . "'";
25
+            $ret .= "<input type='checkbox' name='".$this->getName()."' value='".$value."'";
26 26
             if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) {
27 27
                 $ret .= ' checked';
28 28
             }
29
-            $ret .= $this->getExtra() . '>' . $name . '<br>';
29
+            $ret .= $this->getExtra().'>'.$name.'<br>';
30 30
         }
31 31
 
32 32
         return $ret;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             if (hasSelections === false) {
51 51
                 window.alert(\"{$eltmsg}\"); myform['{$eltname}[]'][0].focus(); return false; }\n";
52 52
         } else {
53
-            $js .= "for (var i = 0; i < myform['" . $eltname . "'].length; i++) {
53
+            $js .= "for (var i = 0; i < myform['".$eltname."'].length; i++) {
54 54
                 if (myform['{$eltname}'][i].checked) {
55 55
                     hasSelections = true;
56 56
                 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartAutocompleteElement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@
 block discarded – undo
35 35
      */
36 36
     public function render()
37 37
     {
38
-        $ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . '>';
38
+        $ret = "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra().'>';
39 39
 
40
-        $ret .= '   <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div>
40
+        $ret .= '   <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint'.$this->getName().'"></div>
41 41
 
42 42
     <script type="text/javascript">
43
-        new Ajax.Autocompleter("' . $this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '");
43
+        new Ajax.Autocompleter("' . $this->getName().'","smartobject_autocomplete_hint'.$this->getName().'","'.$this->_include_file.'?key='.$this->getName().'");
44 44
     </script>';
45 45
 
46 46
         return $ret;
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormTimeElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         for ($i = 0; $i < 24; ++$i) {
24 24
             for ($j = 0; $j < 60; $j += 10) {
25 25
                 $key_t             = ($i * 3600) + ($j * 60);
26
-                $timearray[$key_t] = (0 != $j) ? $i . ':' . $j : $i . ':0' . $j;
26
+                $timearray[$key_t] = (0 != $j) ? $i.':'.$j : $i.':0'.$j;
27 27
             }
28 28
         }
29 29
         ksort($timearray);
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormParentCategoryElement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $categoryHandler = xoops_getModuleHandler('category', $object->handler->_moduleName);
32 32
         $categories      = $categoryHandler->getObjects($criteria);
33 33
 
34
-        require_once XOOPS_ROOT_PATH . '/class/tree.php';
34
+        require_once XOOPS_ROOT_PATH.'/class/tree.php';
35 35
         $mytree = new \XoopsObjectTree($categories, 'categoryid', 'parentid');
36 36
         parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
37 37
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     {
63 63
         if ($key > 0) {
64 64
             $value       = $tree->tree[$key]['obj']->getVar($tree->_myId);
65
-            $ret[$key]   = $prefix_curr . $tree->tree[$key]['obj']->getVar($fieldName);
65
+            $ret[$key]   = $prefix_curr.$tree->tree[$key]['obj']->getVar($fieldName);
66 66
             $prefix_curr .= '-';
67 67
         }
68 68
         if (isset($tree->tree[$key]['child']) && !empty($tree->tree[$key]['child'])) {
Please login to merge, or discard this patch.