Completed
Push — master ( 2a36d1...bf34f3 )
by Michael
03:21
created
class/form/elements/smartformimageelement.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,23 +27,23 @@
 block discarded – undo
27 27
         if ('' !== $object->getVar($key)
28 28
             && (0 === strpos($object->getVar($key), 'http')
29 29
                 || 0 === strpos($object->getVar($key), '{XOOPS_URL}'))) {
30
-            $this->addElement(new XoopsFormLabel('', "<img src='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key)) . "' alt=''><br><br>"));
30
+            $this->addElement(new XoopsFormLabel('', "<img src='".str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key))."' alt=''><br><br>"));
31 31
         } elseif ('' !== $object->getVar($key)) {
32
-            $this->addElement(new XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt=''><br><br>"));
32
+            $this->addElement(new XoopsFormLabel('', "<img src='".$object_imageurl.$object->getVar($key)."' alt=''><br><br>"));
33 33
         }
34 34
 
35
-        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php';
35
+        require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformfileuploadelement.php';
36 36
         $this->addElement(new SmartFormFileUploadElement($object, $key));
37 37
 
38
-        $this->addElement(new XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">' . _CO_SOBJECT_URL_FILE_DSC . '</div>', ''));
39
-        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformtextelement.php';
40
-        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php';
38
+        $this->addElement(new XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">'._CO_SOBJECT_URL_FILE_DSC.'</div>', ''));
39
+        require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformtextelement.php';
40
+        require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformcheckelement.php';
41 41
 
42
-        $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE));
43
-        $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
42
+        $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE));
43
+        $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
44 44
         $this->addElement(new XoopsFormLabel('', '<br><br>'));
45
-        $delete_check = new SmartFormCheckElement('', 'delete_' . $key);
46
-        $delete_check->addOption(1, '<span style="color:red;">' . _CO_SOBJECT_DELETE . '</span>');
45
+        $delete_check = new SmartFormCheckElement('', 'delete_'.$key);
46
+        $delete_check->addOption(1, '<span style="color:red;">'._CO_SOBJECT_DELETE.'</span>');
47 47
         $this->addElement($delete_check);
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
class/form/elements/smartformrichfileelement.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,28 +22,28 @@
 block discarded – undo
22 22
         parent::__construct($form_caption, '&nbsp;');
23 23
         if ('' !== $object->getVar('url')) {
24 24
             $caption = '' !== $object->getVar('caption') ? $object->getVar('caption') : $object->getVar('url');
25
-            $this->addElement(new XoopsFormLabel('', _CO_SOBJECT_CURRENT_FILE . "<a href='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar('url')) . "' target='_blank' >" . $caption . '</a><br><br>'));
25
+            $this->addElement(new XoopsFormLabel('', _CO_SOBJECT_CURRENT_FILE."<a href='".str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar('url'))."' target='_blank' >".$caption.'</a><br><br>'));
26 26
             //$this->addElement( new XoopsFormLabel( '', "<br><a href = '".SMARTOBJECT_URL."admin/file.php?op=del&fileid=".$object->id()."'>"._CO_SOBJECT_DELETE_FILE."</a>"));
27 27
         }
28 28
 
29
-        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php';
29
+        require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformfileuploadelement.php';
30 30
         if ($object->isNew()) {
31 31
             $this->addElement(new SmartFormFileUploadElement($object, $key));
32
-            $this->addElement(new XoopsFormLabel('', '<br><br><small>' . _CO_SOBJECT_URL_FILE_DSC . '</small>'));
33
-            $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE));
34
-            $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
32
+            $this->addElement(new XoopsFormLabel('', '<br><br><small>'._CO_SOBJECT_URL_FILE_DSC.'</small>'));
33
+            $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE));
34
+            $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
35 35
         }
36
-        $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_CAPTION));
37
-        $this->addElement(new SmartFormTextElement($object, 'caption_' . $key));
38
-        $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_DESC . '<br>'));
39
-        $this->addElement(new XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description')));
36
+        $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_CAPTION));
37
+        $this->addElement(new SmartFormTextElement($object, 'caption_'.$key));
38
+        $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_DESC.'<br>'));
39
+        $this->addElement(new XoopsFormTextArea('', 'desc_'.$key, $object->getVar('description')));
40 40
 
41 41
         if (!$object->isNew()) {
42
-            $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_CHANGE_FILE));
42
+            $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_CHANGE_FILE));
43 43
             $this->addElement(new SmartFormFileUploadElement($object, $key));
44
-            $this->addElement(new XoopsFormLabel('', '<br><br><small>' . _CO_SOBJECT_URL_FILE_DSC . '</small>'));
45
-            $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE));
46
-            $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
44
+            $this->addElement(new XoopsFormLabel('', '<br><br><small>'._CO_SOBJECT_URL_FILE_DSC.'</small>'));
45
+            $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE));
46
+            $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
47 47
         }
48 48
     }
49 49
 }
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/smartobjectform.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 /**
16 16
  * Including the XoopsFormLoader classes
17 17
  */
18
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
19
-require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsection.php';
20
-require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsectionclose.php';
18
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
19
+require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformsection.php';
20
+require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformsectionclose.php';
21 21
 
