Completed
Pull Request — master (#622)
by Richard
29:20 queued 24s
created
xoops_lib/Xoops/Form/Label.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     {
54 54
         $this->suppressRender(['name', 'value']);
55 55
         $attributes = $this->renderAttributeString();
56
-        $ret = '<div ' . $attributes . '>' . $this->getValue() . '</div>';
56
+        $ret = '<div '.$attributes.'>'.$this->getValue().'</div>';
57 57
         return $ret;
58 58
     }
59 59
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/ThemeForm.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function insertBreak($extra = '', $class = '')
37 37
     {
38
-        $class = ($class != '' ? " class=\"" . $class . "\"" : " class=\"break\"");
38
+        $class = ($class != '' ? " class=\"".$class."\"" : " class=\"break\"");
39 39
         // Fix for $extra tag not showing
40 40
         if ($extra) {
41
-            $value = '<div' . $class . '>' . $extra . '</div>';
41
+            $value = '<div'.$class.'>'.$extra.'</div>';
42 42
             $ele = new Raw($value);
43 43
             $this->addElement($ele);
44 44
         } else {
45
-            $value = '<div' . $class . '>&nbsp;</div>';
45
+            $value = '<div'.$class.'>&nbsp;</div>';
46 46
             $ele = new Raw($value);
47 47
             $this->addElement($ele);
48 48
         }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 $xoops->tpl()->appendByRef('xo_input', $input);
96 96
                 unset($input);
97 97
             } else {
98
-                $hidden .= $ele->render(). "\n";
98
+                $hidden .= $ele->render()."\n";
99 99
             }
100 100
 
101 101
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/DateTimeSelect.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
         } else {
48 48
             parent::__construct($caption, '', $name);
49 49
             $this->set('value', $value);
50
-            $this->set(':showtime', (int) $showtime);
50
+            $this->set(':showtime', (int)$showtime);
51 51
         }
52 52
 
53 53
         $workingTime = \Xoops\Core\Locale\Time::cleanTime($this->get('value', 0));
54 54
 
55 55
         $displayDate = true;
56 56
         $displayTime = true;
