Completed
Push — master ( 4911d3...2a36d1 )
by Michael
02:09
created
include/projax_/classes/Scriptaculous.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
         }
62 62
 
63 63
         if (in_array($name, $this->TOGGLE_EFFECTS)) {
64
-            return "Effect.toggle($element,'" . str_replace('toggle_', '', $name) . "'," . $this->_options_for_javascript($js_options) . ')';
64
+            return "Effect.toggle($element,'".str_replace('toggle_', '', $name)."',".$this->_options_for_javascript($js_options).')';
65 65
         } else {
66
-            return 'new Effect.' . ucwords($name) . "($element," . $this->_options_for_javascript($js_options) . ')';
66
+            return 'new Effect.'.ucwords($name)."($element,".$this->_options_for_javascript($js_options).')';
67 67
         }
68 68
     }
69 69
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         //    }
94 94
 
95 95
         //if (isset($option['onUpdate'])) {
96
-        $options['onUpdate'] = 'function(){' . $this->remote_function($options) . '}';
96
+        $options['onUpdate'] = 'function(){'.$this->remote_function($options).'}';
97 97
         //}
98 98
 
99 99
         foreach ($options as $var => $val) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         foreach ($arr as $var) {
108 108
             if (isset($options[$var])) {
109
-                $options[$var] = "'" . $options[$var] . "'";
109
+                $options[$var] = "'".$options[$var]."'";
110 110
             }
111 111
         }
112 112
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $options['only'] = $this->_array_or_string_for_javascript($options['only']);
119 119
         }
120 120
 
121
-        return "Sortable.create('$element_id'," . $this->_options_for_javascript($options) . ')';
121
+        return "Sortable.create('$element_id',".$this->_options_for_javascript($options).')';
122 122
     }
123 123
 
