Completed
Push — master ( 88111b...b3fce7 )
by Michael
05:58
created
class/smartloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
17 17
 
18
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
18
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
19 19
 
20 20
 /**
21 21
  * Include other classes used by the SmartObject
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.
class/Form/Elements/SmartFormFileElement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
     {
31 31
         $ret = '';
32 32
         if ('' !== $this->object->getVar($this->key)) {
33
-            $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>';
33
+            $ret .= '<div>'._CO_SOBJECT_CURRENT_FILE.$this->object->getVar($this->key).'</div>';
34 34
         }
35 35
 
36
-        $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
37
-                <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . ">
38
-                <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'></div>";
36
+        $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'>
37
+                <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra().">
38
+                <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."'></div>";
39 39
 
40 40
         return $ret;
41 41
     }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormFileUploadElement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $this->SmartFormFileElement($object, $key);
30 30
         // Override name for upload purposes
31
-        $this->setName('upload_' . $key);
31
+        $this->setName('upload_'.$key);
32 32
     }
33 33
 
34 34
     /**
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function render()
40 40
     {
41
-        return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
42
-        <input type='file' name='upload_" . $this->getName() . "' id='upload_" . $this->getName() . "'" . $this->getExtra() . ">
43
-        <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'>";
41
+        return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'>
42
+        <input type='file' name='upload_" . $this->getName()."' id='upload_".$this->getName()."'".$this->getExtra().">
43
+        <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."'>";
44 44
     }
45 45
 }
Please login to merge, or discard this patch.