22 22
 /**
23 23
  * SmartForm base class
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $cancel_js_action = false,
61 61
         $captcha = false
62 62
     ) {
63
-        $this->targetObject           =& $target;
63
+        $this->targetObject           = & $target;
64 64
         $this->form_fields            = $form_fields;
65 65
         $this->_cancel_js_action      = $cancel_js_action;
66 66
         $this->_captcha               = $captcha;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function addCaptcha()
90 90
     {
91
-        require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/formcaptcha.php';
91
+        require_once SMARTOBJECT_ROOT_PATH.'include/captcha/formcaptcha.php';
92 92
         $this->addElement(new XoopsFormCaptcha(), true);
93 93
     }
94 94
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function addCustomButton($name, $caption, $onclick = false)
101 101
     {
102
-        $custom_button_array    = [
102
+        $custom_button_array = [
103 103
             'name'    => $name,
104 104
             'caption' => $caption,
105 105
             'onclick' => $onclick
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         if ($key) {
121 121
             if ($this->targetObject->vars[$key]['readonly']) {
122 122
                 $formElement->setExtra('disabled="disabled"');
123
-                $formElement->setName($key . '-readonly');
123
+                $formElement->setName($key.'-readonly');
124 124
                 // Since this element is disable, we still want to pass it's value in the form
125 125
                 $hidden = new XoopsFormHidden($key, $this->targetObject->vars[$key]['value']);
126 126
                 $this->addElement($hidden);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                 $this->addElement($hidden);
132 132
                 $otherExtra      = isset($var['form_extra']) ? $var['form_extra'] : '';
133 133
                 $onchangedString = "this.form.elements.changedField.value='$key'; this.form.elements.op.value='changedField'; submit()";
134
-                $formElement->setExtra('onchange="' . $onchangedString . '"' . ' ' . $otherExtra);
134
+                $formElement->setExtra('onchange="'.$onchangedString.'"'.' '.$otherExtra);
135 135
             } else {
136 136
                 if (isset($var['form_extra'])) {
137 137
                     $formElement->setExtra($var['form_extra']);
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
             asort($group_list);
299 299
             foreach ($permissions as $permission) {
300 300
                 if ($this->targetObject->isNew()) {
301
-                    if (isset($smartModuleConfig['def_perm_' . $permission['perm_name']])) {
302
-                        $groups_value = $smartModuleConfig['def_perm_' . $permission['perm_name']];
301
+                    if (isset($smartModuleConfig['def_perm_'.$permission['perm_name']])) {
302
+                        $groups_value = $smartModuleConfig['def_perm_'.$permission['perm_name']];
303 303
                     }
304 304
                 } else {
305 305
                     $groups_value = $this->targetObject->getGroupPerm($permission['perm_name']);
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         } else {
332 332
             $butt_create = new XoopsFormButton('', 'modify_button', $submit_button_caption, 'submit');
333 333
         }
334
-        $butt_create->setExtra('onclick="this.form.elements.op.value=\'' . $form_name . '\'"');
334
+        $butt_create->setExtra('onclick="this.form.elements.op.value=\''.$form_name.'\'"');
335 335
         $button_tray->addElement($butt_create);
336 336
 
337 337
         //creating custom buttons
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             foreach ($this->_custom_button as $custom_button) {
340 340
                 $butt_custom = new XoopsFormButton('', $custom_button['name'], $custom_button['caption'], 'submit');
341 341
                 if ($custom_button['onclick']) {
342
-                    $butt_custom->setExtra('onclick="' . $custom_button['onclick'] . '"');
342
+                    $butt_custom->setExtra('onclick="'.$custom_button['onclick'].'"');
343 343
                 }
344 344
                 $button_tray->addElement($butt_custom);
345 345
                 unset($butt_custom);
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         // creating the "cancel" button
350 350
         $butt_cancel = new XoopsFormButton('', 'cancel_button', _CO_SOBJECT_CANCEL, 'button');
351 351
         if ($this->_cancel_js_action) {
352
-            $butt_cancel->setExtra('onclick="' . $this->_cancel_js_action . '"');
352
+            $butt_cancel->setExtra('onclick="'.$this->_cancel_js_action.'"');
353 353
         } else {
354 354
             $butt_cancel->setExtra('onclick="history.go(-1)"');
355 355
         }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     {
368 368
         switch ($controlName) {
369 369
             case 'check':
370
-                require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php';
370
+                require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformcheckelement.php';
371 371
                 $control    = $this->targetObject->getControl($key);
372 372
                 $controlObj = new SmartFormCheckElement($this->targetObject->vars[$key]['form_caption'], $key, $this->targetObject->getVar($key));
373 373
                 $controlObj->addOptionArray($control['options']);
@@ -434,38 +434,38 @@  discard block
 block discarded – undo
434 434
                 break;
435 435
 
436 436
             case 'urllink':
437
-                require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformurllinkelement.php';
437
+                require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformurllinkelement.php';
438 438
 
439 439
                 return new SmartFormUrlLinkElement($this->targetObject->vars[$key]['form_caption'], $key, $this->targetObject->getUrlLinkObj($key));
440 440
                 break;
441 441
 
442 442
             case 'richfile':
443
-                require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformrichfileelement.php';
443
+                require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformrichfileelement.php';
444 444
 
445 445
                 return new SmartFormRichFileElement($this->targetObject->vars[$key]['form_caption'], $key, $this->targetObject->getFileObj($key));
446 446
                 break;
447 447
             case 'section':
448
-                require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsection.php';
448
+                require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformsection.php';
449 449
 
450 450
                 return new SmartFormSection($key, $this->targetObject->vars[$key]['form_caption']);
451 451
                 break;
452 452
 
453 453
             default:
454
-                $classname = 'SmartForm' . ucfirst($controlName) . 'Element';
454
+                $classname = 'SmartForm'.ucfirst($controlName).'Element';
455 455
                 if (!class_exists($classname)) {
456
-                    if (file_exists(SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php')) {
457
-                        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php';
456
+                    if (file_exists(SMARTOBJECT_ROOT_PATH.'class/form/elements/'.strtolower($classname).'.php')) {
457
+                        require_once SMARTOBJECT_ROOT_PATH.'class/form/elements/'.strtolower($classname).'.php';
458 458
                     } else {
459 459
                         // perhaps this is a control created by the module
460 460
                         $moduleName             = $this->targetObject->handler->_moduleName;
461
-                        $moduleFormElementsPath = $this->targetObject->handler->_modulePath . 'class/form/elements/';
462
-                        $classname              = ucfirst($moduleName) . ucfirst($controlName) . 'Element';
463
-                        $classFileName          = strtolower($classname) . '.php';
461
+                        $moduleFormElementsPath = $this->targetObject->handler->_modulePath.'class/form/elements/';
462
+                        $classname              = ucfirst($moduleName).ucfirst($controlName).'Element';
463
+                        $classFileName          = strtolower($classname).'.php';
464 464
 
465
-                        if (file_exists($moduleFormElementsPath . $classFileName)) {
466
-                            require_once $moduleFormElementsPath . $classFileName;
465
+                        if (file_exists($moduleFormElementsPath.$classFileName)) {
466
+                            require_once $moduleFormElementsPath.$classFileName;
467 467
                         } else {
468
-                            trigger_error($classname . ' Not found', E_USER_WARNING);
468
+                            trigger_error($classname.' Not found', E_USER_WARNING);
469 469
 
470 470
                             return new XoopsFormLabel(); //Empty object
471 471
                         }
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
         $editor_configs['height'] = '400px';
535 535
 
536 536
         $dhtml            = true;
537
-        $xoopseditorclass = XOOPS_ROOT_PATH . '/class/xoopsform/formeditor.php';
537
+        $xoopseditorclass = XOOPS_ROOT_PATH.'/class/xoopsform/formeditor.php';
538 538
 
539 539
         if (file_exists($xoopseditorclass)) {
540 540
             require_once $xoopseditorclass;
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 
545 545
                 case 'tiny':
546 546
                     if (!$xoops22) {
547
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php')) {
548
-                            require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php';
547
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php')) {
548
+                            require_once XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php';
549 549
                             $editor = new XoopsFormTinyTextArea([
550 550
                                                                     'caption' => $caption,
551 551
                                                                     'name'    => $name,
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
 
576 576
                 case 'fckeditor':
577 577
                     if (!$xoops22) {
578
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php')) {
579
-                            require_once XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php';
578
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/fckeditor/formfckeditor.php')) {
579
+                            require_once XOOPS_ROOT_PATH.'/class/xoopseditor/fckeditor/formfckeditor.php';
580 580
                             $editor = new XoopsFormFckeditor([
581 581
                                                                  'caption' => $caption,
582 582
                                                                  'name'    => $name,
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
 
599 599
                 case 'inbetween':
600 600
                     if (!$xoops22) {
601
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/inbetween/forminbetweentextarea.php')) {
602
-                            require_once XOOPS_ROOT_PATH . '/class/xoopseditor/inbetween/forminbetweentextarea.php';
601
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/inbetween/forminbetweentextarea.php')) {
602
+                            require_once XOOPS_ROOT_PATH.'/class/xoopseditor/inbetween/forminbetweentextarea.php';
603 603
                             $editor = new XoopsFormInbetweenTextArea([
604 604
                                                                          'caption' => $caption,
605 605
                                                                          'name'    => $name,
@@ -621,8 +621,8 @@  discard block
 block discarded – undo
621 621
 
622 622
                 case 'koivi':
623 623
                     if (!$xoops22) {
624
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php')) {
625
-                            require_once XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php';
624
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php')) {
625
+                            require_once XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php';
626 626
                             $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, '100%', '400px');
627 627
                         } else {
628 628
                             if ($dhtml) {
@@ -638,8 +638,8 @@  discard block
 block discarded – undo
638 638
 
639 639
                 case 'spaw':
640 640
                     if (!$xoops22) {
641
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/spaw/formspaw.php')) {
642
-                            require_once XOOPS_ROOT_PATH . '/class/spaw/formspaw.php';
641
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/spaw/formspaw.php')) {
642
+                            require_once XOOPS_ROOT_PATH.'/class/spaw/formspaw.php';
643 643
                             $editor = new XoopsFormSpaw($caption, $name, $value);
644 644
                         }
645 645
                     } else {
@@ -649,8 +649,8 @@  discard block
 block discarded – undo
649 649
 
650 650
                 case 'htmlarea':
651 651
                     if (!$xoops22) {
652
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php')) {
653
-                            require_once XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php';
652
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php')) {
653
+                            require_once XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php';
654 654
                             $editor = new XoopsFormHtmlarea($caption, $name, $value);
655 655
                         }
656 656
                     } else {
@@ -686,10 +686,10 @@  discard block
 block discarded – undo
686 686
         $size         = $multiple ? 5 : 1;
687 687
         $theme_select = new XoopsFormSelect($var['form_caption'], $key, $this->targetObject->getVar($key), $size, $multiple);
688 688
 
689
-        $handle  = opendir(XOOPS_THEME_PATH . '/');
689
+        $handle  = opendir(XOOPS_THEME_PATH.'/');
690 690
         $dirlist = [];
691 691
         while (false !== ($file = readdir($handle))) {
692
-            if (is_dir(XOOPS_THEME_PATH . '/' . $file) && !preg_match("/^[.]{1,2}$/", $file)
692
+            if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match("/^[.]{1,2}$/", $file)
693 693
                 && 'cvs' !== strtolower($file)) {
694 694
                 $dirlist[$file] = $file;
695 695
             }
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
     {
712 712
         foreach ($this->_elements as $eleObj) {
713 713
             if ($eleObj->getName() == $keyname) {
714
-                $ret =& $eleObj;
714
+                $ret = & $eleObj;
715 715
                 break;
716 716
             }
717 717
         }
@@ -728,9 +728,9 @@  discard block
 block discarded – undo
728 728
     {
729 729
         $required = $this->getRequired();
730 730
         $ret      = "
731
-            <form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "' onsubmit='return xoopsFormValidate_" . $this->getName() . "(this);'" . $this->getExtra() . ">
731
+            <form name='" . $this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' onsubmit='return xoopsFormValidate_".$this->getName()."(this);'".$this->getExtra().">
732 732
             <table width='100%' class='outer' cellspacing='1'>
733
-            <tr><th colspan='2'>" . $this->getTitle() . '</th></tr>
733
+            <tr><th colspan='2'>" . $this->getTitle().'</th></tr>
734 734
         ';
735 735
         $hidden   = '';
736 736
         $class    = 'even';
@@ -739,11 +739,11 @@  discard block
 block discarded – undo
739 739
                 $ret .= $ele;
740 740
             } elseif (!$ele->isHidden()) {
741 741
                 //$class = ( $class == 'even' ) ? 'odd': 'even';
742
-                $ret .= "<tr id='" . $ele->getName() . "' valign='top' align='left'><td class='head'>" . $ele->getCaption();
742
+                $ret .= "<tr id='".$ele->getName()."' valign='top' align='left'><td class='head'>".$ele->getCaption();
743 743
                 if ('' !== $ele->getDescription()) {
744
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $ele->getDescription() . '</span>';
744
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
745 745
                 }
746
-                $ret .= "</td><td class='$class'>" . $ele->render() . "</td></tr>\n";
746
+                $ret .= "</td><td class='$class'>".$ele->render()."</td></tr>\n";
747 747
             } else {
748 748
                 $hidden .= $ele->render();
749 749
             }
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
             'name'       => $this->getName(),
790 790
             'action'     => $this->getAction(),
791 791
             'method'     => $this->getMethod(),
792
-            'extra'      => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '(this);"' . $this->getExtra(),
792
+            'extra'      => 'onsubmit="return xoopsFormValidate_'.$this->getName().'(this);"'.$this->getExtra(),
793 793
             'javascript' => $js,
794 794
             'elements'   => $elements
795 795
         ]);
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
         }
808 808
         $myts     = MyTextSanitizer::getInstance();
809 809
         $formname = $this->getName();
810
-        $js       .= "function xoopsFormValidate_{$formname}(myform) {";
810
+        $js .= "function xoopsFormValidate_{$formname}(myform) {";
811 811
         // First, output code to check required elements
812 812
         $elements = $this->getRequired();
813 813
         foreach ($elements as $elt) {
@@ -858,15 +858,15 @@  discard block
 block discarded – undo
858 858
                         window.alert(\"{$eltmsg}\"); myform['{$eltname}'][0].focus(); return false; }\n";
859 859
                 }
860 860
             } else {
861
-                $js .= "if ( myform.{$eltname}.value == \"\" ) " . "{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
861
+                $js .= "if ( myform.{$eltname}.value == \"\" ) "."{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
862 862
             }
863 863
         }
864 864
         // Now, handle custom validation code
865
-        $elements =& $this->getElements(true);
865
+        $elements = & $this->getElements(true);
866 866
         foreach ($elements as $elt) {
867 867
             if (method_exists($elt, 'renderValidationJS') && 'xoopsformcheckbox' !== strtolower(get_class($elt))) {
868 868
                 if ($eltjs = $elt->renderValidationJS()) {
869
-                    $js .= $eltjs . "\n";
869
+                    $js .= $eltjs."\n";
870 870
                 }
871 871
             }
872 872
         }
Please login to merge, or discard this patch.
class/smartobjecttable.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function addActionButton($op, $caption = false, $text = false)
186 186
     {
187
-        $action                 = [
187
+        $action = [
188 188
             'op'      => $op,
189 189
             'caption' => $caption,
190 190
             'text'    => $text
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     {
220 220
         $current_urls               = smart_getCurrentUrls();
221 221
         $current_url                = $current_urls['full'];
222
-        $this->_printerFriendlyPage = $current_url . '&print';
222
+        $this->_printerFriendlyPage = $current_url.'&print';
223 223
     }
224 224
 
225 225
     /**
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
      */