57
-        switch ((int) $this->get(':showtime', static::SHOW_BOTH)) {
57
+        switch ((int)$this->get(':showtime', static::SHOW_BOTH)) {
58 58
             case static::SHOW_DATE:
59 59
                 $displayTime = false;
60 60
                 break;
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 
66 66
         $dateDefinition = [
67 67
             'caption' => '',
68
-            'name' => $this->get('name') . '[date]',
69
-            'id' => $this->get('name') . '-date',
68
+            'name' => $this->get('name').'[date]',
69
+            'id' => $this->get('name').'-date',
70 70
             'size' => 15,
71 71
             'value' => $workingTime,
72 72
             ElementFactory::FORM_KEY => $this,
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
         }
81 81
 
82 82
         $minuteInterval = $this->get(':minuteinterval', 15);
83
-        $hours    = (int) ltrim($workingTime->format('H'), '0');
84
-        $minutes  = (int) ltrim($workingTime->format('i'), '0');
83
+        $hours    = (int)ltrim($workingTime->format('H'), '0');
84
+        $minutes  = (int)ltrim($workingTime->format('i'), '0');
85 85
 
86 86
         $timeDefinition = [
87 87
             'caption' => '',
88
-            'name' => $this->get('name') . '[time]',
89
-            'id' => $this->get('name') . '-time',
88
+            'name' => $this->get('name').'[time]',
89
+            'id' => $this->get('name').'-time',
90 90
             'size' => 1,
91 91
             'value' => \Xoops\Core\Locale\Time::formatTime(
92
-                $hours * 3600 + 60*$minuteInterval * ceil($minutes / $minuteInterval),
92
+                $hours * 3600 + 60 * $minuteInterval * ceil($minutes / $minuteInterval),
93 93
                 'short',
94 94
                 new \DateTimeZone('UTC')
95 95
             ),
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/GroupPermissionForm.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function __construct($title, $modid, $permname, $permdesc, $url = '', $anonymous = true)
74 74
     {
75
-        parent::__construct($title, 'groupperm_form', XOOPS_URL . '/modules/system/admin/groupperm.php', 'post');
75
+        parent::__construct($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post');
76 76
         $this->modid = (int)($modid);
77 77
         $this->permName = $permname;
78 78
         $this->permDesc = $permdesc;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             }
144 144
             // get selected item id(s) for each group
145 145
             $selected = $gperm_handler->getItemIds($this->permName, $i, $this->modid);
146
-            $ele = new GroupFormCheckbox($glist[$i], 'perms[' . $this->permName . ']', $i, $selected);
146
+            $ele = new GroupFormCheckbox($glist[$i], 'perms['.$this->permName.']', $i, $selected);
147 147
             $ele->setOptionTree($this->itemTree);
148 148
             $this->addElement($ele);
149 149
             unset($ele);
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
         $tray->addElement(new Button('', 'reset', \XoopsLocale::A_CANCEL, 'reset'));
154 154
         $this->addElement($tray);
155 155
 
156
-        $ret = '<h4>' . $this->getTitle() . '</h4>';
156
+        $ret = '<h4>'.$this->getTitle().'</h4>';
157 157
         if ($this->permDesc) {
158
-            $ret .= $this->permDesc . '<br /><br />';
158
+            $ret .= $this->permDesc.'<br /><br />';
159 159
         }
160
-        $ret .= '<form title="' . str_replace('"', '', $this->getTitle()) . '" name="'
161
-            . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction()
162
-            . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>'
160
+        $ret .= '<form title="'.str_replace('"', '', $this->getTitle()).'" name="'
161
+            . $this->getName().'" id="'.$this->getName().'" action="'.$this->getAction()
162
+            . '" method="'.$this->getMethod().'"'.$this->getExtra().'>'
163 163
             . '<table width="100%" class="outer" cellspacing="1" valign="top">';
164 164
         $elements = $this->getElements();
165 165
         $hidden = '';
@@ -167,17 +167,17 @@  discard block
 block discarded – undo
167 167
             if ($elements[$i] instanceof Raw) {
168 168
                 $ret .= $elements[$i]->render();
169 169
             } elseif (!$elements[$i]->isHidden()) {
170
-                $ret .= '<tr valign="top" align="left"><td class="head">' . $elements[$i]->getCaption();
170
+                $ret .= '<tr valign="top" align="left"><td class="head">'.$elements[$i]->getCaption();
171 171
                 if ($elements[$i]->getDescription() != "") {
172 172
                     $ret .= "<br /><br /><span style='font-weight: normal;'>"
173
-                        . $elements[$i]->getDescription() . "</span>";
173
+                        . $elements[$i]->getDescription()."</span>";
174 174
                 }
175
-                $ret .= '</td>' . '<td class="even">' . $elements[$i]->render() . '</td></tr>' . '';
175
+                $ret .= '</td>'.'<td class="even">'.$elements[$i]->render().'</td></tr>'.'';
176 176
             } else {
177 177
                 $hidden .= $elements[$i]->render();
178 178
             }
179 179
         }
180
-        $ret .= '</table>' . $hidden . '</form>';
180
+        $ret .= '</table>'.$hidden.'</form>';
181 181
         $ret .= $this->renderValidationJS(true);
182 182
         return $ret;
183 183
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/Form.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
      */
369 369
     public function getExtra()
370 370
     {
371
-        $extra = empty($this->extra) ? '' : ' ' . implode(' ', $this->extra);
371
+        $extra = empty($this->extra) ? '' : ' '.implode(' ', $this->extra);
372 372
         return $extra;
373 373
     }
374 374
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
         $elements = array();
480 480
         if (count($this->getRequired()) > 0) {
481 481
             $this->elements[] =
482
-                new Raw("<tr class='foot'><td colspan='2'>* = " . \XoopsLocale::REQUIRED . "</td></tr>");
482
+                new Raw("<tr class='foot'><td colspan='2'>* = ".\XoopsLocale::REQUIRED."</td></tr>");
483 483
         }
484 484
         foreach ($this->getElements() as $ele) {
485 485
             ++$i;
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         $tpl->assign($this->getName(), array(
501 501
                 'title' => $this->getTitle(), 'name' => $this->getName(), 'action' => $this->getAction(),
502 502
                 'method' => $this->getMethod(),
503
-                'extra' => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '();"' . $this->getExtra(),
503
+                'extra' => 'onsubmit="return xoopsFormValidate_'.$this->getName().'();"'.$this->getExtra(),
504 504
                 'javascript' => $js, 'elements' => $elements
505 505
             ));
506 506
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/GroupFormCheckbox.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             parent::__construct([]);
54 54
             $this->setCaption($caption);
55 55
             $this->setName($name);
56
-            $this->setWithDefaults('value', (array) $values, []);
56
+            $this->setWithDefaults('value', (array)$values, []);
57 57
             $this->set(':groupid', $groupId);
58 58
         }
59 59
         $this->groupId = $this->get(':groupid', 0);
@@ -90,21 +90,21 @@  discard block
 block discarded – undo
90 90
             $tree = '<td valign="top">';
91 91
             $prefix = '';
92 92
             $this->renderOptionTree($tree, $this->optionTree[$topitem], $prefix);
93
-            $ret .= $tree . '</td>';
93
+            $ret .= $tree.'</td>';
94 94
             ++$cols;
95 95
         }
96 96
         $ret .= '</tr></table></td><td class="even" valign="top">';
97 97
         $option_ids = array();
98 98
         foreach (array_keys($this->optionTree) as $id) {
99 99
             if (!empty($id)) {
100
-                $option_ids[] = "'" . $ele_name . '[groups][' . $this->groupId . '][' . $id . ']' . "'";
100
+                $option_ids[] = "'".$ele_name.'[groups]['.$this->groupId.']['.$id.']'."'";
101 101
             }
102 102
         }
103
-        $checkAllButtonId = $ele_name . '[checkallbtn][' . $this->groupId . ']';
103
+        $checkAllButtonId = $ele_name.'[checkallbtn]['.$this->groupId.']';
104 104
         $option_ids_str = implode(', ', $option_ids);
105
-        $ret .= \XoopsLocale::ALL . " <input id=\"" . $checkAllButtonId . "\" type=\"checkbox\" value=\"\" "
106
-            . "onclick=\"var optionids = new Array(" . $option_ids_str . "); "
107
-            . "xoopsCheckAllElements(optionids, '" . $checkAllButtonId . "');\" />";
105
+        $ret .= \XoopsLocale::ALL." <input id=\"".$checkAllButtonId."\" type=\"checkbox\" value=\"\" "
106
+            . "onclick=\"var optionids = new Array(".$option_ids_str."); "
107
+            . "xoopsCheckAllElements(optionids, '".$checkAllButtonId."');\" />";
108 108
         $ret .= '</td></tr></table>';
109 109
         return $ret;
110 110
     }
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
     private function renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
123 123
     {
124 124
         $elementName = $this->getName();
125
-        $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $elementName . "[groups]["
126
-            . $this->groupId . "][" . $option['id'] . "]\" id=\"" . $elementName
127
-            . "[groups][" . $this->groupId . "][" . $option['id'] . "]\" onclick=\"";
125
+        $tree .= $prefix."<input type=\"checkbox\" name=\"".$elementName."[groups]["
126
+            . $this->groupId."][".$option['id']."]\" id=\"".$elementName
127
+            . "[groups][".$this->groupId."][".$option['id']."]\" onclick=\"";
128 128
         // If there are parent elements, add javascript that will
129 129
         // make them selected when this element is checked to make
130 130
         // sure permissions to parent items are added as well.
131 131
         foreach ($parentIds as $pid) {
132
-            $parent_ele = $elementName . '[groups][' . $this->groupId . '][' . $pid . ']';
133
-            $tree .= "var ele = xoopsGetElementById('" . $parent_ele
132
+            $parent_ele = $elementName.'[groups]['.$this->groupId.']['.$pid.']';
133
+            $tree .= "var ele = xoopsGetElementById('".$parent_ele
134 134
                 . "'); if(ele.checked != true) {ele.checked = this.checked;}";
135 135
         }
136 136
         // If there are child elements, add javascript that will
@@ -138,22 +138,22 @@  discard block
 block discarded – undo
138 138
         // sure permissions to child items are not added when there
139 139
         // is no permission to this item.
140 140
         foreach ($option['allchild'] as $cid) {
141
-            $child_ele = $elementName . '[groups][' . $this->groupId . '][' . $cid . ']';
142
-            $tree .= "var ele = xoopsGetElementById('" . $child_ele
141
+            $child_ele = $elementName.'[groups]['.$this->groupId.']['.$cid.']';
142
+            $tree .= "var ele = xoopsGetElementById('".$child_ele
143 143
                 . "'); if(this.checked != true) {ele.checked = false;}";
144 144
         }
145 145
         $tree .= '" value="1"';
146 146
         if (in_array($option['id'], $this->get('value', []))) {
147 147
             $tree .= ' checked="checked"';
148 148
         }
149
-        $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $elementName . "[parents]["
150
-            . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\""
151
-            . $elementName . "[itemname][" . $option['id'] . "]\" value=\""
152
-            . htmlspecialchars($option['name']) . "\" /><br />\n";
149
+        $tree .= " />".$option['name']."<input type=\"hidden\" name=\"".$elementName."[parents]["
150
+            . $option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\""
151
+            . $elementName."[itemname][".$option['id']."]\" value=\""
152
+            . htmlspecialchars($option['name'])."\" /><br />\n";
153 153
         if (isset($option['children'])) {
154 154
             foreach ($option['children'] as $child) {
155 155
                 array_push($parentIds, $option['id']);
156
-                $this->renderOptionTree($tree, $this->optionTree[$child], $prefix . '&nbsp;-', $parentIds);
156
+                $this->renderOptionTree($tree, $this->optionTree[$child], $prefix.'&nbsp;-', $parentIds);
157 157
             }
158 158
         }
159 159
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/Radio.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $ele_options = $this->getOptions();
61 61
         $ele_value = $this->getValue();
62 62
         $ele_name = $this->getName();
63
-        $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : '');
63
+        $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : '');
64 64
         $ret = "";