124 124
     /**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function _dragable_element_js($element_id, $options)
130 130
     {
131
-        return 'new Draggable(\'' . $element_id . '\',' . $this->_options_for_javascript($options) . ')';
131
+        return 'new Draggable(\''.$element_id.'\','.$this->_options_for_javascript($options).')';
132 132
     }
133 133
 
134 134
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         //if (isset($option['onDrop']))
147 147
 
148 148
         {
149
-            $options['onDrop'] = 'function(element){' . $this->remote_function($options) . '}';
149
+            $options['onDrop'] = 'function(element){'.$this->remote_function($options).'}';
150 150
         }
151 151
 
152 152
         if (is_array($options)) {
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
         }
163 163
 
164 164
         if (isset($options['hoverclass'])) {
165
-            $options['hoverclass'] = "'" . $options['hoverclass'] . "'";
165
+            $options['hoverclass'] = "'".$options['hoverclass']."'";
166 166
         }
167 167
 
168
-        return 'Droppables.add(\'' . $element_id . '\',' . $this->_options_for_javascript($options) . ')';
168
+        return 'Droppables.add(\''.$element_id.'\','.$this->_options_for_javascript($options).')';
169 169
     }
170 170
 
171 171
     /////////////////////////////////////////////////////////////////////////////////////
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     {
183 183
         $function = 'new Ajax.InPlaceEditor(';
184 184
         $function .= "'$field_id', ";
185
-        $function .= "'" . $options['url'] . "'";
185
+        $function .= "'".$options['url']."'";
186 186
 
187 187
         $js_options = [];
188 188
         if (isset($options['cancel_text'])) {
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
             $js_options['size'] = $options['size'];
205 205
         }
206 206
         if (isset($options['external_control'])) {
207
-            $js_options['externalControl'] = "'" . $options['external_control'] . "'";
207
+            $js_options['externalControl'] = "'".$options['external_control']."'";
208 208
         }
209 209
         if (isset($options['load_text_url'])) {
210
-            $js_options['loadTextURL'] = "'" . $options['load_text_url'] . "'";
210
+            $js_options['loadTextURL'] = "'".$options['load_text_url']."'";
211 211
         }
212 212
         if (isset($options['options'])) {
213 213
             $js_options['ajaxOptions'] = $options['options'];
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
             $js_options['evalScripts'] = $options['script'];
217 217
         }
218 218
         if (isset($options['with'])) {
219
-            $js_options['callback'] = 'function(form) { return ' . $options['with'] . ' }';
219
+            $js_options['callback'] = 'function(form) { return '.$options['with'].' }';
220 220
         }
221 221
 
222
-        $function .= ', ' . $this->_options_for_javascript($js_options) . ' )';
222
+        $function .= ', '.$this->_options_for_javascript($js_options).' )';
223 223
         if ($tag) {
224 224
             return $this->tag($function);
225 225
         } else {
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     public function in_place_editor_field($object, $tag_options = null, $in_place_editor_options = null)
237 237
     {
238 238
         $ret_val = '';
239
-        $ret_val .= '<span id="' . $object . '" class="in_place_editor_field">' . (isset($tag_options['value']) ? $tag_options['value'] : '') . '</span>';
239
+        $ret_val .= '<span id="'.$object.'" class="in_place_editor_field">'.(isset($tag_options['value']) ? $tag_options['value'] : '').'</span>';
240 240
         $ret_val .= $this->in_place_editor($object, $in_place_editor_options);
241 241
 
242 242
         return $ret_val;
@@ -249,23 +249,23 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function auto_complete_field($field_id, $options)
251 251
     {
252
-        $function = "var $field_id" . '_auto_completer = new Ajax.Autocompleter(';
252
+        $function = "var $field_id".'_auto_completer = new Ajax.Autocompleter(';
253 253
         $function .= "'$field_id', ";
254
-        $function .= "'" . (isset($options['update']) ? $options['update'] : $field_id . '_auto_complete') . "', ";
255
-        $function .= "'" . $options['url'] . "'";
254
+        $function .= "'".(isset($options['update']) ? $options['update'] : $field_id.'_auto_complete')."', ";
255
+        $function .= "'".$options['url']."'";
256 256
 
257 257
         $js_options = [];
258 258
         if (isset($options['tokens'])) {
259 259
             $js_options['tokens'] = $this->javascript->_array_or_string_for_javascript($options['tokens']);
260 260
         }
261 261
         if (isset($options['with'])) {
262
-            $js_options['callback'] = 'function(element, value) { return ' . $options['with'] . ' }';
262
+            $js_options['callback'] = 'function(element, value) { return '.$options['with'].' }';
263 263
         }
264 264
         if (isset($options['indicator'])) {
265
-            $js_options['indicator'] = "'" . $options['indicator'] . "'";
265
+            $js_options['indicator'] = "'".$options['indicator']."'";
266 266
         }
267 267
         if (isset($options['select'])) {
268
-            $js_options['select'] = "'" . $options['select'] . "'";
268
+            $js_options['select'] = "'".$options['select']."'";
269 269
         }
270 270
 
271 271
         foreach (['on_show' => 'onShow', 'on_hide' => 'onHide', 'min_chars' => 'min_chars'] as $var => $val) {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
             }
275 275
         }
276 276
 
277
-        $function .= ', ' . $this->_options_for_javascript($js_options) . ' )';
277
+        $function .= ', '.$this->_options_for_javascript($js_options).' )';
278 278
 
279 279
         return $this->tag($function);
280 280
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                                                       . '" ' : '')
317 317
                     . '>';
318 318
 
319
-        $ret_val .= '<div id="' . $object . '_auto_complete" class="auto_complete"></div>';
319
+        $ret_val .= '<div id="'.$object.'_auto_complete" class="auto_complete"></div>';
320 320
         $ret_val .= $this->auto_complete_field($object, $completion_options);
321 321
 
322 322
         return $ret_val;
Please login to merge, or discard this patch.
include/projax/classes/Prototype.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $options['form'] = true;
65 65
 
66
-        return '<form action="' . $options['url'] . '" onsubmit="' . $this->remote_function($options) . '; return false;" method="' . (isset($options['method']) ? $options['method'] : 'post') . '"  >';
66
+        return '<form action="'.$options['url'].'" onsubmit="'.$this->remote_function($options).'; return false;" method="'.(isset($options['method']) ? $options['method'] : 'post').'"  >';
67 67
     }
68 68
 
69 69
     /**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function periodically_call_remote($options = null)
113 113
     {
114 114
         $frequency = isset($options['frequency']) ? $options['frequency'] : 10;
115
-        $code      = 'new PeriodicalExecuter(function() {' . $this->remote_function($options) . '},' . $frequency . ')';
115
+        $code      = 'new PeriodicalExecuter(function() {'.$this->remote_function($options).'},'.$frequency.')';
116 116
 
117 117
         return $code;
118 118
     }
@@ -128,22 +128,22 @@  discard block
 block discarded – undo
128 128
         $update = '';
129 129
 
130 130
         if (isset($options['update']) && is_array($options['update'])) {
131
-            $update = isset($options['update']['success']) ? 'success: ' . $options['update']['success'] : '';
131
+            $update = isset($options['update']['success']) ? 'success: '.$options['update']['success'] : '';
132 132
             $update .= empty($update) ? '' : ',';
133
-            $update .= isset($options['update']['failure']) ? 'failure: ' . $options['update']['failure'] : '';
133
+            $update .= isset($options['update']['failure']) ? 'failure: '.$options['update']['failure'] : '';
134 134
         } else {
135 135
             $update .= isset($options['update']) ? $options['update'] : '';
136 136
         }
137 137
 
138
-        $ajax_function = empty($update) ? 'new Ajax.Request(' : 'new Ajax.Updater(\'' . $update . '\',';
138
+        $ajax_function = empty($update) ? 'new Ajax.Request(' : 'new Ajax.Updater(\''.$update.'\',';
139 139
 
140
-        $ajax_function .= "'" . $options['url'] . "'";
141
-        $ajax_function .= ',' . $javascript_options . ')';
140
+        $ajax_function .= "'".$options['url']."'";
141
+        $ajax_function .= ','.$javascript_options.')';
142 142
 
143
-        $ajax_function = isset($options['before']) ? $options['before'] . ';' . $ajax_function : $ajax_function;
144
-        $ajax_function = isset($options['after']) ? $ajax_function . ';' . $options['after'] : $ajax_function;
145
-        $ajax_function = isset($options['condition']) ? 'if (' . $options['condition'] . ') {' . $ajax_function . '}' : $ajax_function;
146
-        $ajax_function = isset($options['confirm']) ? 'if ( confirm(\'' . $options['confirm'] . '\' ) ) { ' . $ajax_function . ' } ' : $ajax_function;
143
+        $ajax_function = isset($options['before']) ? $options['before'].';'.$ajax_function : $ajax_function;
144
+        $ajax_function = isset($options['after']) ? $ajax_function.';'.$options['after'] : $ajax_function;
145
+        $ajax_function = isset($options['condition']) ? 'if ('.$options['condition'].') {'.$ajax_function.'}' : $ajax_function;
146
+        $ajax_function = isset($options['confirm']) ? 'if ( confirm(\''.$options['confirm'].'\' ) ) { '.$ajax_function.' } ' : $ajax_function;
147 147
 
148 148
         return $ajax_function;
149 149
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $options['with'] = 'Form.serialize(this.form)';
161 161
         }
162 162
 
163
-        return '<input type="button" onclick="' . $this->remote_function($options) . '" name="' . $name . '" value ="' . $value . '">';
163
+        return '<input type="button" onclick="'.$this->remote_function($options).'" name="'.$name.'" value ="'.$value.'">';
164 164
     }
165 165
 
166 166
     /**
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
         $callbacks = [];
204 204
         foreach ($options as $callback => $code) {
205 205
             if (in_array($callback, $this->CALLBACKS)) {
206
-                $name             = 'on' . ucfirst($callback);
207
-                $callbacks[$name] = 'function(request){' . $code . '}';
206
+                $name             = 'on'.ucfirst($callback);
207
+                $callbacks[$name] = 'function(request){'.$code.'}';
208 208
             }
209 209
         }
210 210
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     public function _build_observer($klass, $name, $options = null)
221 221
     {
222 222
         if (isset($options['with']) && false === strpos($options['with'], '=')) {
223
-            $options['with'] = '\'' . $options['with'] . '=\' + value';
223
+            $options['with'] = '\''.$options['with'].'=\' + value';
224 224
         } elseif (isset($options['with']) && isset($options['update'])) {
225 225
             $options['with'] = 'value';
226 226
         }
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
         $callback = $options['function'] ?: $this->remote_function($options);
229 229
 
230 230
         $javascript = "new $klass('$name', ";
231
-        $javascript .= isset($options['frequency']) ? $options['frequency'] . ', ' : '';
231
+        $javascript .= isset($options['frequency']) ? $options['frequency'].', ' : '';
232 232
         $javascript .= 'function (element,value) { ';
233 233
         $javascript .= $callback;
234
-        $javascript .= isset($options['on']) ? ', ' . $options['on'] : '';
234
+        $javascript .= isset($options['on']) ? ', '.$options['on'] : '';
235 235
         $javascript .= '})';
236 236
 
237 237
         return $javascript;
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         }
264 264
 
265 265
         if (isset($options['position'])) {
266
-            $js_options['insertion'] = 'Insertion.' . ucfirst($options['position']);
266
+            $js_options['insertion'] = 'Insertion.'.ucfirst($options['position']);
267 267
         }
268 268
 
269 269
         $js_options['evalScripts'] = isset($options['script']) ? $options['script'] : 'true';
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         if (isset($options['form'])) {
272 272
             $js_options['parameters'] = 'Form.serialize(this)';
273 273
         } elseif (isset($options['parameters'])) {
274
-            $js_options['parameters'] = 'Form.serialize(\'' . $options['submit'] . '\')';
274
+            $js_options['parameters'] = 'Form.serialize(\''.$options['submit'].'\')';
275 275
         } elseif (isset($options['with'])) {
276 276
             $js_options['parameters'] = $options['with'];
277 277
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      */
299 299
     public function ID($id, $extend = null)