253 253
     public function addDefaultIntroButton($caption)
254 254
     {
255
-        $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page . '?op=mod', $caption);
255
+        $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page.'?op=mod', $caption);
256 256
     }
257 257
 
258 258
     /**
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
     public function getDefaultSort()
278 278
     {
279 279
         if ($this->_sortsel) {
280
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel);
280
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel);
281 281
         } else {
282
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_objectHandler->identifierName);
282
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_objectHandler->identifierName);
283 283
         }
284 284
     }
285 285
 
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
     public function getDefaultOrder()
298 298
     {
299 299
         if ($this->_ordersel) {
300
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel);
300
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel);
301 301
         } else {
302
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', 'ASC');
302
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', 'ASC');
303 303
         }
304 304
     }
305 305
 
@@ -348,21 +348,21 @@  discard block
 block discarded – undo
348 348
 
349 349
     public function setSortOrder()
350 350
     {
351
-        $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] : $this->getDefaultSort();
351
+        $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] : $this->getDefaultSort();
352 352
         //$this->_sortsel = isset($_POST['sortsel']) ? $_POST['sortsel']: $this->_sortsel;
353
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel);
353
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel);
354 354
         $fieldsForSorting = $this->_tempObject->getFieldsForSorting($this->_sortsel);
355 355
 
356 356
         if (isset($this->_tempObject->vars[$this->_sortsel]['itemName'])
357 357
             && $this->_tempObject->vars[$this->_sortsel]['itemName']) {
358
-            $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'] . '.' . $this->_sortsel);
358
+            $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'].'.'.$this->_sortsel);
359 359
         } else {
360
-            $this->_criteria->setSort($this->_objectHandler->_itemname . '.' . $this->_sortsel);
360
+            $this->_criteria->setSort($this->_objectHandler->_itemname.'.'.$this->_sortsel);
361 361
         }
362 362
 
363
-        $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : $this->getDefaultOrder();
363
+        $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : $this->getDefaultOrder();
364 364
         //$this->_ordersel = isset($_POST['ordersel']) ? $_POST['ordersel']:$this->_ordersel;
365
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel);
365
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel);
366 366
         $ordersArray = $this->getOrdersArray();
367 367
         $this->_criteria->setOrder($this->_ordersel);
368 368
     }
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                         //$object->initiateCustomFields();
413 413
                     }
414 414
                     if ('checked' === $column->_keyname) {
415
-                        $value = '<input type ="checkbox" name="selected_smartobjects[]" value="' . $object->id() . '">';
415
+                        $value = '<input type ="checkbox" name="selected_smartobjects[]" value="'.$object->id().'">';
416 416
                     } elseif ($column->_customMethodForValue
417 417
                               && method_exists($object, $column->_customMethodForValue)) {
418 418
                         $method = $column->_customMethodForValue;
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                     }
458 458
                 }
459 459
 
460
-                require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php';
460
+                require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php';
461 461
                 $controller = new SmartObjectController($this->_objectHandler);
462 462
 
463 463
                 if ((!is_array($this->_actions)) || in_array('edit', $this->_actions)) {
@@ -497,9 +497,9 @@  discard block
 block discarded – undo
497 497
     public function getDefaultFilter()
498 498
     {
499 499
         if ($this->_filtersel) {
500
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
500
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel);
501 501
         } else {
502
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', 'default');
502
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', 'default');
503 503
         }
504 504
     }
505 505
 
@@ -549,9 +549,9 @@  discard block
 block discarded – undo
549 549
     public function getDefaultFilter2()
550 550
     {
551 551
         if ($this->_filtersel2) {
552
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2);
552
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2);
553 553
         } else {
554
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', 'default');
554
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', 'default');
555 555
         }
556 556
     }
557 557
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
      */