65 65
         $inline = $this->has(':inline');
66 66
         if ($inline) {
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
             }
75 75
             $this->set('value', $value);
76 76
             ++$id_ele;
77
-            $this->set('id', $ele_name . $id_ele);
77
+            $this->set('id', $ele_name.$id_ele);
78 78
             if ($inline) {
79 79
                 $ret .= '<label class="radio-inline">';
80
-                $ret .= '<input ' . $this->renderAttributeString() . $extra . ">" . $buttonCaption . "\n";
80
+                $ret .= '<input '.$this->renderAttributeString().$extra.">".$buttonCaption."\n";
81 81
                 $ret .= "</label>\n";
82 82
             } else {
83 83
                 $ret .= "<div class=\"radio\">\n<label>";
84
-                $ret .= '<input ' . $this->renderAttributeString() . $extra . '>' . "\n";
85
-                $ret .= $buttonCaption . "\n";
84
+                $ret .= '<input '.$this->renderAttributeString().$extra.'>'."\n";
85
+                $ret .= $buttonCaption."\n";
86 86
                 $ret .= "</label>\n</div>\n";
87 87
             }
88 88
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/ElementFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,15 +59,15 @@
 block discarded – undo
59 59
         }
60 60
         $elementClass = $specification[self::CLASS_KEY];
