Completed
Push — master ( 01b1a5...81f493 )
by Michael
04:03
created
include/projax_/classes/Scriptaculous.php 1 patch
Spacing   +24 added lines, -24 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 = array();
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 = array();
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 (array('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
     }
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
     public function text_field_with_auto_complete($object, $tag_options = null, $completion_options = null)
303 303
     {
304 304
         $ret_val = isset($completion_options['skip_style']) ? '' : $this->_auto_complete_stylesheet();
305
-        $ret_val .= '<input autocomplete="off" id="' . $object . '" name="' . $object . '" size="' . (isset($tag_options['size']) ? $tag_options['size'] : 30) . '" type="text" value="' . (isset($tag_options['size']) ? $tag_options['value'] : '') . '" ' . (isset($tag_options['class']) ? 'class = "' . $tag_options['class'] . '" ' : '') . '/>';
305
+        $ret_val .= '<input autocomplete="off" id="'.$object.'" name="'.$object.'" size="'.(isset($tag_options['size']) ? $tag_options['size'] : 30).'" type="text" value="'.(isset($tag_options['size']) ? $tag_options['value'] : '').'" '.(isset($tag_options['class']) ? 'class = "'.$tag_options['class'].'" ' : '').'/>';
306 306
 
307
-        $ret_val .= '<div id="' . $object . '_auto_complete" class="auto_complete"></div>';
307
+        $ret_val .= '<div id="'.$object.'_auto_complete" class="auto_complete"></div>';
308 308
         $ret_val .= $this->auto_complete_field($object, $completion_options);
309 309
 
310 310
         return $ret_val;
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +106 added lines, -106 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
 }
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
         $seoMode = smart_getModuleModeSEO($moduleName);
101 101
         if ($seoMode === 'rewrite') {
102 102
             $seoModuleName = smart_getModuleNameForSEO($moduleName);
103
-            $ret           = XOOPS_URL . '/' . $seoModuleName . '/';
103
+            $ret           = XOOPS_URL.'/'.$seoModuleName.'/';
104 104
         } elseif ($seoMode === 'pathinfo') {
105
-            $ret = XOOPS_URL . '/modules/' . $moduleName . '/seo.php/' . $seoModuleName . '/';
105
+            $ret = XOOPS_URL.'/modules/'.$moduleName.'/seo.php/'.$seoModuleName.'/';
106 106
         } else {
107
-            $ret = XOOPS_URL . '/modules/' . $moduleName . '/';
107
+            $ret = XOOPS_URL.'/modules/'.$moduleName.'/';
108 108
         }
109 109
 
110
-        return '<a href="' . $ret . '">' . $smartModule->getVar('name') . '</a>';
110
+        return '<a href="'.$ret.'">'.$smartModule->getVar('name').'</a>';
111 111
     }
112 112
 }
113 113
 
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
     /**
171 171
      * include SmartObject admin language file
172 172
      */
173
-    $fileName = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php';
173
+    $fileName = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php';
174 174
     if (file_exists($fileName)) {
175 175
         include_once $fileName;
176 176
     } else {
177
-        include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php';
177
+        include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/admin.php';
178 178
     }
179 179
     ?>
180 180
     <script type='text/javascript'>
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
     /**
193 193
      * Include the admin language constants for the SmartObject Framework
194 194
      */
195
-    $admin_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/admin.php';
195
+    $admin_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/admin.php';
196 196
     if (!file_exists($admin_file)) {
197
-        $admin_file = SMARTOBJECT_ROOT_PATH . 'language/english/admin.php';
197
+        $admin_file = SMARTOBJECT_ROOT_PATH.'language/english/admin.php';
198 198
     }
199 199
     include_once($admin_file);
200 200
 }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     //Verifies that a MySQL table exists
215 215
     $xoopsDB  = XoopsDatabaseFactory::getDatabaseConnection();
216 216
     $realname = $xoopsDB->prefix($table);
217
-    $sql      = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
217
+    $sql      = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
218 218
     $ret      = $xoopsDB->queryF($sql);
219 219
     while (list($m_table) = $xoopsDB->fetchRow($ret)) {
220 220
         if ($m_table == $realname) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         $moduleName = smart_getCurrentModuleName();
244 244
     }
245 245
     $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
246
-    $sql     = sprintf('SELECT metavalue FROM %s WHERE metakey=%s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key));
246
+    $sql     = sprintf('SELECT metavalue FROM %s WHERE metakey=%s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key));
247 247
     $ret     = $xoopsDB->query($sql);
248 248
     if (!$ret) {
249 249
         $value = false;
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
     $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
287 287
     $ret     = smart_GetMeta($key, $moduleName);
288 288
     if ($ret === '0' || $ret > 0) {
289
-        $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
289
+        $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key));
290 290
     } else {
291
-        $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
291
+        $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value));
292 292
     }
293 293
     $ret = $xoopsDB->queryF($sql);