680 680
     public function render($fetchOnly = false, $debug = false)
681 681
     {
682
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
682
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
683 683
 
684 684
         $this->_tpl = new XoopsTpl();
685 685
 
@@ -690,24 +690,24 @@  discard block
 block discarded – undo
690 690
          */
691 691
         $this->_tempObject = $this->_objectHandler->create();
692 692
 
693
-        $this->_criteria->setStart(isset($_GET['start' . $this->_objectHandler->keyName]) ? (int)$_GET['start' . $this->_objectHandler->keyName] : 0);
693
+        $this->_criteria->setStart(isset($_GET['start'.$this->_objectHandler->keyName]) ? (int) $_GET['start'.$this->_objectHandler->keyName] : 0);
694 694
 
695 695
         $this->setSortOrder();
696 696
 
697 697
         if (!$this->_isTree) {
698
-            $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : smart_getCookieVar($_SERVER['PHP_SELF'] . '_limitsel', '15');
698
+            $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : smart_getCookieVar($_SERVER['PHP_SELF'].'_limitsel', '15');
699 699
         } else {
700 700
             $this->_limitsel = 'all';
701 701
         }
702 702
 
703 703
         $this->_limitsel = isset($_POST['limitsel']) ? $_POST['limitsel'] : $this->_limitsel;
704
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_limitsel', $this->_limitsel);
704
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_limitsel', $this->_limitsel);
705 705
         $limitsArray = $this->getLimitsArray();
706 706
         $this->_criteria->setLimit($this->_limitsel);
707 707
 
708 708
         $this->_filtersel = isset($_GET['filtersel']) ? $_GET['filtersel'] : $this->getDefaultFilter();
709 709
         $this->_filtersel = isset($_POST['filtersel']) ? $_POST['filtersel'] : $this->_filtersel;
710
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
710
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel);
711 711
         $filtersArray = $this->getFiltersArray();