61 61
         if (false === strpos($elementClass, '\\')) {
62
-            $elementClass = '\Xoops\Form\\' . $elementClass;
62
+            $elementClass = '\Xoops\Form\\'.$elementClass;
63 63
         }
64 64
 
65 65
         if (!class_exists($elementClass)) {
66
-            throw new \DomainException('Unknown element class: ' . $specification[self::CLASS_KEY]);
66
+            throw new \DomainException('Unknown element class: '.$specification[self::CLASS_KEY]);
67 67
         }
68 68
 
69 69
         if (!is_a($elementClass, '\Xoops\Form\Element', true)) {
70
-            throw new \DomainException('Not an Element subclass: ' . $specification[self::CLASS_KEY]);
70
+            throw new \DomainException('Not an Element subclass: '.$specification[self::CLASS_KEY]);
71 71
         }
72 72
 
73 73
         $specification[self::CLASS_KEY] = $elementClass;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/SelectUser.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $user_count = $member_handler->getUserCount();
54 54
         $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
55 55
         if ($user_count > $limit && count($value) > 0) {
56
-            $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
56
+            $criteria = new CriteriaCompo(new Criteria('uid', '('.implode(',', $value).')', 'IN'));
57 57
         } else {
58 58
             $criteria = new CriteriaCompo();
59 59
             $criteria->setLimit($limit);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             function addusers(opts){
73 73
                 var num = opts.substring(0, opts.indexOf(':'));
74 74
                 opts = opts.substring(opts.indexOf(':')+1, opts.length);
75
-                var sel = xoopsGetElementById('" . $name . "');
75
+                var sel = xoopsGetElementById('" . $name."');
76 76
                 var arr = new Array(num);
77 77
                 for (var n=0; n < num; n++) {
78 78
                     var nm = opts.substring(0, opts.indexOf(':'));
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
         $token = $xoops->security()->createToken();
100 100
         $action_tray = new Label(
101 101
             '',
102
-            '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name
102
+            '<a href="#" onclick="var sel = xoopsGetElementById(\''.$name
103 103
                 . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) '
104
-                .'{sel.options[i] = null;}}; return false;">' . \XoopsLocale::REMOVE_UNSELECTED_USERS . "</a>"
104
+                .'{sel.options[i] = null;}}; return false;">'.\XoopsLocale::REMOVE_UNSELECTED_USERS."</a>"
105 105
                 . ' | '
106
-                . '<a href="#" onclick="openWithSelfMain(\'' . \XoopsBaseConfig::get('url') . '/include/findusers.php?target='
107
-                . $name . '&amp;multiple=' . $multiple . '&amp;token=' . $token
106
+                . '<a href="#" onclick="openWithSelfMain(\''.\XoopsBaseConfig::get('url').'/include/findusers.php?target='
107
+                . $name.'&amp;multiple='.$multiple.'&amp;token='.$token
108 108
                 . '\', \'userselect\', 800, 600, null); return false;" >'
109
-                . \XoopsLocale::SEARCH_USERS . "</a>" . $js_addusers
109
+                . \XoopsLocale::SEARCH_USERS."</a>".$js_addusers
110 110
         );
111 111
         parent::__construct($caption, '', $name);
112 112
         $this->addElement($select_element);
Please login to merge, or discard this patch.