300 300
     {
301
-        return "$('$id')" . (!empty($extend)) ? '.' . $extend . '()' : '';
301
+        return "$('$id')".(!empty($extend)) ? '.'.$extend.'()' : '';
302 302
     }
303 303
 
304 304
     /**
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public function delay($seconds = 1, $script = '')
359 359
     {
360
-        return "setTimeout( function() { $script } , " . ($seconds * 1000) . ' )';
360
+        return "setTimeout( function() { $script } , ".($seconds * 1000).' )';
361 361
     }
362 362
 
363 363
     /**
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
     {
380 380
         $args = array_merge([$id], (is_array($options_for_render) ? $options_for_render : [$options_for_render]));
381 381
 
382
-        return $this->call('new Insertion.' . ucfirst($position), $args);
382
+        return $this->call('new Insertion.'.ucfirst($position), $args);
383 383
     }
384 384
 
385 385
     /**
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
      */
444 444
     public function select($pattern, $extend = null)
445 445
     {
446
-        return "$$('$pattern')" . (!empty($extend)) ? '.' . $extend : '';
446
+        return "$$('$pattern')".(!empty($extend)) ? '.'.$extend : '';
447 447
     }
448 448
 
449 449
     /**
Please login to merge, or discard this patch.
include/projax/classes/Scriptaculous.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
         }
62 62
 
63 63
         if (in_array($name, $this->TOGGLE_EFFECTS)) {
64
-            return "Effect.toggle($element,'" . str_replace('toggle_', '', $name) . "'," . $this->_options_for_javascript($js_options) . ')';
64
+            return "Effect.toggle($element,'".str_replace('toggle_', '', $name)."',".$this->_options_for_javascript($js_options).')';
65 65
         } else {
66
-            return 'new Effect.' . ucwords($name) . "($element," . $this->_options_for_javascript($js_options) . ')';
66
+            return 'new Effect.'.ucwords($name)."($element,".$this->_options_for_javascript($js_options).')';
67 67
         }
68 68
     }
69 69
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         //if (isset($option['onUpdate']))
98 98
         {
99
-            $options['onUpdate'] = 'function(){' . $this->remote_function($options) . '}';
99
+            $options['onUpdate'] = 'function(){'.$this->remote_function($options).'}';
100 100
         }
101 101
 
102 102
         foreach ($options as $var => $val) {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
         foreach ($arr as $var) {
111 111
             if (isset($options[$var])) {
112
-                $options[$var] = "'" . $options[$var] . "'";
112
+                $options[$var] = "'".$options[$var]."'";
113 113
             }
114 114
         }
115 115
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             $options['only'] = $this->_array_or_string_for_javascript($options['only']);
122 122
         }
123 123
 
124
-        return "Sortable.create('$element_id'," . $this->_options_for_javascript($options) . ')';
124
+        return "Sortable.create('$element_id',".$this->_options_for_javascript($options).')';
125 125
     }
126 126
 
127 127
     /**
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function _dragable_element_js($element_id, $options)
133 133
     {
134
-        return 'new Draggable(\'' . $element_id . '\',' . $this->_options_for_javascript($options) . ')';
134
+        return 'new Draggable(\''.$element_id.'\','.$this->_options_for_javascript($options).')';
135 135
     }
136 136
 
137 137
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         //if (isset($option['onDrop']))
151 151
         {
152
-            $options['onDrop'] = 'function(element){' . $this->remote_function($options) . '}';
152
+            $options['onDrop'] = 'function(element){'.$this->remote_function($options).'}';
153 153
         }
154 154
 
155 155
         if (is_array($options)) {
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
         }
166 166
 
167 167
         if (isset($options['hoverclass'])) {
168
-            $options['hoverclass'] = "'" . $options['hoverclass'] . "'";
168
+            $options['hoverclass'] = "'".$options['hoverclass']."'";
169 169
         }
170 170
 
171
-        return 'Droppables.add(\'' . $element_id . '\',' . $this->_options_for_javascript($options) . ')';
171
+        return 'Droppables.add(\''.$element_id.'\','.$this->_options_for_javascript($options).')';
172 172
     }
173 173
 
174 174
     /////////////////////////////////////////////////////////////////////////////////////
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         $function = 'new Ajax.InPlaceEditor(';
187 187
         $function .= "'$field_id', ";
188
-        $function .= "'" . $options['url'] . "'";
188
+        $function .= "'".$options['url']."'";
189 189
 
190 190
         $js_options = [];
191 191
         if (isset($options['cancel_text'])) {
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
             $js_options['size'] = $options['size'];
208 208
         }
209 209
         if (isset($options['external_control'])) {
210
-            $js_options['externalControl'] = "'" . $options['external_control'] . "'";
210
+            $js_options['externalControl'] = "'".$options['external_control']."'";
211 211
         }
212 212
         if (isset($options['load_text_url'])) {
213
-            $js_options['loadTextURL'] = "'" . $options['load_text_url'] . "'";
213
+            $js_options['loadTextURL'] = "'".$options['load_text_url']."'";
214 214
         }
215 215
         if (isset($options['options'])) {
216 216
             $js_options['ajaxOptions'] = $options['options'];
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
             $js_options['evalScripts'] = $options['script'];
220 220
         }
221 221
         if (isset($options['with'])) {
222
-            $js_options['callback'] = 'function(form) { return ' . $options['with'] . ' }';
222
+            $js_options['callback'] = 'function(form) { return '.$options['with'].' }';
223 223
         }
224 224
 
225
-        $function .= ', ' . $this->_options_for_javascript($js_options) . ' )';
225
+        $function .= ', '.$this->_options_for_javascript($js_options).' )';
226 226
         if ($tag) {
227 227
             return $this->tag($function);
228 228
         } else {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     public function in_place_editor_field($object, $tag_options = null, $in_place_editor_options = null)
240 240
     {
241 241
         $ret_val = '';
242
-        $ret_val .= '<span id="' . $object . '" class="in_place_editor_field">' . (isset($tag_options['value']) ? $tag_options['value'] : '') . '</span>';
242
+        $ret_val .= '<span id="'.$object.'" class="in_place_editor_field">'.(isset($tag_options['value']) ? $tag_options['value'] : '').'</span>';
243 243
         $ret_val .= $this->in_place_editor($object, $in_place_editor_options);
244 244
 
245 245
         return $ret_val;
@@ -252,23 +252,23 @@  discard block
 block discarded – undo
252 252
      */