712 712
 
713 713
         if ($filtersArray) {
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
                     $filters2Array = $this->getFilters2Array();
734 734
                     $this->_tpl->assign('smartobject_optionssel_filters2Array', $filters2Array);
735 735
 
736
-                    smart_setCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2);
736
+                    smart_setCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2);
737 737
                     if ('default' !== $this->_filtersel2) {
738 738
                         $this->_criteria->add(new Criteria($this->_filtersel, $this->_filtersel2));
739 739
                     }
@@ -742,21 +742,21 @@  discard block
 block discarded – undo
742 742
         }
743 743
         // Check if we have a quicksearch
744 744
 
745
-        if (isset($_POST['quicksearch_' . $this->_id]) && '' != $_POST['quicksearch_' . $this->_id]) {
745
+        if (isset($_POST['quicksearch_'.$this->_id]) && '' != $_POST['quicksearch_'.$this->_id]) {
746 746
             $quicksearch_criteria = new CriteriaCompo();
747 747
             if (is_array($this->_quickSearch['fields'])) {
748 748
                 foreach ($this->_quickSearch['fields'] as $v) {
749
-                    $quicksearch_criteria->add(new Criteria($v, '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'), 'OR');
749
+                    $quicksearch_criteria->add(new Criteria($v, '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'), 'OR');
750 750
                 }
751 751
             } else {
752
-                $quicksearch_criteria->add(new Criteria($this->_quickSearch['fields'], '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'));
752
+                $quicksearch_criteria->add(new Criteria($this->_quickSearch['fields'], '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'));
753 753
             }
754 754
             $this->_criteria->add($quicksearch_criteria);
755 755
         }
756 756
 
757 757
         $this->_objects = $this->fetchObjects($debug);
758 758
 
759
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
759
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
760 760
         if ($this->_criteria->getLimit() > 0) {
761 761
 
762 762
             /**
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
              */
773 773
             $params_of_the_options_sel = [];
774 774
 
775
-            $not_needed_params = ['sortsel', 'limitsel', 'ordersel', 'start' . $this->_objectHandler->keyName];
775
+            $not_needed_params = ['sortsel', 'limitsel', 'ordersel', 'start'.$this->_objectHandler->keyName];
776 776
             foreach ($_GET as $k => $v) {
777 777
                 if (!in_array($k, $not_needed_params)) {
778 778
                     $new_get_array[]             = "$k=$v";
@@ -783,12 +783,12 @@  discard block
 block discarded – undo
783 783
             /**
784 784
              * Adding the new params of the pagenav
785 785
              */
786
-            $new_get_array[] = 'sortsel=' . $this->_sortsel;
787
-            $new_get_array[] = 'ordersel=' . $this->_ordersel;
788
-            $new_get_array[] = 'limitsel=' . $this->_limitsel;
786
+            $new_get_array[] = 'sortsel='.$this->_sortsel;
787
+            $new_get_array[] = 'ordersel='.$this->_ordersel;
788
+            $new_get_array[] = 'limitsel='.$this->_limitsel;
789 789
             $otherParams     = implode('&', $new_get_array);
790 790
 
791
-            $pagenav = new XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start' . $this->_objectHandler->keyName, $otherParams);
791
+            $pagenav = new XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start'.$this->_objectHandler->keyName, $otherParams);
792 792
             $this->_tpl->assign('smartobject_pagenav', $pagenav->renderNav());
793 793
         }
794 794
         $this->renderOptionSelection($limitsArray, $params_of_the_options_sel);
@@ -824,20 +824,20 @@  discard block
 block discarded – undo
824 824
             $aColumn['align'] = $column->getAlign();
825 825
             $aColumn['key']   = $column->getKeyName();
826 826
             if ('checked' === $column->_keyname) {
827
-                $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"' . ' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_' . $this->_id . ', \'selected_smartobjects\');">';
827
+                $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"'.' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_'.$this->_id.', \'selected_smartobjects\');">';
828 828
             } elseif ($column->getCustomCaption()) {
829 829
                 $aColumn['caption'] = $column->getCustomCaption();
830 830
             } else {
831 831
                 $aColumn['caption'] = isset($this->_tempObject->vars[$column->getKeyName()]['form_caption']) ? $this->_tempObject->vars[$column->getKeyName()]['form_caption'] : $column->getKeyName();
832 832
             }
833 833
             // Are we doing a GET sort on this column ?
834
-            $getSort = (isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'])
835
-                        && $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] == $column->getKeyName())
834
+            $getSort = (isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel'])
835
+                        && $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] == $column->getKeyName())
836 836
                        || ($this->_sortsel == $column->getKeyName());
837
-            $order   = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : 'DESC';
837
+            $order   = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : 'DESC';
838 838
 
839
-            if (isset($_REQUEST['quicksearch_' . $this->_id]) && '' != $_REQUEST['quicksearch_' . $this->_id]) {
840
-                $qs_param = '&quicksearch_' . $this->_id . '=' . $_REQUEST['quicksearch_' . $this->_id];
839
+            if (isset($_REQUEST['quicksearch_'.$this->_id]) && '' != $_REQUEST['quicksearch_'.$this->_id]) {
840
+                $qs_param = '&quicksearch_'.$this->_id.'='.$_REQUEST['quicksearch_'.$this->_id];
841 841
             }
842 842
             if (!$this->_enableColumnsSorting || 'checked' === $column->_keyname || !$column->isSortable()) {
843 843
                 $aColumn['caption'] = $aColumn['caption'];
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
                                       . $orderArray[$order]['image']
865 865
                                       . '" alt="ASC"></a>';
866 866
             } else {
867
-                $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>';
867
+                $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>';
868 868
             }
869 869
             $aColumns[] = $aColumn;
870 870
         }
@@ -894,9 +894,9 @@  discard block
 block discarded – undo
894 894
 
895 895
         $smartobjectTable_template = $this->_customTemplate ?: 'smartobject_smarttable_display.tpl';
896 896
         if ($fetchOnly) {
897
-            return $this->_tpl->fetch('db:' . $smartobjectTable_template);
897
+            return $this->_tpl->fetch('db:'.$smartobjectTable_template);
898 898
         } else {
899
-            $this->_tpl->display('db:' . $smartobjectTable_template);
899
+            $this->_tpl->display('db:'.$smartobjectTable_template);
900 900
         }
901 901
     }