294 294
     if (!$ret) {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 {
469 469
     static $smartModules;
470 470
     if (isset($smartModules[$moduleName])) {
471
-        $ret =& $smartModules[$moduleName];
471
+        $ret = & $smartModules[$moduleName];
472 472
 
473 473
         return $ret;
474 474
     }
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 {
505 505
     static $smartConfigs;
506 506
     if (isset($smartConfigs[$moduleName])) {
507
-        $ret =& $smartConfigs[$moduleName];
507
+        $ret = & $smartConfigs[$moduleName];
508 508
 
509 509
         return $ret;
510 510
     }
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             return $ret;
533 533
         }
534 534
         $hModConfig                = xoops_getHandler('config');
535
-        $smartConfigs[$moduleName] =& $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
535
+        $smartConfigs[$moduleName] = & $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
536 536
     }
537 537
 
538 538
     return $smartConfigs[$moduleName];
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 {
559 559
     $ret = '';
560 560
     foreach ($errors as $key => $value) {
561
-        $ret .= '<br> - ' . $value;
561
+        $ret .= '<br> - '.$value;
562 562
     }
563 563
 
564 564
     return $ret;
@@ -578,17 +578,17 @@  discard block
 block discarded – undo
578 578
     if (!is_numeric($userid)) {
579 579
         return $userid;
580 580
     }
581
-    $userid = (int)$userid;
581
+    $userid = (int) $userid;
582 582
     if ($userid > 0) {
583 583
         if ($users == array()) {
584 584
             //fetching users
585 585
             $memberHandler = xoops_getHandler('member');
586
-            $user          =& $memberHandler->getUser($userid);
586
+            $user          = & $memberHandler->getUser($userid);
587 587
         } else {
588 588
             if (!isset($users[$userid])) {
589 589
                 return $GLOBALS['xoopsConfig']['anonymous'];
590 590
             }
591
-            $user =& $users[$userid];
591
+            $user = & $users[$userid];
592 592
         }
593 593
         if (is_object($user)) {
594 594
             $ts        = MyTextSanitizer:: getInstance();
@@ -599,32 +599,32 @@  discard block
 block discarded – undo
599 599
                 $fullname = $user->getVar('name');
600 600
             }
601 601
             if (!empty($fullname)) {
602
-                $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
602
+                $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
603 603
             } else {
604
-                $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
604
+                $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
605 605
             }
606 606
             // add contact info: email + PM
607 607
             if ($withContact) {
608
-                $linkeduser .= ' <a href="mailto:' .
609
-                               $user->getVar('email') .
610
-                               '"><img style="vertical-align: middle;" src="' .
611
-                               XOOPS_URL .
612
-                               '/images/icons/email.gif' .
613
-                               '" alt="' .
614
-                               _CO_SOBJECT_SEND_EMAIL .
615
-                               '" title="' .
616
-                               _CO_SOBJECT_SEND_EMAIL .
608
+                $linkeduser .= ' <a href="mailto:'.
609
+                               $user->getVar('email').
610
+                               '"><img style="vertical-align: middle;" src="'.
611
+                               XOOPS_URL.
612
+                               '/images/icons/email.gif'.
613
+                               '" alt="'.
614
+                               _CO_SOBJECT_SEND_EMAIL.
615
+                               '" title="'.
616
+                               _CO_SOBJECT_SEND_EMAIL.
617 617
                                '"/></a>';
618
-                $js = "javascript:openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $userid . "', 'pmlite',450,370);";
619
-                $linkeduser .= ' <a href="' .
620
-                               $js .
621
-                               '"><img style="vertical-align: middle;" src="' .
622
-                               XOOPS_URL .
623
-                               '/images/icons/pm.gif' .
624
-                               '" alt="' .
625
-                               _CO_SOBJECT_SEND_PM .
626
-                               '" title="' .
627
-                               _CO_SOBJECT_SEND_PM .
618
+                $js = "javascript:openWithSelfMain('".XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$userid."', 'pmlite',450,370);";
619
+                $linkeduser .= ' <a href="'.
620
+                               $js.
621
+                               '"><img style="vertical-align: middle;" src="'.
622
+                               XOOPS_URL.
623
+                               '/images/icons/pm.gif'.
624
+                               '" alt="'.
625
+                               _CO_SOBJECT_SEND_PM.
626
+                               '" title="'.
627
+                               _CO_SOBJECT_SEND_PM.
628 628
                                '"/></a>';
629 629
             }
630 630
 
@@ -644,20 +644,20 @@  discard block
 block discarded – undo
644 644
 function smart_adminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1)
645 645
 {
646 646
     global $xoopsModule, $xoopsConfig;
647
-    include_once XOOPS_ROOT_PATH . '/class/template.php';
648
-    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) {
649
-        include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php';
647
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
648
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
649
+        include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php';
650 650
     } else {
651
-        include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/modinfo.php';
651
+        include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/modinfo.php';
652 652
     }
653
-    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php')) {
654
-        include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php';
653
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php')) {
654
+        include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php';
655 655
     } else {
656
-        include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php';
656
+        include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/admin.php';
657 657
     }
658 658
     $headermenu = array();
659 659
     $adminmenu  = array();
660
-    include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/menu.php';
660
+    include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/admin/menu.php';
661 661
     $tpl = new XoopsTpl();
662 662
     $tpl->assign(array(
663 663
                      'headermenu'      => $headermenu,
@@ -680,11 +680,11 @@  discard block
 block discarded – undo
680 680
 function smart_collapsableBar($id = '', $title = '', $dsc = '')
681 681
 {
682 682
     global $xoopsModule;
683
-    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')\";>";
684
-    echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt='' /></a>&nbsp;" . $title . '</h3>';
685
-    echo "<div id='" . $id . "'>";
683
+    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')\";>";
684
+    echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt='' /></a>&nbsp;".$title.'</h3>';
685
+    echo "<div id='".$id."'>";
686 686
     if ($dsc !== '') {
687
-        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $dsc . '</span>';
687
+        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$dsc.'</span>';
688 688
     }
689 689
 }
690 690
 
@@ -698,11 +698,11 @@  discard block
 block discarded – undo
698 698
     global $xoopsModule;
699 699
     $onClick = "ajaxtogglecollapse('$id')";
700 700
     //$onClick = "togglecollapse('$id'); toggleIcon('" . $id . "_icon')";
701
-    echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="' . $onClick . '">';
702
-    echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt='' /></a>&nbsp;" . $title . '</h3>';
703
-    echo "<div id='" . $id . "'>";
701
+    echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="'.$onClick.'">';
702
+    echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt='' /></a>&nbsp;".$title.'</h3>';
703
+    echo "<div id='".$id."'>";
704 704
     if ($dsc !== '') {
705
-        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $dsc . '</span>';
705
+        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$dsc.'</span>';
706 706
     }
707 707
 }
708 708
 
@@ -732,13 +732,13 @@  discard block
 block discarded – undo
732 732
 {
733 733
     $urls        = smart_getCurrentUrls();
734 734
     $path        = $urls['phpself'];
735
-    $cookie_name = $path . '_smart_collaps_' . $name;
735
+    $cookie_name = $path.'_smart_collaps_'.$name;
736 736
     $cookie_name = str_replace('.', '_', $cookie_name);
737 737
     $cookie      = smart_getCookieVar($cookie_name, '');
738 738
     if ($cookie === 'none') {
739 739
         echo '
740 740
                 <script type="text/javascript"><!--
741
-                togglecollapse("' . $name . '"); toggleIcon("' . $name . '_icon");
741
+                togglecollapse("' . $name.'"); toggleIcon("'.$name.'_icon");
742 742
                     //-->
743 743
                 </script>
744 744
                 ';
@@ -804,17 +804,17 @@  discard block
 block discarded – undo
804 804
     $httphost    = $_SERVER['HTTP_HOST'];
805 805
     $querystring = $_SERVER['QUERY_STRING'];
806 806
     if ($querystring !== '') {
807
-        $querystring = '?' . $querystring;
807
+        $querystring = '?'.$querystring;
808 808
     }
809
-    $currenturl           = $http . $httphost . $phpself . $querystring;
809
+    $currenturl           = $http.$httphost.$phpself.$querystring;
810 810
     $urls                 = array();
811 811
     $urls['http']         = $http;
812 812
     $urls['httphost']     = $httphost;
813 813
     $urls['phpself']      = $phpself;
814 814
     $urls['querystring']  = $querystring;
815
-    $urls['full_phpself'] = $http . $httphost . $phpself;
815
+    $urls['full_phpself'] = $http.$httphost.$phpself;
816 816
     $urls['full']         = $currenturl;
817
-    $urls['isHomePage']   = (XOOPS_URL . '/index.php') == ($http . $httphost . $phpself);
817
+    $urls['isHomePage']   = (XOOPS_URL.'/index.php') == ($http.$httphost.$phpself);
818 818
 
819 819
     return $urls;
820 820
 }
@@ -891,22 +891,22 @@  discard block
 block discarded – undo
891 891
 {
892 892
     global $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
893 893
 
894
-    include_once XOOPS_ROOT_PATH . '/class/template.php';
894
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
895 895
     $tpl = new XoopsTpl();
896 896
 
897 897
     $hModule      = xoops_getHandler('module');
898
-    $versioninfo  =& $hModule->get($xoopsModule->getVar('mid'));
899
-    $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . '';
900
-    $modfooter    = "<a href='" .
901
-                    $versioninfo->getInfo('support_site_url') .
902
-                    "' target='_blank'><img src='" .
903
-                    XOOPS_URL .
904
-                    '/modules/' .
905
-                    $xoopsModule->getVar('dirname') .
906
-                    "/assets/images/cssbutton.gif' title='" .
907
-                    $modfootertxt .
908
-                    "' alt='" .
909
-                    $modfootertxt .
898
+    $versioninfo  = & $hModule->get($xoopsModule->getVar('mid'));
899
+    $modfootertxt = 'Module '.$versioninfo->getInfo('name').' - Version '.$versioninfo->getInfo('version').'';
900
+    $modfooter    = "<a href='".
901
+                    $versioninfo->getInfo('support_site_url').
902
+                    "' target='_blank'><img src='".
903
+                    XOOPS_URL.
904
+                    '/modules/'.
905
+                    $xoopsModule->getVar('dirname').
906
+                    "/assets/images/cssbutton.gif' title='".
907
+                    $modfootertxt.
908
+                    "' alt='".
909
+                    $modfootertxt.
910 910
                     "'/></a>";
911 911
     $tpl->assign('modfooter', $modfooter);
912 912
 
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
     }
916 916
     $smartobjectConfig = smart_getModuleConfig('smartobject');
917 917
     $tpl->assign('smartobject_enable_admin_footer', $smartobjectConfig['enable_admin_footer']);
918
-    $tpl->display(SMARTOBJECT_ROOT_PATH . 'templates/smartobject_admin_footer.html');
918
+    $tpl->display(SMARTOBJECT_ROOT_PATH.'templates/smartobject_admin_footer.html');
919 919
 }
920 920
 
921 921
 function smart_xoops_cp_footer()
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
  */
943 943
 function smart_addScript($src)
944 944
 {
945
-    echo '<script src="' . $src . '" type="text/javascript"></script>';
945
+    echo '<script src="'.$src.'" type="text/javascript"></script>';
946 946
 }
947 947
 
948 948
 /**
@@ -951,16 +951,16 @@  discard block
 block discarded – undo
951 951
 function smart_addStyle($src)
952 952
 {
953 953
     if ($src === 'smartobject') {
954
-        $src = SMARTOBJECT_URL . 'assets/css/module.css';
954
+        $src = SMARTOBJECT_URL.'assets/css/module.css';
955 955
     }
956 956
     echo smart_get_css_link($src);
957 957
 }
958 958
 
959 959
 function smart_addAdminAjaxSupport()
960 960
 {
961
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/lib/prototype.js');
962
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/scriptaculous.js');
963
-    smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/smart.js');
961
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/lib/prototype.js');
962
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/scriptaculous.js');
963
+    smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/smart.js');
964 964
 }
965 965
 
966 966
 /**
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 function smart_htmlnumericentities($str)
1021 1021
 {
1022 1022
     //    return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
1023
-    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function ($m) { return '&#' . ord($m[0]) . chr(59); }, $str);
1023
+    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function($m) { return '&#'.ord($m[0]).chr(59); }, $str);
1024 1024
 }
1025 1025
 
1026 1026
 /**
@@ -1033,16 +1033,16 @@  discard block
 block discarded – undo
1033 1033
     static $handlers;
1034 1034
     $name = strtolower(trim($name));
1035 1035
     if (!isset($handlers[$name])) {
1036
-        if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) {
1036
+        if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/kernel/'.$name.'.php')) {
1037 1037
             require_once $hnd_file;
1038 1038
         }
1039
-        $class = 'Xoops' . ucfirst($name) . 'Handler';
1039
+        $class = 'Xoops'.ucfirst($name).'Handler';
1040 1040
         if (class_exists($class)) {
1041
-            $handlers[$name] = new $class ($GLOBALS['xoopsDB'], 'xoops');
1041
+            $handlers[$name] = new $class($GLOBALS['xoopsDB'], 'xoops');
1042 1042
         }
1043 1043
     }
1044 1044
     if (!isset($handlers[$name]) && !$optional) {
1045
-        trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
1045
+        trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
1046 1046
     }
1047 1047
     if (isset($handlers[$name])) {
1048 1048
         return $handlers[$name];
@@ -1122,9 +1122,9 @@  discard block
 block discarded – undo
1122 1122
 {
1123 1123
     global $xoopsConfig;
1124 1124
 
1125
-    $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/' . $xoopsConfig['language'] . '/' . $file . '.php';
1125
+    $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/'.$xoopsConfig['language'].'/'.$file.'.php';
1126 1126
     if (!file_exists($filename)) {
1127
-        $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/english/' . $file . '.php';
1127
+        $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/english/'.$file.'.php';
1128 1128
     }
1129 1129
     if (file_exists($filename)) {
1130 1130
         include_once($filename);
@@ -1187,11 +1187,11 @@  discard block
 block discarded – undo
1187 1187
     // common HTML entities to their text equivalent.
1188 1188
     // Credits: newbb2
1189 1189
     $search = array(
1190
-        "'<script[^>]*?>.*?</script>'si",  // Strip out javascript
1191
-        "'<img.*?/>'si",       // Strip out img tags
1192
-        "'<[\/\!]*?[^<>]*?>'si",          // Strip out HTML tags
1193
-        "'([\r\n])[\s]+'",                // Strip out white space
1194
-        "'&(quot|#34);'i",                // Replace HTML entities
1190
+        "'<script[^>]*?>.*?</script>'si", // Strip out javascript
1191
+        "'<img.*?/>'si", // Strip out img tags
1192
+        "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags
1193
+        "'([\r\n])[\s]+'", // Strip out white space
1194
+        "'&(quot|#34);'i", // Replace HTML entities
1195 1195
         "'&(amp|#38);'i",
1196 1196
         "'&(lt|#60);'i",
1197 1197
         "'&(gt|#62);'i",
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
         "'&(pound|#163);'i",
1202 1202
         "'&(copy|#169);'i",
1203 1203
         "'&#(\d+);'e"
1204
-    );                    // evaluate as php
1204
+    ); // evaluate as php
1205 1205
 
1206 1206
     $replace = array(
1207 1207
         '',
@@ -1241,21 +1241,21 @@  discard block
 block discarded – undo
1241 1241
         $str = $match[0];
1242 1242
         if (false !== strpos($str, ',')) {
1243 1243
             // A comma exists, that makes it easy, cos we assume it separates the decimal part.
1244
-            $str = str_replace('.', '', $str);    // Erase thousand seps
1245
-            $str = str_replace(',', '.', $str);    // Convert , to . for floatval command
1244
+            $str = str_replace('.', '', $str); // Erase thousand seps
1245
+            $str = str_replace(',', '.', $str); // Convert , to . for floatval command
1246 1246
 
1247
-            return (float)$str;
1247
+            return (float) $str;
1248 1248
         } else {
1249 1249
             // No comma exists, so we have to decide, how a single dot shall be treated
1250 1250
             if (preg_match("/^[0-9\-]*[\.]{1}[0-9-]+$/", $str) == true && $set['single_dot_as_decimal'] == true) {
1251 1251
                 // Treat single dot as decimal separator
1252
-                return (float)$str;
1252
+                return (float) $str;
1253 1253
             } else {
1254 1254
                 //echo "str: ".$str; echo "ret: ".str_replace('.', '', $str); echo "<br><br> ";
1255 1255
                 // Else, treat all dots as thousand seps
1256
-                $str = str_replace('.', '', $str);    // Erase thousand seps
1256
+                $str = str_replace('.', '', $str); // Erase thousand seps
1257 1257
 
1258
-                return (float)$str;
1258
+                return (float) $str;
1259 1259
             }
1260 1260
         }
1261 1261
     } else {
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
         $ret .= '.00';
1288 1288
     }
1289 1289
     if ($currencyObj) {
1290
-        $ret = $ret . ' ' . $currencyObj->getCode();
1290
+        $ret = $ret.' '.$currencyObj->getCode();
1291 1291
     }
1292 1292
 
1293 1293
     return $ret;
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
     }
1315 1315
     $ret = '';
1316 1316
     if ($moduleName) {
1317
-        $ret = "<a href='" . XOOPS_URL . "/modules/$moduleName/admin/index.php'>" . _CO_SOBJECT_ADMIN_PAGE . '</a>';
1317
+        $ret = "<a href='".XOOPS_URL."/modules/$moduleName/admin/index.php'>"._CO_SOBJECT_ADMIN_PAGE.'</a>';
1318 1318
     }
1319 1319
 
1320 1320
     return $ret;
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
  */
1326 1326
 function smart_getEditors()
1327 1327
 {
1328
-    $filename = XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php';
1328
+    $filename = XOOPS_ROOT_PATH.'/class/xoopseditor/xoopseditor.php';
1329 1329
     if (!file_exists($filename)) {
1330 1330
         return false;
1331 1331
     }
@@ -1349,9 +1349,9 @@  discard block
 block discarded – undo
1349 1349
 {
1350 1350
     $ret = array();
1351 1351
     foreach ($items as $item) {
1352
-        $ret[] = $moduleName . '_' . $item;
1352
+        $ret[] = $moduleName.'_'.$item;
1353 1353
     }
1354
-    $ret[] = $moduleName . '_meta';
1354
+    $ret[] = $moduleName.'_meta';
1355 1355
 
1356 1356
     return $ret;
1357 1357
 }
Please login to merge, or discard this patch.
include/update.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 //  ------------------------------------------------------------------------ //
27 27
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
28 28
 
29
-include_once(XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php');
30
-include_once(XOOPS_ROOT_PATH . '/modules/smartobject/class/smartdbupdater.php');
29
+include_once(XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php');
30
+include_once(XOOPS_ROOT_PATH.'/modules/smartobject/class/smartdbupdater.php');
31 31
 
32 32
 /**
33 33
  * @param $module
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 
45 45
     $dbupdater = new SmartobjectDbupdater();
46 46
 
47
-    echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>';
47
+    echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>';
48 48
 
49 49
     // db migrate version = 1
50 50
     $newDbVersion = 1;
51 51
     if ($dbVersion < $newDbVersion) {
52
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
52
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
53 53
 
54 54
         // Create table smartobject_link
55 55
         $table = new SmartDbTable('smartobject_link');
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     // db migrate version = 2
153 153
     $newDbVersion = 2;
154 154
     if ($dbVersion < $newDbVersion) {
155
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
155
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
156 156
 
157 157
         // Create table smartobject_rating
158 158
         $table = new SmartDbTable('smartobject_rating');
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     // db migrate version = 3
193 193
     $newDbVersion = 3;
194 194
     if ($dbVersion < $newDbVersion) {
195
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
195
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
196 196
 
197 197
         // Create table smartobject_customtag
198 198
         $table = new SmartDbTable('smartobject_customtag');
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     // db migrate version = 4
218 218
     $newDbVersion = 4;
219 219
     if ($dbVersion < $newDbVersion) {
220
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
220
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
221 221
 
222 222
         // Create table smartobject_currency
223 223
         $table = new SmartDbTable('smartobject_currency');
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
     // db migrate version = 6
244 244
     $newDbVersion = 6;
245 245
     if ($dbVersion < $newDbVersion) {
246
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
246
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
247 247
     }
248 248
 
249 249
     $newDbVersion = 7;
250 250
     if ($dbVersion < $newDbVersion) {
251
-        echo 'Database migrate to version ' . $newDbVersion . '<br>';
251
+        echo 'Database migrate to version '.$newDbVersion.'<br>';
252 252
 
253 253
         // Create table smartobject_file
254 254
         $table = new SmartDbTable('smartobject_file');
Please login to merge, or discard this patch.
include/captcha/text.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function setCode()
44 44
     {
45
-        $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code;
45
+        $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code;
46 46
     }
47 47
 
48 48
     /**
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function render()
52 52
     {
53
-        $form = $this->loadText() .
54
-                "&nbsp;&nbsp; <input type='text' name='" .
55
-                $this->config['name'] .
56
-                "' id='" .
57
-                $this->config['name'] .
58
-                "' size='" .
59
-                $this->config['num_chars'] .
60
-                "' maxlength='" .
61
-                $this->config['num_chars'] .
53
+        $form = $this->loadText().
54
+                "&nbsp;&nbsp; <input type='text' name='".
55
+                $this->config['name'].
56
+                "' id='".
57
+                $this->config['name'].
58
+                "' size='".
59
+                $this->config['num_chars'].
60
+                "' maxlength='".
61
+                $this->config['num_chars'].
62 62
                 "' value='' />";
63 63
         $rule = constant('XOOPS_CAPTCHA_RULE_TEXT');
64 64
         if (!empty($rule)) {
Please login to merge, or discard this patch.
include/captcha/config.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@
 block discarded – undo
14 14
 $config = array(
15 15
     'mode'       => 'image',
16 16
     'name'       => 'xoopscaptcha',
17
-    'skipmember' => true,                    // Skip CAPTCHA check for members
18
-    'maxattempt' => 100,                    // Maximum attempts for each session
17
+    'skipmember' => true, // Skip CAPTCHA check for members
18
+    'maxattempt' => 100, // Maximum attempts for each session
19 19
 
20
-    'num_chars'       => 4,                        // Maximum characters
20
+    'num_chars'       => 4, // Maximum characters
21 21
 
22 22
     // For image mode, based on DuGris' SecurityImage
23
-    'rootpath'        => __DIR__,        // __Absolute__ Path to the root of fonts and backgrounds
24
-    'imagepath'       => 'uploads/captcha',        // Path to temporary image files, __relative__ to XOOPS_ROOT_PATH
25
-    'imageurl'        => 'modules/smartobject/include/captcha/scripts/img.php',        // Path to the script for creating image, __relative__ to XOOPS_ROOT_PATH
26
-    'casesensitive'   => false,                    // Characters in image mode is case-sensitive
27
-    'fontsize_min'    => 12,                    // Minimum font-size
28
-    'fontsize_max'    => 12,                    // Maximum font-size
29
-    'background_type' => 0,                        // Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files
30
-    'background_num'  => 50,                        // Number of background images to generate
23
+    'rootpath'        => __DIR__, // __Absolute__ Path to the root of fonts and backgrounds
24
+    'imagepath'       => 'uploads/captcha', // Path to temporary image files, __relative__ to XOOPS_ROOT_PATH
25
+    'imageurl'        => 'modules/smartobject/include/captcha/scripts/img.php', // Path to the script for creating image, __relative__ to XOOPS_ROOT_PATH
26
+    'casesensitive'   => false, // Characters in image mode is case-sensitive
27
+    'fontsize_min'    => 12, // Minimum font-size
28
+    'fontsize_max'    => 12, // Maximum font-size
29
+    'background_type' => 0, // Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files
30
+    'background_num'  => 50, // Number of background images to generate
31 31
     'polygon_point'   => 3
32 32
 );
33 33
 
34 34
 $language = preg_replace("/[^a-z0-9_\-]/i", '', $GLOBALS['xoopsConfig']['language']);
35 35
 
36
-if (!@include_once __DIR__ . "/language/{$language}.php") {
37
-    require_once __DIR__ . '/language/english.php';
36
+if (!@include_once __DIR__."/language/{$language}.php") {
37
+    require_once __DIR__.'/language/english.php';
38 38
 }
39 39
 
40 40
 return $config;
Please login to merge, or discard this patch.
include/captcha/scripts/img.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
  * D.J.
6 6
  */
7 7
 
8
-include dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/mainfile.php';
8
+include dirname(dirname(dirname(dirname(dirname(__DIR__))))).'/mainfile.php';
9 9
 error_reporting(0);
10 10
 $xoopsLogger->activated = false;
11 11
 
12
-if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/^' . preg_quote(XOOPS_URL, '/') . '/', $_SERVER['HTTP_REFERER'])) {
12
+if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/^'.preg_quote(XOOPS_URL, '/').'/', $_SERVER['HTTP_REFERER'])) {
13 13
     exit();
14 14
 }
15 15
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
         if ($this->mode === 'bmp') {
80 80
             $this->config['num_chars'] = 4;
81
-            $this->code                = mt_rand(pow(10, $this->config['num_chars'] - 1), (int)str_pad('9', $this->config['num_chars'], '9'));
81
+            $this->code                = mt_rand(pow(10, $this->config['num_chars'] - 1), (int) str_pad('9', $this->config['num_chars'], '9'));
82 82
         } else {
83 83
             $this->code = substr(md5(uniqid(mt_rand(), 1)), 0, $this->config['num_chars']);
84 84
             if (!$this->config['casesensitive']) {
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
             return;
94 94
         }
95 95
 
96
-        $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code;
97
-        $maxAttempts                          = (int)(@$_SESSION['XoopsCaptcha_maxattempts']);
96
+        $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code;
97
+        $maxAttempts                          = (int) (@$_SESSION['XoopsCaptcha_maxattempts']);
98 98
 
99 99
         // Increase the attempt records on refresh
100 100
         if (!empty($maxAttempts)) {
101
-            $_SESSION['XoopsCaptcha_attempt_' . $_SESSION['XoopsCaptcha_name']]++;
102
-            if ($_SESSION['XoopsCaptcha_attempt_' . $_SESSION['XoopsCaptcha_name']] > $maxAttempts) {
101
+            $_SESSION['XoopsCaptcha_attempt_'.$_SESSION['XoopsCaptcha_name']]++;
102
+            if ($_SESSION['XoopsCaptcha_attempt_'.$_SESSION['XoopsCaptcha_name']] > $maxAttempts) {
103 103
                 $this->invalid = true;
104 104
             }
105 105
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         if ($this->invalid) {
115 115
             header('Content-type: image/gif');
116
-            readfile(XOOPS_ROOT_PATH . '/images/subject/icon2.gif');
116
+            readfile(XOOPS_ROOT_PATH.'/images/subject/icon2.gif');
117 117
 
118 118
             return;
119 119
         }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             header('Content-type: image/jpeg');
184 184
             imagejpeg($this->oImage);
185 185
         } else {
186
-            imagejpeg($this->oImage, XOOPS_ROOT_PATH . '/' . $this->config['imagepath'] . '/' . $file . '.jpg');
186
+            imagejpeg($this->oImage, XOOPS_ROOT_PATH.'/'.$this->config['imagepath'].'/'.$file.'.jpg');
187 187
         }
188 188
         imagedestroy($this->oImage);
189 189
     }
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
          }
205 205
          }
206 206
          */
207
-        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
208
-        $file_path = $this->config['rootpath'] . "/{$name}";
207
+        require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
208
+        $file_path = $this->config['rootpath']."/{$name}";
209 209
         $files     = XoopsLists::getFileListAsArray($file_path);
210 210
         foreach ($files as $item) {
211 211
             if (empty($extension) || preg_match("/(\.{$extension})$/i", $item)) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     public function loadFont()
223 223
     {
224 224
         $fonts      = $this->_getList('fonts', 'ttf');
225
-        $this->font = $this->config['rootpath'] . '/fonts/' . $fonts[array_rand($fonts)];
225
+        $this->font = $this->config['rootpath'].'/fonts/'.$fonts[array_rand($fonts)];
226 226
     }
227 227
 
228 228
     public function setImageSize()
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         imagedestroy($oImage);
249 249
 
250 250
         $this->height  = $MaxCharHeight + 2;
251
-        $this->spacing = (int)(($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']);
251
+        $this->spacing = (int) (($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']);
252 252
         $this->width   = ($this->config['num_chars'] * $MaxCharWidth) + ($this->spacing / 2);
253 253
     }
254 254
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     {
262 262
         $RandBackground = null;
263 263
         if ($backgrounds = $this->_getList('backgrounds', '(gif|jpg|png)')) {
264
-            $RandBackground = $this->config['rootpath'] . '/backgrounds/' . $backgrounds[array_rand($backgrounds)];
264
+            $RandBackground = $this->config['rootpath'].'/backgrounds/'.$backgrounds[array_rand($backgrounds)];
265 265
         }
266 266
 
267 267
         return $RandBackground;
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     }
432 432
 }
433 433
 
434
-$config       = @include dirname(__DIR__) . '/config.php';
434
+$config       = @include dirname(__DIR__).'/config.php';
435 435
 $imageHandler = new XoopsCaptchaImageHandler();
436 436
 $imageHandler->setConfig($config);
437 437
 $imageHandler->loadImage();
Please login to merge, or discard this patch.
include/captcha/formcaptcha.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
15 15
 
16
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
16
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
17 17
 
18 18
 /*
19 19
  * Usage
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function __construct($caption = '', $name = 'xoopscaptcha', $skipmember = null, $numchar = null, $minfontsize = null, $maxfontsize = null, $backgroundtype = null, $backgroundnum = null)
55 55
     {
56 56
         if (!class_exists('XoopsCaptcaha')) {
57
-            require_once SMARTOBJECT_ROOT_PATH . '/include/captcha/captcha.php';
57
+            require_once SMARTOBJECT_ROOT_PATH.'/include/captcha/captcha.php';
58 58
         }
59 59
 
60 60
         $this->_captchaHandler = XoopsCaptcha::getInstance();
Please login to merge, or discard this patch.
include/captcha/captcha.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 class XoopsCaptcha
15 15
 {
16 16
     public $active = true;
17
-    public $mode   = 'text';    // potential values: image, text
17
+    public $mode   = 'text'; // potential values: image, text
18 18
     public $config = array();
19 19
 
20 20
     public $message = array(); // Logging error messages
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function __construct()
26 26
     {
27 27
         // Loading default preferences
28
-        $this->config = @include __DIR__ . '/config.php';
28
+        $this->config = @include __DIR__.'/config.php';
29 29
 
30 30
         $this->setMode($this->config['mode']);
31 31
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $sessionName = @$_SESSION['XoopsCaptcha_name'];
129 129
         $skipMember  = ($skipMember === null) ? @$_SESSION['XoopsCaptcha_skipmember'] : $skipMember;
130
-        $maxAttempts = (int)(@$_SESSION['XoopsCaptcha_maxattempts']);
130
+        $maxAttempts = (int) (@$_SESSION['XoopsCaptcha_maxattempts']);
131 131
 
132 132
         $is_valid = false;
133 133
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         if (is_object($GLOBALS['xoopsUser']) && !empty($skipMember)) {
136 136
             $is_valid = true;
137 137
             // Kill too many attempts
138
-        } elseif (!empty($maxAttempts) && $_SESSION['XoopsCaptcha_attempt_' . $sessionName] > $maxAttempts) {
138
+        } elseif (!empty($maxAttempts) && $_SESSION['XoopsCaptcha_attempt_'.$sessionName] > $maxAttempts) {
139 139
             $this->message[] = XOOPS_CAPTCHA_TOOMANYATTEMPTS;
140 140
 
141 141
             // Verify the code
@@ -147,13 +147,13 @@  discard block
 block discarded – undo
147 147
         if (!empty($maxAttempts)) {
148 148
             if (!$is_valid) {
149 149
                 // Increase the attempt records on failure
150
-                $_SESSION['XoopsCaptcha_attempt_' . $sessionName]++;
150
+                $_SESSION['XoopsCaptcha_attempt_'.$sessionName]++;
151 151
                 // Log the error message
152 152
                 $this->message[] = XOOPS_CAPTCHA_INVALID_CODE;
153 153
             } else {
154 154
 
155 155
                 // reset attempt records on success
156
-                $_SESSION['XoopsCaptcha_attempt_' . $sessionName] = null;
156
+                $_SESSION['XoopsCaptcha_attempt_'.$sessionName] = null;
157 157
             }
158 158
         }
159 159
         $this->destroyGarbage(true);
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function destroyGarbage($clearSession = false)
186 186
     {
187
-        require_once __DIR__ . '/' . $this->mode . '.php';
188
-        $class          = 'XoopsCaptcha' . ucfirst($this->mode);
187
+        require_once __DIR__.'/'.$this->mode.'.php';
188
+        $class          = 'XoopsCaptcha'.ucfirst($this->mode);
189 189
         $captchaHandler = new $class();
190 190
         if (method_exists($captchaHandler, 'destroyGarbage')) {
191 191
             $captchaHandler->loadConfig($this->config);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
          */
225 225
 
226 226
         // Fail on too many attempts
227
-        if (!empty($maxAttempts) && @$_SESSION['XoopsCaptcha_attempt_' . $this->config['name']] > $maxAttempts) {
227
+        if (!empty($maxAttempts) && @$_SESSION['XoopsCaptcha_attempt_'.$this->config['name']] > $maxAttempts) {
228 228
             $form = XOOPS_CAPTCHA_TOOMANYATTEMPTS;
229 229
             // Load the form element
230 230
         } else {
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
      */
240 240
     public function loadForm()
241 241
     {
242
-        require_once __DIR__ . '/' . $this->mode . '.php';
243
-        $class          = 'XoopsCaptcha' . ucfirst($this->mode);
242
+        require_once __DIR__.'/'.$this->mode.'.php';
243
+        $class          = 'XoopsCaptcha'.ucfirst($this->mode);
244 244
         $captchaHandler = new $class();
245 245
         $captchaHandler->loadConfig($this->config);
246 246
 
Please login to merge, or discard this patch.
include/captcha/image.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -45,19 +45,19 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function render()
47 47
     {
48
-        $form = "<input type='text' name='" .
49
-                $this->config['name'] .
50
-                "' id='" .
51
-                $this->config['name'] .
52
-                "' size='" .
53
-                $this->config['num_chars'] .
54
-                "' maxlength='" .
55
-                $this->config['num_chars'] .
56
-                "' value='' /> &nbsp; " .
48
+        $form = "<input type='text' name='".
49
+                $this->config['name'].
50
+                "' id='".
51
+                $this->config['name'].
52
+                "' size='".
53
+                $this->config['num_chars'].
54
+                "' maxlength='".
55
+                $this->config['num_chars'].
56
+                "' value='' /> &nbsp; ".
57 57
                 $this->loadImage();
58 58
         $rule = htmlspecialchars(XOOPS_CAPTCHA_REFRESH, ENT_QUOTES);
59 59
         if ($this->config['maxattempt']) {
60
-            $rule .= ' | ' . sprintf(constant('XOOPS_CAPTCHA_MAXATTEMPTS'), $this->config['maxattempt']);
60
+            $rule .= ' | '.sprintf(constant('XOOPS_CAPTCHA_MAXATTEMPTS'), $this->config['maxattempt']);
61 61
         }
62 62
         $form .= "&nbsp;&nbsp;<small>{$rule}</small>";
63 63
 
@@ -70,17 +70,17 @@  discard block
 block discarded – undo
70 70
     public function loadImage()
71 71
     {
72 72
         $rule = $this->config['casesensitive'] ? constant('XOOPS_CAPTCHA_RULE_CASESENSITIVE') : constant('XOOPS_CAPTCHA_RULE_CASEINSENSITIVE');
73
-        $ret  = "<img id='captcha' src='" .
74
-                XOOPS_URL .
75
-                '/' .
76
-                $this->config['imageurl'] .
77
-                "' onclick=\"this.src='" .
78
-                XOOPS_URL .
79
-                '/' .
80
-                $this->config['imageurl'] .
81
-                "?refresh='+Math.random()" .
82
-                "\" align='absmiddle'  style='cursor: pointer;' alt='" .
83
-                htmlspecialchars($rule, ENT_QUOTES) .
73
+        $ret  = "<img id='captcha' src='".
74
+                XOOPS_URL.
75
+                '/'.
76
+                $this->config['imageurl'].
77
+                "' onclick=\"this.src='".
78
+                XOOPS_URL.
79
+                '/'.
80
+                $this->config['imageurl'].
81
+                "?refresh='+Math.random()".
82
+                "\" align='absmiddle'  style='cursor: pointer;' alt='".
83
+                htmlspecialchars($rule, ENT_QUOTES).
84 84
                 "' />";
85 85
 
86 86
         return $ret;
Please login to merge, or discard this patch.