253 253
     public function auto_complete_field($field_id, $options)
254 254
     {
255
-        $function = "var $field_id" . '_auto_completer = new Ajax.Autocompleter(';
255
+        $function = "var $field_id".'_auto_completer = new Ajax.Autocompleter(';
256 256
         $function .= "'$field_id', ";
257
-        $function .= "'" . (isset($options['update']) ? $options['update'] : $field_id . '_auto_complete') . "', ";
258
-        $function .= "'" . $options['url'] . "'";
257
+        $function .= "'".(isset($options['update']) ? $options['update'] : $field_id.'_auto_complete')."', ";
258
+        $function .= "'".$options['url']."'";
259 259
 
260 260
         $js_options = [];
261 261
         if (isset($options['tokens'])) {
262 262
             $js_options['tokens'] = $this->javascript->_array_or_string_for_javascript($options['tokens']);
263 263
         }
264 264
         if (isset($options['with'])) {
265
-            $js_options['callback'] = 'function(element, value) { return ' . $options['with'] . ' }';
265
+            $js_options['callback'] = 'function(element, value) { return '.$options['with'].' }';
266 266
         }
267 267
         if (isset($options['indicator'])) {
268
-            $js_options['indicator'] = "'" . $options['indicator'] . "'";
268
+            $js_options['indicator'] = "'".$options['indicator']."'";
269 269
         }
270 270
         if (isset($options['select'])) {
271
-            $js_options['select'] = "'" . $options['select'] . "'";
271
+            $js_options['select'] = "'".$options['select']."'";
272 272
         }
273 273
 
274 274
         foreach (['on_show' => 'onShow', 'on_hide' => 'onHide', 'min_chars' => 'min_chars'] as $var => $val) {
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             }
278 278
         }
279 279
 
280
-        $function .= ', ' . $this->_options_for_javascript($js_options) . ' )';
280
+        $function .= ', '.$this->_options_for_javascript($js_options).' )';
281 281
 
282 282
         return $this->tag($function);
283 283
     }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                                                       . '" ' : '')
320 320
                     . '>';
321 321
 
322
-        $ret_val .= '<div id="' . $object . '_auto_complete" class="auto_complete"></div>';
322
+        $ret_val .= '<div id="'.$object.'_auto_complete" class="auto_complete"></div>';
323 323
         $ret_val .= $this->auto_complete_field($object, $completion_options);
324 324
 
325 325
         return $ret_val;
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 function smart_get_css_link($cssfile)
13 13
 {
14
-    $ret = '<link rel="stylesheet" type="text/css" href="' . $cssfile . '">';
14
+    $ret = '<link rel="stylesheet" type="text/css" href="'.$cssfile.'">';
15 15
 
16 16
     return $ret;
17 17
 }
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
         $seoMode = smart_getModuleModeSEO($moduleName);
103 103
         if ($seoMode === 'rewrite') {
104 104
             $seoModuleName = smart_getModuleNameForSEO($moduleName);
105
-            $ret           = XOOPS_URL . '/' . $seoModuleName . '/';
105
+            $ret           = XOOPS_URL.'/'.$seoModuleName.'/';
106 106
         } elseif ($seoMode === 'pathinfo') {
107
-            $ret = XOOPS_URL . '/modules/' . $moduleName . '/seo.php/' . $seoModuleName . '/';
107
+            $ret = XOOPS_URL.'/modules/'.$moduleName.'/seo.php/'.$seoModuleName.'/';
108 108
         } else {
109
-            $ret = XOOPS_URL . '/modules/' . $moduleName . '/';
109
+            $ret = XOOPS_URL.'/modules/'.$moduleName.'/';
110 110
         }
111 111
 
112
-        return '<a href="' . $ret . '">' . $smartModule->getVar('name') . '</a>';
112
+        return '<a href="'.$ret.'">'.$smartModule->getVar('name').'</a>';
113 113
     }
114 114
 }
115 115
 
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
     /**
173 173
      * include SmartObject admin language file
174 174
      */