902 902
 
Please login to merge, or discard this patch.
class/smartobject.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 // defined('XOOPS_ROOT_PATH') || exit('Restricted access.');
14 14
 
15
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
15
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
16 16
 
17
-require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php';
17
+require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php';
18 18
 
19 19
 if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) {
20 20
     define('XOBJ_DTYPE_SIMPLE_ARRAY', 101);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function closeSection($section_name)
115 115
     {
116
-        $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
116
+        $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
117 117
     }
118 118
 
119 119
     /**
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
         }
152 152
         parent::initVar($key, $data_type, $value, $required, $maxlength, $options);
153 153
         if ($this->handler && (!$form_caption || '' === $form_caption)) {
154
-            $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key);
154
+            $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key);
155 155
             if (defined($dyn_form_caption)) {
156 156
                 $form_caption = constant($dyn_form_caption);
157 157
             }
158 158
         }
159 159
         if ($this->handler && (!$form_dsc || '' === $form_dsc)) {
160
-            $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC');
160
+            $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC');
161 161
             if (defined($dyn_form_dsc)) {
162 162
                 $form_dsc = constant($dyn_form_dsc);
163 163
             }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         $cancel_js_action = false,
442 442
         $captcha = false
443 443
     ) {
444
-        require_once SMARTOBJECT_ROOT_PATH . 'class/form/smartobjectform.php';
444
+        require_once SMARTOBJECT_ROOT_PATH.'class/form/smartobjectform.php';
445 445
         $form = new SmartobjectForm($this, $form_name, $form_caption, $form_action, null, $submit_button_caption, $cancel_js_action, $captcha);
446 446
 
447 447
         return $form;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     public function toArray()
454 454
     {
455 455
         $ret  = [];
456
-        $vars =& $this->getVars();
456
+        $vars = & $this->getVars();
457 457
         foreach ($vars as $key => $var) {
458 458
             $value     = $this->getVar($key);
459 459
             $ret[$key] = $value;
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         }
472 472
 
473 473
         // Hightlighting searched words
474
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smarthighlighter.php';
474
+        require_once SMARTOBJECT_ROOT_PATH.'class/smarthighlighter.php';
475 475
         $highlight = smart_getConfig('module_search_highlighter', false, true);
476 476
 
477 477
         if ($highlight && isset($_GET['keywords'])) {
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
             }
503 503
         } else {
504 504
             if ($prefix) {
505
-                $err_str = '[' . $prefix . '] ' . $err_str;
505
+                $err_str = '['.$prefix.'] '.$err_str;
506 506
             }
507 507
             parent::setErrors($err_str);
508 508
         }
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
                             $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
831 831
                             continue 2;
832 832
                         }
833
-                        if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) {
834
-                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength']));
833
+                        if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) {
834
+                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength']));
835 835
                             continue 2;
836 836
                         }
837 837
                         if (!$v['not_gpc']) {
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
                         break;
861 861
                     case XOBJ_DTYPE_INT:
862 862
                     case XOBJ_DTYPE_TIME_ONLY:
863
-                        $cleanv = (int)$cleanv;
863
+                        $cleanv = (int) $cleanv;
864 864
                         break;
865 865
 
866 866
                     case XOBJ_DTYPE_CURRENCY:
@@ -891,10 +891,10 @@  discard block
 block discarded – undo
891 891
                             continue 2;
892 892
                         }
893 893
                         if ('' !== $cleanv && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
894
-                            $cleanv = 'http://' . $cleanv;
894
+                            $cleanv = 'http://'.$cleanv;
895 895
                         }
896 896
                         if (!$v['not_gpc']) {
897
-                            $cleanv =& $ts->stripSlashesGPC($cleanv);
897
+                            $cleanv = & $ts->stripSlashesGPC($cleanv);
898 898
                         }
899 899
                         break;
900 900
                     case XOBJ_DTYPE_SIMPLE_ARRAY:
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
                     case XOBJ_DTYPE_STIME:
907 907
                     case XOBJ_DTYPE_MTIME:
908 908
                     case XOBJ_DTYPE_LTIME:
909
-                        $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv);
909
+                        $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv);
910 910
                         if (!($cleanv > 0)) {
911 911
                             $cleanv = strtotime($cleanv);
912 912
                         }
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
                         break;
916 916
                 }
917 917
             }
918
-            $this->cleanVars[$k] =& $cleanv;
918
+            $this->cleanVars[$k] = & $cleanv;
919 919
             unset($cleanv);
920 920
         }
921 921
         if (count($this->_errors) > 0) {
@@ -1140,10 +1140,10 @@  discard block
 block discarded – undo
1140 1140
                 }
1141 1141
                 break;
1142 1142
             case XOBJ_DTYPE_SIMPLE_ARRAY:
1143
-                $ret =& explode('|', $ret);
1143
+                $ret = & explode('|', $ret);
1144 1144
                 break;
1145 1145
             case XOBJ_DTYPE_ARRAY:
1146
-                $ret =& unserialize($ret);
1146
+                $ret = & unserialize($ret);
1147 1147
                 break;
1148 1148
             case XOBJ_DTYPE_SOURCE:
1149 1149
                 switch (strtolower($format)) {
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
         $actions = [],
1302 1302
         $headerAsRow = true
1303 1303
     ) {
1304
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectsingleview.php';
1304
+        require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectsingleview.php';
1305 1305
         $singleview = new SmartObjectSingleView($this, $userSide, $actions, $headerAsRow);
1306 1306
         // add all fields mark as displayOnSingleView except the keyid
1307 1307
         foreach ($this->vars as $key => $var) {
Please login to merge, or discard this patch.
class/smartobjectabout.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
     {
50 50
         global $xoopsModule, $xoopsConfig;
51 51
 
52
-        $fileName = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php';
52
+        $fileName = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php';
53 53
         if (file_exists($fileName)) {
54 54
             require_once $fileName;
55 55
         } else {
56
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/modinfo.php';
56
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/modinfo.php';
57 57
         }
58 58
         $this->_aboutTitle = $aboutTitle;
59 59
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
         //smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name'));
107 107
 
108
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
108
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
109 109
 
110 110
         // ---
111 111
         // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated.
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->_tpl = new XoopsTpl();
114 114
         // ---
115 115
 
116
-        $this->_tpl->assign('module_url', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/');
116
+        $this->_tpl->assign('module_url', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/');
117 117
         $this->_tpl->assign('module_image', $versioninfo->getInfo('image'));
118 118
         $this->_tpl->assign('module_name', $versioninfo->getInfo('name'));
119 119
         $this->_tpl->assign('module_version', $versioninfo->getInfo('version'));
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
         // Left headings...
123 123
         if ('' !== $versioninfo->getInfo('author_realname')) {
124
-            $author_name = $versioninfo->getInfo('author') . ' (' . $versioninfo->getInfo('author_realname') . ')';
124
+            $author_name = $versioninfo->getInfo('author').' ('.$versioninfo->getInfo('author_realname').')';
125 125
         } else {
126 126
             $author_name = $versioninfo->getInfo('author');
127 127
         }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         // For changelog thanks to 3Dev
168 168
         global $xoopsModule;
169
-        $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt';
169
+        $filename = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/changelog.txt';
170 170
         if (is_file($filename)) {
171 171
             $filesize = filesize($filename);
172 172
             $handle   = fopen($filename, 'r');
Please login to merge, or discard this patch.
class/smartexport.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/adsense.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 // defined('XOOPS_ROOT_PATH') || exit('Restricted access.');
31 31
 
32
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php';
32
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php';
33 33
 
34 34
 /**
35 35
  * Class SmartobjectAdsense
@@ -111,23 +111,23 @@  discard block
 block discarded – undo
111 111
     {
112 112
         global $smartobjectAdsenseHandler;
113 113
         if ('' !== $this->getVar('style', 'n')) {
114
-            $ret = '<div style="' . $this->getVar('style', 'n') . '">';
114
+            $ret = '<div style="'.$this->getVar('style', 'n').'">';
115 115
         } else {
116 116
             $ret = '<div>';
117 117
         }
118 118
 
119 119
         $ret .= '<script type="text/javascript"><!--
120
-google_ad_client = "' . $this->getVar('client_id', 'n') . '";
121
-google_ad_width = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['width'] . ';
122
-google_ad_height = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['height'] . ';
123
-google_ad_format = "' . $this->getVar('format', 'n') . '";
120
+google_ad_client = "' . $this->getVar('client_id', 'n').'";
121
+google_ad_width = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['width'].';
122
+google_ad_height = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['height'].';
123
+google_ad_format = "' . $this->getVar('format', 'n').'";
124 124
 google_ad_type = "text";
125 125
 google_ad_channel ="";
126
-google_color_border = "' . $this->getVar('border_color', 'n') . '";
127
-google_color_bg = "' . $this->getVar('background_color', 'n') . '";
128
-google_color_link = "' . $this->getVar('link_color', 'n') . '";
129
-google_color_url = "' . $this->getVar('url_color', 'n') . '";
130
-google_color_text = "' . $this->getVar('text_color', 'n') . '";
126
+google_color_border = "' . $this->getVar('border_color', 'n').'";
127
+google_color_bg = "' . $this->getVar('background_color', 'n').'";
128
+google_color_link = "' . $this->getVar('link_color', 'n').'";
129
+google_color_url = "' . $this->getVar('url_color', 'n').'";
130
+google_color_text = "' . $this->getVar('text_color', 'n').'";
131 131
 //--></script>
132 132
 <script type="text/javascript"
133 133
   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function getXoopsCode()
144 144
     {
145
-        $ret = '[adsense]' . $this->getVar('tag', 'n') . '[/adsense]';
145
+        $ret = '[adsense]'.$this->getVar('tag', 'n').'[/adsense]';
146 146
 
147 147
         return $ret;
148 148
     }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     public function getCloneLink()
265 265
     {
266
-        $ret = '<a href="' . SMARTOBJECT_URL . 'admin/adsense.php?op=clone&adsenseid=' . $this->getVar('adsenseid') . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'editcopy.png" alt="' . _CO_SOBJECT_ADSENSE_CLONE . '" title="' . _CO_SOBJECT_ADSENSE_CLONE . '"></a>';
266
+        $ret = '<a href="'.SMARTOBJECT_URL.'admin/adsense.php?op=clone&adsenseid='.$this->getVar('adsenseid').'"><img src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'editcopy.png" alt="'._CO_SOBJECT_ADSENSE_CLONE.'" title="'._CO_SOBJECT_ADSENSE_CLONE.'"></a>';
267 267
 
268 268
         return $ret;
269 269
     }
Please login to merge, or discard this patch.