175
-    $fileName = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php';
175
+    $fileName = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php';
176 176
     if (file_exists($fileName)) {
177 177
         require_once $fileName;
178 178
     } else {
179
-        require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php';
179
+        require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/admin.php';
180 180
     } ?>
181 181
     <script type='text/javascript'>
182 182
         <!--
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
     /**
194 194
      * Include the admin language constants for the SmartObject Framework
195 195
      */
196
-    $admin_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/admin.php';
196
+    $admin_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/admin.php';
197 197
     if (!file_exists($admin_file)) {
198
-        $admin_file = SMARTOBJECT_ROOT_PATH . 'language/english/admin.php';
198
+        $admin_file = SMARTOBJECT_ROOT_PATH.'language/english/admin.php';
199 199
     }
200 200
     require_once $admin_file;
201 201
 }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     //Verifies that a MySQL table exists
216 216
     $xoopsDB  = XoopsDatabaseFactory::getDatabaseConnection();
217 217
     $realname = $xoopsDB->prefix($table);
218
-    $sql      = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
218
+    $sql      = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
219 219
     $ret      = $xoopsDB->queryF($sql);
220 220
     while (list($m_table) = $xoopsDB->fetchRow($ret)) {
221 221
         if ($m_table == $realname) {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         $moduleName = smart_getCurrentModuleName();
245 245
     }
246 246
     $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
247
-    $sql     = sprintf('SELECT metavalue FROM %s WHERE metakey=%s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key));
247
+    $sql     = sprintf('SELECT metavalue FROM %s WHERE metakey=%s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key));
248 248
     $ret     = $xoopsDB->query($sql);
249 249
     if (!$ret) {
250 250
         $value = false;
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
     $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
288 288
     $ret     = smart_GetMeta($key, $moduleName);
289 289
     if ($ret === '0' || $ret > 0) {
290
-        $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
290
+        $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
291 291
     } else {
292
-        $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
292
+        $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
293 293
     }
294 294
     $ret = $xoopsDB->queryF($sql);
295 295
     if (!$ret) {
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 {
470 470
     static $smartModules;
471 471
     if (isset($smartModules[$moduleName])) {
472
-        $ret =& $smartModules[$moduleName];
472
+        $ret = & $smartModules[$moduleName];
473 473
 
474 474
         return $ret;
475 475
     }
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 {
506 506
     static $smartConfigs;
507 507
     if (isset($smartConfigs[$moduleName])) {
508
-        $ret =& $smartConfigs[$moduleName];
508
+        $ret = & $smartConfigs[$moduleName];
509 509
 
510 510
         return $ret;
511 511
     }
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             return $ret;
534 534
         }
535 535
         $hModConfig                = xoops_getHandler('config');
536
-        $smartConfigs[$moduleName] =& $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
536
+        $smartConfigs[$moduleName] = & $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
537 537
     }
538 538
 
539 539
     return $smartConfigs[$moduleName];
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 {
560 560
     $ret = '';
561 561
     foreach ($errors as $key => $value) {
562
-        $ret .= '<br> - ' . $value;
562
+        $ret .= '<br> - '.$value;
563 563
     }
564 564
 
565 565
     return $ret;
@@ -579,17 +579,17 @@  discard block
 block discarded – undo
579 579
     if (!is_numeric($userid)) {
580 580
         return $userid;
581 581
     }
582
-    $userid = (int)$userid;
582
+    $userid = (int) $userid;
583 583
     if ($userid > 0) {
584 584
         if ($users == []) {
585 585
             //fetching users
586 586
             $memberHandler = xoops_getHandler('member');
587
-            $user          =& $memberHandler->getUser($userid);
587
+            $user          = & $memberHandler->getUser($userid);
588 588
         } else {
589 589
             if (!isset($users[$userid])) {
590 590
                 return $GLOBALS['xoopsConfig']['anonymous'];
591 591
             }
592
-            $user =& $users[$userid];
592
+            $user = & $users[$userid];
593 593
         }
594 594
         if (is_object($user)) {
595 595
             $ts        = MyTextSanitizer:: getInstance();
@@ -600,15 +600,15 @@  discard block
 block discarded – undo
600 600
                 $fullname = $user->getVar('name');
601 601
             }
602 602
             if (!empty($fullname)) {
603
-                $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
603
+                $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
604 604
             } else {
605
-                $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
605
+                $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
606 606
             }
607 607
             // add contact info: email + PM
608 608
             if ($withContact) {
609
-                $linkeduser .= ' <a href="mailto:' . $user->getVar('email') . '"><img style="vertical-align: middle;" src="' . XOOPS_URL . '/images/icons/email.gif' . '" alt="' . _CO_SOBJECT_SEND_EMAIL . '" title="' . _CO_SOBJECT_SEND_EMAIL . '"></a>';
610
-                $js         = "javascript:openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $userid . "', 'pmlite',450,370);";
611
-                $linkeduser .= ' <a href="' . $js . '"><img style="vertical-align: middle;" src="' . XOOPS_URL . '/images/icons/pm.gif' . '" alt="' . _CO_SOBJECT_SEND_PM . '" title="' . _CO_SOBJECT_SEND_PM . '"></a>';
609
+                $linkeduser .= ' <a href="mailto:'.$user->getVar('email').'"><img style="vertical-align: middle;" src="'.XOOPS_URL.'/images/icons/email.gif'.'" alt="'._CO_SOBJECT_SEND_EMAIL.'" title="'._CO_SOBJECT_SEND_EMAIL.'"></a>';
610
+                $js = "javascript:openWithSelfMain('".XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$userid."', 'pmlite',450,370);";
611
+                $linkeduser .= ' <a href="'.$js.'"><img style="vertical-align: middle;" src="'.XOOPS_URL.'/images/icons/pm.gif'.'" alt="'._CO_SOBJECT_SEND_PM.'" title="'._CO_SOBJECT_SEND_PM.'"></a>';
612 612
             }
613 613
 
614 614
             return $linkeduser;
@@ -627,20 +627,20 @@  discard block
 block discarded – undo
627 627
 function smart_adminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1)
628 628
 {
629 629
     global $xoopsModule, $xoopsConfig;
630
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
631
-    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) {
632
-        require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php';
630
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
631
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
632
+        require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php';
633 633
     } else {
634
-        require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/modinfo.php';
634
+        require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/modinfo.php';
635 635
     }
636
-    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php')) {
637
-        require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php';
636
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php')) {
637
+        require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php';
638 638
     } else {
639
-        require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php';
639
+        require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/admin.php';
640 640
     }
641 641
     $headermenu  = [];
642 642
     $adminObject = [];
643
-    include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/menu.php';
643
+    include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/admin/menu.php';
644 644
     $tpl = new XoopsTpl();
645 645
     $tpl->assign([
646 646
                      'headermenu'      => $headermenu,
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
 function smart_collapsableBar($id = '', $title = '', $dsc = '')
664 664
 {
665 665
     global $xoopsModule;
666
-    echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"togglecollapse('" . $id . "'); toggleIcon('" . $id . "_icon')\";>";
667
-    echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a>&nbsp;" . $title . '</h3>';
668
-    echo "<div id='" . $id . "'>";
666
+    echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"togglecollapse('".$id."'); toggleIcon('".$id."_icon')\";>";
667
+    echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a>&nbsp;".$title.'</h3>';
668
+    echo "<div id='".$id."'>";
669 669
     if ($dsc !== '') {
670
-        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $dsc . '</span>';
670
+        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$dsc.'</span>';
671 671
     }
672 672
 }
673 673
 
@@ -681,11 +681,11 @@  discard block
 block discarded – undo
681 681
     global $xoopsModule;
682 682
     $onClick = "ajaxtogglecollapse('$id')";
683 683
     //$onClick = "togglecollapse('$id'); toggleIcon('" . $id . "_icon')";
684
-    echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="' . $onClick . '">';
685
-    echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a>&nbsp;" . $title . '</h3>';
686
-    echo "<div id='" . $id . "'>";
684
+    echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="'.$onClick.'">';
685
+    echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a>&nbsp;".$title.'</h3>';
686
+    echo "<div id='".$id."'>";
687 687
     if ($dsc !== '') {
688
-        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $dsc . '</span>';
688
+        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$dsc.'</span>';
689 689
     }
690 690
 }
691 691
 
@@ -715,13 +715,13 @@  discard block
 block discarded – undo
715 715
 {
716 716
     $urls        = smart_getCurrentUrls();
717 717
     $path        = $urls['phpself'];
718
-    $cookie_name = $path . '_smart_collaps_' . $name;
718
+    $cookie_name = $path.'_smart_collaps_'.$name;
719 719
     $cookie_name = str_replace('.', '_', $cookie_name);
720 720
     $cookie      = smart_getCookieVar($cookie_name, '');
721 721
     if ($cookie === 'none') {
722 722
         echo '
723 723
                 <script type="text/javascript"><!--
724
-                togglecollapse("' . $name . '"); toggleIcon("' . $name . '_icon");
724
+                togglecollapse("' . $name.'"); toggleIcon("'.$name.'_icon");
725 725
                     //-->
726 726
                 </script>
727 727
                 ';
@@ -787,17 +787,17 @@  discard block
 block discarded – undo
787 787
     $httphost    = $_SERVER['HTTP_HOST'];
788 788
     $querystring = $_SERVER['QUERY_STRING'];
789 789
     if ($querystring !== '') {
790
-        $querystring = '?' . $querystring;
790
+        $querystring = '?'.$querystring;
791 791
     }
792
-    $currenturl           = $http . $httphost . $phpself . $querystring;
792
+    $currenturl           = $http.$httphost.$phpself.$querystring;
793 793
     $urls                 = [];
794 794
     $urls['http']         = $http;
795 795
     $urls['httphost']     = $httphost;
796 796
     $urls['phpself']      = $phpself;
797 797
     $urls['querystring']  = $querystring;
798
-    $urls['full_phpself'] = $http . $httphost . $phpself;
798
+    $urls['full_phpself'] = $http.$httphost.$phpself;
799 799
     $urls['full']         = $currenturl;
800
-    $urls['isHomePage']   = (XOOPS_URL . '/index.php') == ($http . $httphost . $phpself);
800
+    $urls['isHomePage']   = (XOOPS_URL.'/index.php') == ($http.$httphost.$phpself);
801 801
 
802 802
     return $urls;
803 803
 }
@@ -874,13 +874,13 @@  discard block
 block discarded – undo
874 874
 {
875 875
     global $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
876 876
 
877
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
877
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
878 878
     $tpl = new XoopsTpl();
879 879
 
880 880
     $hModule      = xoops_getHandler('module');
881
-    $versioninfo  =& $hModule->get($xoopsModule->getVar('mid'));
882
-    $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . '';
883
-    $modfooter    = "<a href='" . $versioninfo->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/cssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>";
881
+    $versioninfo  = & $hModule->get($xoopsModule->getVar('mid'));
882
+    $modfootertxt = 'Module '.$versioninfo->getInfo('name').' - Version '.$versioninfo->getInfo('version').'';
883
+    $modfooter    = "<a href='".$versioninfo->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/assets/images/cssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>";
884 884
     $tpl->assign('modfooter', $modfooter);
885 885
 
886 886
     if (!defined('_AM_SOBJECT_XOOPS_PRO')) {
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
     }
889 889
     $smartobjectConfig = smart_getModuleConfig('smartobject');
890 890
     $tpl->assign('smartobject_enable_admin_footer', $smartobjectConfig['enable_admin_footer']);
891
-    $tpl->display(SMARTOBJECT_ROOT_PATH . 'templates/smartobject_admin_footer.tpl');
891
+    $tpl->display(SMARTOBJECT_ROOT_PATH.'templates/smartobject_admin_footer.tpl');
892 892
 }
893 893
 
894 894
 function smart_xoops_cp_footer()
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
  */
916 916
 function smart_addScript($src)
917 917
 {
918
-    echo '<script src="' . $src . '" type="text/javascript"></script>';
918
+    echo '<script src="'.$src.'" type="text/javascript"></script>';
919 919
 }
920 920
 
921 921
 /**
@@ -924,16 +924,16 @@  discard block
 block discarded – undo
924 924
 function smart_addStyle($src)
925 925
 {
926 926
     if ($src === 'smartobject') {
927
-        $src = SMARTOBJECT_URL . 'assets/css/module.css';
927
+        $src = SMARTOBJECT_URL.'assets/css/module.css';
928 928
     }
929 929
     echo smart_get_css_link($src);
930 930
 }
931 931
 
932 932
 function smart_addAdminAjaxSupport()
933 933
 {
934
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/lib/prototype.js');
935
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/scriptaculous.js');
936
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/smart.js');
934
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/lib/prototype.js');
935
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/scriptaculous.js');
936
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/smart.js');
937 937
 }
938 938
 
939 939
 /**
@@ -993,8 +993,8 @@  discard block
 block discarded – undo
993 993
 function smart_htmlnumericentities($str)
994 994
 {
995 995
     //    return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
996
-    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function ($m) {
997
-        return '&#' . ord($m[0]) . chr(59);
996
+    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function($m) {
997
+        return '&#'.ord($m[0]).chr(59);
998 998
     }, $str);
999 999
 }
1000 1000
 
@@ -1008,16 +1008,16 @@  discard block
 block discarded – undo
1008 1008
     static $handlers;
1009 1009
     $name = strtolower(trim($name));
1010 1010
     if (!isset($handlers[$name])) {
1011
-        if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) {
1011
+        if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/kernel/'.$name.'.php')) {
1012 1012
             require_once $hnd_file;
1013 1013
         }
1014
-        $class = 'Xoops' . ucfirst($name) . 'Handler';
1014
+        $class = 'Xoops'.ucfirst($name).'Handler';
1015 1015
         if (class_exists($class)) {
1016 1016
             $handlers[$name] = new $class($GLOBALS['xoopsDB'], 'xoops');
1017 1017
         }
1018 1018
     }
1019 1019
     if (!isset($handlers[$name]) && !$optional) {
1020
-        trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
1020
+        trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
1021 1021
     }
1022 1022
     if (isset($handlers[$name])) {
1023 1023
         return $handlers[$name];
@@ -1097,9 +1097,9 @@  discard block
 block discarded – undo
1097 1097
 {
1098 1098
     global $xoopsConfig;
1099 1099
 
1100
-    $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/' . $xoopsConfig['language'] . '/' . $file . '.php';
1100
+    $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/'.$xoopsConfig['language'].'/'.$file.'.php';
1101 1101
     if (!file_exists($filename)) {
1102
-        $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/english/' . $file . '.php';
1102
+        $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/english/'.$file.'.php';
1103 1103
     }
1104 1104
     if (file_exists($filename)) {
1105 1105
         require_once $filename;
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
     $text = preg_replace($search, $replace, $document);
1197 1197
 
1198
-    preg_replace_callback('/&#(\d+);/', function ($matches) {
1198
+    preg_replace_callback('/&#(\d+);/', function($matches) {
1199 1199
         return chr($matches[1]);
1200 1200
     }, $document);
1201 1201
 
@@ -1218,21 +1218,21 @@  discard block
 block discarded – undo
1218 1218
         $str = $match[0];
1219 1219
         if (false !== strpos($str, ',')) {
1220 1220
             // A comma exists, that makes it easy, cos we assume it separates the decimal part.
1221
-            $str = str_replace('.', '', $str);    // Erase thousand seps
1222
-            $str = str_replace(',', '.', $str);    // Convert , to . for floatval command
1221
+            $str = str_replace('.', '', $str); // Erase thousand seps
1222
+            $str = str_replace(',', '.', $str); // Convert , to . for floatval command
1223 1223
 
1224
-            return (float)$str;
1224
+            return (float) $str;
1225 1225
         } else {
1226 1226
             // No comma exists, so we have to decide, how a single dot shall be treated
1227 1227
             if (preg_match("/^[0-9\-]*[\.]{1}[0-9-]+$/", $str) === true && $set['single_dot_as_decimal'] === true) {
1228 1228
                 // Treat single dot as decimal separator
1229
-                return (float)$str;
1229
+                return (float) $str;
1230 1230
             } else {
1231 1231
                 //echo "str: ".$str; echo "ret: ".str_replace('.', '', $str); echo "<br><br> ";
1232 1232
                 // Else, treat all dots as thousand seps
1233
-                $str = str_replace('.', '', $str);    // Erase thousand seps
1233
+                $str = str_replace('.', '', $str); // Erase thousand seps
1234 1234
 
1235
-                return (float)$str;
1235
+                return (float) $str;
1236 1236
             }
1237 1237
         }
1238 1238
     } else {
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
         $ret .= '.00';
1265 1265
     }
1266 1266
     if ($currencyObj) {
1267
-        $ret = $ret . ' ' . $currencyObj->getCode();
1267
+        $ret = $ret.' '.$currencyObj->getCode();
1268 1268
     }
1269 1269
 
1270 1270
     return $ret;
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
     }
1292 1292
     $ret = '';
1293 1293
     if ($moduleName) {
1294
-        $ret = "<a href='" . XOOPS_URL . "/modules/$moduleName/admin/index.php'>" . _CO_SOBJECT_ADMIN_PAGE . '</a>';
1294
+        $ret = "<a href='".XOOPS_URL."/modules/$moduleName/admin/index.php'>"._CO_SOBJECT_ADMIN_PAGE.'</a>';
1295 1295
     }
1296 1296
 
1297 1297
     return $ret;
@@ -1302,7 +1302,7 @@  discard block
 block discarded – undo
1302 1302
  */
1303 1303
 function smart_getEditors()
1304 1304
 {
1305
-    $filename = XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php';
1305
+    $filename = XOOPS_ROOT_PATH.'/class/xoopseditor/xoopseditor.php';
1306 1306
     if (!file_exists($filename)) {
1307 1307
         return false;
1308 1308
     }
@@ -1326,9 +1326,9 @@  discard block
 block discarded – undo
1326 1326
 {
1327 1327
     $ret = [];
1328 1328
     foreach ($items as $item) {
1329
-        $ret[] = $moduleName . '_' . $item;
1329
+        $ret[] = $moduleName.'_'.$item;
1330 1330
     }
1331
-    $ret[] = $moduleName . '_meta';
1331
+    $ret[] = $moduleName.'_meta';
1332 1332
 
1333 1333
     return $ret;
1334 1334
 }
Please login to merge, or discard this patch.
class/smartaddto.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function __construct($layout = 0, $method = 1)
23 23
     {
24
-        $layout = (int)$layout;
24
+        $layout = (int) $layout;
25 25
         if ($layout < 0 || $layout > 3) {
26 26
             $layout = 0;
27 27
         }
28 28
         $this->_layout = $layout;
29 29
 
30
-        $method = (int)$method;
30
+        $method = (int) $method;
31 31
         if ($method < 0 || $method > 1) {
32 32
             $method = 1;
33 33
         }
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
     {
43 43
         global $xoTheme, $xoopsTpl;
44 44
 
45
-        $xoTheme->addStylesheet(SMARTOBJECT_URL . 'include/addto/addto.css');
45
+        $xoTheme->addStylesheet(SMARTOBJECT_URL.'include/addto/addto.css');
46 46
 
47 47
         $xoopsTpl->assign('smartobject_addto_method', $this->_method);
48 48
         $xoopsTpl->assign('smartobject_addto_layout', $this->_layout);
49 49
 
50
-        $xoopsTpl->assign('smartobject_addto_url', SMARTOBJECT_URL . 'include/addto/');
50
+        $xoopsTpl->assign('smartobject_addto_url', SMARTOBJECT_URL.'include/addto/');
51 51
 
52 52
         if ($fetchOnly) {
53 53
             return $xoopsTpl->fetch('db:smartobject_addto.tpl');
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
     {
64 64
         global $xoTheme;
65 65
 
66
-        $xoTheme->addStylesheet(SMARTOBJECT_URL . 'include/addto/addto.css');
66
+        $xoTheme->addStylesheet(SMARTOBJECT_URL.'include/addto/addto.css');
67 67
 
68 68
         $block                             = [];
69 69
         $block['smartobject_addto_method'] = $this->_method;
70 70
         $block['smartobject_addto_layout'] = $this->_layout;
71
-        $block['smartobject_addto_url']    = SMARTOBJECT_URL . 'include/addto/';
71
+        $block['smartobject_addto_url']    = SMARTOBJECT_URL.'include/addto/';
72 72
 
73 73
         return $block;
74 74
     }
Please login to merge, or discard this patch.
class/basedurl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 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 SmartobjectBasedUrl
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 ($column->_keyname === 'checked') {
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 ($this->_filtersel2 !== 'default') {
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 ($column->_keyname === 'checked') {
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 || $column->_keyname === 'checked' || !$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/smarthighlighter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
         if ($this->singlewords) {
79 79
             $keywords = explode(' ', $this->preg_keywords);
80 80
             foreach ($keywords as $keyword) {
81
-                $patterns[] = '/(?' . '>' . $keyword . '+)/si';
81
+                $patterns[] = '/(?'.'>'.$keyword.'+)/si';
82 82
             }
83 83
         } else {
84
-            $patterns[] = '/(?' . '>' . $this->preg_keywords . '+)/si';
84
+            $patterns[] = '/(?'.'>'.$this->preg_keywords.'+)/si';
85 85
         }
86 86
 
87 87
         $result = $replace_matches[0];
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function highlight($buffer)
106 106
     {
107
-        $buffer              = '>' . $buffer . '<';
107
+        $buffer              = '>'.$buffer.'<';
108 108
         $this->preg_keywords = preg_replace('/[^\w ]/si', '', $this->keywords);
109
-        $buffer              = preg_replace_callback("/(\>(((?" . ">[^><]+)|(?R))*)\<)/is", [&$this, 'replace'], $buffer);
109
+        $buffer              = preg_replace_callback("/(\>(((?".">[^><]+)|(?R))*)\<)/is", [&$this, 'replace'], $buffer);
110 110
         $buffer              = substr($buffer, 1, -1);
111 111
 
112 112
         return $buffer;
Please login to merge, or discard this patch.
class/rating.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  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';
33
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartplugins.php';
32
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php';
33
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartplugins.php';
34 34
 
35 35
 /**
36 36
  * Class SmartobjectRating
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function getItemValue()
126 126
     {
127
-        $moduleUrl      = XOOPS_URL . '/modules/' . $this->getVar('dirname', 'n') . '/';
127
+        $moduleUrl      = XOOPS_URL.'/modules/'.$this->getVar('dirname', 'n').'/';
128 128
         $plugin         = $this->getModulePlugin();
129 129
         $pluginItemInfo = $plugin->getItemInfo($this->getVar('item'));
130 130
         if (!$pluginItemInfo) {
131 131
             return '';
132 132
         }
133 133
         $itemPath = sprintf($pluginItemInfo['url'], $this->getVar('itemid'));
134
-        $ret      = '<a href="' . $moduleUrl . $itemPath . '">' . $pluginItemInfo['caption'] . '</a>';
134
+        $ret      = '<a href="'.$moduleUrl.$itemPath.'">'.$pluginItemInfo['caption'].'</a>';
135 135
 
136 136
         return $ret;
137 137
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     public function __construct(XoopsDatabase $db)
175 175
     {
176 176
         parent::__construct($db, 'rating', 'ratingid', 'rate', '', 'smartobject');
177
-        $this->generalSQL = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->db->prefix('users') . ' AS user ON ' . $this->_itemname . '.uid=user.uid';
177
+        $this->generalSQL = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname.' INNER JOIN '.$this->db->prefix('users').' AS user ON '.$this->_itemname.'.uid=user.uid';
178 178
 
179 179
         $this->_rateOptions[1] = 1;
180 180
         $this->_rateOptions[2] = 2;
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function getRatingAverageByItemId($itemid, $dirname, $item)
219 219
     {
220
-        $sql    = 'SELECT AVG(rate), COUNT(ratingid) FROM ' . $this->table . " WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid";
220
+        $sql    = 'SELECT AVG(rate), COUNT(ratingid) FROM '.$this->table." WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid";
221 221
         $result = $this->db->query($sql);
222 222
         if (!$result) {
223 223
             return 0;
Please login to merge, or discard this patch.