Completed
Push — master ( 01b1a5...81f493 )
by Michael
04:03
created
class/smartobject.php 2 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     }
166 166
 
167 167
     /**
168
-     * @param        $key
168
+     * @param        string $key
169 169
      * @param        $data_type
170 170
      * @param bool   $itemName
171 171
      * @param string $form_caption
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      * @param bool   $required     set to TRUE if this variable needs to have a value set before storing the object in the table
194 194
      * @param string $form_caption caption of this variable in a {@link SmartobjectForm} and title of a column in a  {@link SmartObjectTable}
195 195
      * @param string $form_dsc     description of this variable in a {@link SmartobjectForm}
196
-     * @param mixed  $value        default value of this variable
196
+     * @param string|false  $value        default value of this variable
197 197
      */
198 198
     public function quickInitVar($key, $data_type, $required = false, $form_caption = '', $form_dsc = '', $value = null)
199 199
     {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     }
203 203
 
204 204
     /**
205
-     * @param        $varname
205
+     * @param        string $varname
206 206
      * @param bool   $displayOnForm
207 207
      * @param string $default
208 208
      */
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
     /**
459 459
      * add an error
460 460
      *
461
-     * @param      $err_str
461
+     * @param      string $err_str
462 462
      * @param bool $prefix
463 463
      * @internal param string $value error to add
464 464
      * @access   public
@@ -720,8 +720,8 @@  discard block
 block discarded – undo
720 720
 
721 721
     /**
722 722
      * @param $key
723
-     * @param $info
724
-     * @param $value
723
+     * @param string $info
724
+     * @param boolean $value
725 725
      */
726 726
     public function setVarInfo($key, $info, $value)
727 727
     {
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
     }
730 730
 
731 731
     /**
732
-     * @param         $key
732
+     * @param         string $key
733 733
      * @param  bool   $editor
734 734
      * @return string
735 735
      */
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
      * @access public
907 907
      * @param  string $key    key of the object's variable to be returned
908 908
      * @param  string $format format to use for the output
909
-     * @return mixed  formatted value of the variable
909
+     * @return string  formatted value of the variable
910 910
      */
911 911
     public function getVar($key, $format = 's')
912 912
     {
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
     }
1210 1210
 
1211 1211
     /**
1212
-     * @param $key
1212
+     * @param string $key
1213 1213
      */
1214 1214
     public function hideFieldFromForm($key)
1215 1215
     {
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
14 14
 
15
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
15
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
16 16
 
17
-include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php';
17
+include_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php';
18 18
 
19 19
 if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) {
20 20
     define('XOBJ_DTYPE_SIMPLE_ARRAY', 101);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function closeSection($section_name)
115 115
     {
116
-        $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
116
+        $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
117 117
     }
118 118
 
119 119
     /**
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
         }
141 141
         parent::initVar($key, $data_type, $value, $required, $maxlength, $options);
142 142
         if ($this->handler && (!$form_caption || $form_caption === '')) {
143
-            $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key);
143
+            $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key);
144 144
             if (defined($dyn_form_caption)) {
145 145
                 $form_caption = constant($dyn_form_caption);
146 146
             }
147 147
         }
148 148
         if ($this->handler && (!$form_dsc || $form_dsc === '')) {
149
-            $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC');
149
+            $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC');
150 150
             if (defined($dyn_form_dsc)) {
151 151
                 $form_dsc = constant($dyn_form_dsc);
152 152
             }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      */
411 411
     public function getForm($form_caption, $form_name, $form_action = false, $submit_button_caption = _CO_SOBJECT_SUBMIT, $cancel_js_action = false, $captcha = false)
412 412
     {
413
-        include_once SMARTOBJECT_ROOT_PATH . 'class/form/smartobjectform.php';
413
+        include_once SMARTOBJECT_ROOT_PATH.'class/form/smartobjectform.php';
414 414
         $form = new SmartobjectForm($this, $form_name, $form_caption, $form_action, null, $submit_button_caption, $cancel_js_action, $captcha);
415 415
 
416 416
         return $form;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     public function toArray()
423 423
     {
424 424
         $ret  = array();
425
-        $vars =& $this->getVars();
425
+        $vars = & $this->getVars();
426 426
         foreach ($vars as $key => $var) {
427 427
             $value     = $this->getVar($key);
428 428
             $ret[$key] = $value;
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
         }
441 441
 
442 442
         // Hightlighting searched words
443
-        include_once(SMARTOBJECT_ROOT_PATH . 'class/smarthighlighter.php');
443
+        include_once(SMARTOBJECT_ROOT_PATH.'class/smarthighlighter.php');
444 444
         $highlight = smart_getConfig('module_search_highlighter', false, true);
445 445
 
446 446
         if ($highlight && isset($_GET['keywords'])) {
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
             }
472 472
         } else {
473 473
             if ($prefix) {
474
-                $err_str = '[' . $prefix . '] ' . $err_str;
474
+                $err_str = '['.$prefix.'] '.$err_str;
475 475
             }
476 476
             parent::setErrors($err_str);
477 477
         }
@@ -798,8 +798,8 @@  discard block
 block discarded – undo
798 798
                             $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
799 799
                             continue 2;
800 800
                         }
801
-                        if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) {
802
-                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength']));
801
+                        if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) {
802
+                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength']));
803 803
                             continue 2;
804 804
                         }
805 805
                         if (!$v['not_gpc']) {
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
                         break;
829 829
                     case XOBJ_DTYPE_INT:
830 830
                     case XOBJ_DTYPE_TIME_ONLY:
831
-                        $cleanv = (int)$cleanv;
831
+                        $cleanv = (int) $cleanv;
832 832
                         break;
833 833
 
834 834
                     case XOBJ_DTYPE_CURRENCY:
@@ -858,10 +858,10 @@  discard block
 block discarded – undo
858 858
                             continue 2;
859 859
                         }
860 860
                         if ($cleanv !== '' && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
861
-                            $cleanv = 'http://' . $cleanv;
861
+                            $cleanv = 'http://'.$cleanv;
862 862
                         }
863 863
                         if (!$v['not_gpc']) {
864
-                            $cleanv =& $ts->stripSlashesGPC($cleanv);
864
+                            $cleanv = & $ts->stripSlashesGPC($cleanv);
865 865
                         }
866 866
                         break;
867 867
                     case XOBJ_DTYPE_SIMPLE_ARRAY:
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
                     case XOBJ_DTYPE_STIME:
874 874
                     case XOBJ_DTYPE_MTIME:
875 875
                     case XOBJ_DTYPE_LTIME:
876
-                        $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv);
876
+                        $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv);
877 877
                         if (!($cleanv > 0)) {
878 878
                             $cleanv = strtotime($cleanv);
879 879
                         }
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
                         break;
883 883
                 }
884 884
             }
885
-            $this->cleanVars[$k] =& $cleanv;
885
+            $this->cleanVars[$k] = & $cleanv;
886 886
             unset($cleanv);
887 887
         }
888 888
         if (count($this->_errors) > 0) {
@@ -1100,10 +1100,10 @@  discard block
 block discarded – undo
1100 1100
                 }
1101 1101
                 break;
1102 1102
             case XOBJ_DTYPE_SIMPLE_ARRAY:
1103
-                $ret =& explode('|', $ret);
1103
+                $ret = & explode('|', $ret);
1104 1104
                 break;
1105 1105
             case XOBJ_DTYPE_ARRAY:
1106
-                $ret =& unserialize($ret);
1106
+                $ret = & unserialize($ret);
1107 1107
                 break;
1108 1108
             case XOBJ_DTYPE_SOURCE:
1109 1109
                 switch (strtolower($format)) {
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
      */
1258 1258
     public function displaySingleObject($fetchOnly = false, $userSide = false, $actions = array(), $headerAsRow = true)
1259 1259
     {
1260
-        include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectsingleview.php';
1260
+        include_once SMARTOBJECT_ROOT_PATH.'class/smartobjectsingleview.php';
1261 1261
         $singleview = new SmartObjectSingleView($this, $userSide, $actions, $headerAsRow);
1262 1262
         // add all fields mark as displayOnSingleView except the keyid
1263 1263
         foreach ($this->vars as $key => $var) {
Please login to merge, or discard this patch.
class/smartobjectcontroller.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
 
124 124
     /**
125 125
      * @param        $smartObj
126
-     * @param        $objectid
127
-     * @param        $created_success_msg
128
-     * @param        $modified_success_msg
126
+     * @param        integer $objectid
127
+     * @param        string $created_success_msg
128
+     * @param        string $modified_success_msg
129 129
      * @param  bool  $redirect_page
130 130
      * @param  bool  $debug
131 131
      * @return mixed
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @param  bool   $confirm_msg
290 290
      * @param  string $op
291 291
      * @param  bool   $userSide
292
-     * @return bool
292
+     * @return boolean|null
293 293
      * @internal param string $redir_page redirect page after deleting the object
294 294
      */
295 295
     public function handleObjectDeletion($confirm_msg = false, $op = 'del', $userSide = false)
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     }
444 444
 
445 445
     /**
446
-     * @param         $smartObj
446
+     * @param         SmartMlObject $smartObj
447 447
      * @param  bool   $onlyUrl
448 448
      * @param  bool   $withimage
449 449
      * @return string
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
     }
534 534
 
535 535
     /**
536
-     * @param $smartObj
536
+     * @param SmartObject $smartObj
537 537
      * @return string
538 538
      */
539 539
     public function getPrintAndMailLink($smartObj)
Please login to merge, or discard this patch.
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @credit  Jan Keller Pedersen <[email protected]> - IDG Danmark A/S <www.idg.dk>
24 24
  * @link    http://smartfactory.ca The SmartFactory
25 25
  */
26
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php';
27
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjecthandler.php';
26
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php';
27
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjecthandler.php';
28 28
 
29 29
 /**
30 30
  * Class SmartObjectController
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
         foreach (array_keys($smartObj->vars) as $key) {
51 51
             switch ($smartObj->vars[$key]['data_type']) {
52 52
                 case XOBJ_DTYPE_IMAGE:
53
-                    if (isset($_POST['url_' . $key]) && $_POST['url_' . $key] !== '') {
54
-                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
55
-                        $smartObj->setVar($key, $_POST['url_' . $key]);
53
+                    if (isset($_POST['url_'.$key]) && $_POST['url_'.$key] !== '') {
54
+                        $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e');
55
+                        $smartObj->setVar($key, $_POST['url_'.$key]);
56 56
                         if (file_exists($oldFile)) {
57 57
                             unlink($oldFile);
58 58
                         }
59 59
                     }
60
-                    if (isset($_POST['delete_' . $key]) && $_POST['delete_' . $key] == '1') {
61
-                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
60
+                    if (isset($_POST['delete_'.$key]) && $_POST['delete_'.$key] == '1') {
61
+                        $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e');
62 62
                         $smartObj->setVar($key, '');
63 63
                         if (file_exists($oldFile)) {
64 64
                             unlink($oldFile);
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 
69 69
                 case XOBJ_DTYPE_URLLINK:
70 70
                     $linkObj = $smartObj->getUrlLinkObj($key);
71
-                    $linkObj->setVar('caption', $_POST['caption_' . $key]);
72
-                    $linkObj->setVar('description', $_POST['desc_' . $key]);
73
-                    $linkObj->setVar('target', $_POST['target_' . $key]);
74
-                    $linkObj->setVar('url', $_POST['url_' . $key]);
71
+                    $linkObj->setVar('caption', $_POST['caption_'.$key]);
72
+                    $linkObj->setVar('description', $_POST['desc_'.$key]);
73
+                    $linkObj->setVar('target', $_POST['target_'.$key]);
74
+                    $linkObj->setVar('url', $_POST['url_'.$key]);
75 75
                     if ($linkObj->getVar('url') !== '') {
76 76
                         $smartObj->storeUrlLinkObj($linkObj);
77 77
                     }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
                     break;
81 81
 
82 82
                 case XOBJ_DTYPE_FILE:
83
-                    if (!isset($_FILES['upload_' . $key]['name']) || $_FILES['upload_' . $key]['name'] === '') {
83
+                    if (!isset($_FILES['upload_'.$key]['name']) || $_FILES['upload_'.$key]['name'] === '') {
84 84
                         $fileObj = $smartObj->getFileObj($key);
85
-                        $fileObj->setVar('caption', $_POST['caption_' . $key]);
86
-                        $fileObj->setVar('description', $_POST['desc_' . $key]);
87
-                        $fileObj->setVar('url', $_POST['url_' . $key]);
85
+                        $fileObj->setVar('caption', $_POST['caption_'.$key]);
86
+                        $fileObj->setVar('description', $_POST['desc_'.$key]);
87
+                        $fileObj->setVar('url', $_POST['url_'.$key]);
88 88
                         if (!($fileObj->getVar('url') === '' && $fileObj->getVar('url') === '' && $fileObj->getVar('url') === '')) {
89 89
                             $res = $smartObj->storeFileObj($fileObj);
90 90
                             if ($res) {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                         $value = strtotime($_POST[$key]);
108 108
                         //if strtotime returns false, the value is already a time stamp
109 109
                         if (!$value) {
110
-                            $value = (int)$_POST[$key];
110
+                            $value = (int) $_POST[$key];
111 111
                         }
112 112
                     }
113 113
                     $smartObj->setVar($key, $value);
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
 
145 145
         // Check if there were uploaded files
146 146
         if (isset($_POST['smart_upload_image']) || isset($_POST['smart_upload_file'])) {
147
-            include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartuploader.php';
147
+            include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartuploader.php';
148 148
             $uploaderObj = new SmartUploader($smartObj->getImageDir(true), $this->handler->_allowedMimeTypes, $this->handler->_maxFileSize, $this->handler->_maxWidth, $this->handler->_maxHeight);
149 149
             foreach ($_FILES as $name => $file_array) {
150 150
                 if (isset($file_array['name']) && $file_array['name'] !== '' && in_array(str_replace('upload_', '', $name), array_keys($smartObj->vars))) {
151 151
                     if ($uploaderObj->fetchMedia($name)) {
152
-                        $uploaderObj->setTargetFileName(time() . '_' . $uploaderObj->getMediaName());
152
+                        $uploaderObj->setTargetFileName(time().'_'.$uploaderObj->getMediaName());
153 153
                         if ($uploaderObj->upload()) {
154 154
                             // Find the related field in the SmartObject
155 155
                             $related_field   = str_replace('upload_', '', $name);
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
                             if ($smartObj->vars[$related_field]['data_type'] === XOBJ_DTYPE_FILE) {
159 159
                                 $object_fileurl = $smartObj->getUploadDir();
160 160
                                 $fileObj        = $smartObj->getFileObj($related_field);
161
-                                $fileObj->setVar('url', $object_fileurl . $uploaderObj->getSavedFileName());
162
-                                $fileObj->setVar('caption', $_POST['caption_' . $related_field]);
163
-                                $fileObj->setVar('description', $_POST['desc_' . $related_field]);
161
+                                $fileObj->setVar('url', $object_fileurl.$uploaderObj->getSavedFileName());
162
+                                $fileObj->setVar('caption', $_POST['caption_'.$related_field]);
163
+                                $fileObj->setVar('description', $_POST['desc_'.$related_field]);
164 164
                                 $smartObj->storeFileObj($fileObj);
165 165
                                 //todo: catch errors
166 166
                                 $smartObj->setVar($related_field, $fileObj->getVar('fileid'));
167 167
                             } else {
168
-                                $old_file = $smartObj->getUploadDir(true) . $smartObj->getVar($related_field);
168
+                                $old_file = $smartObj->getUploadDir(true).$smartObj->getVar($related_field);
169 169
                                 unlink($old_file);
170 170
                                 $smartObj->setVar($related_field, $uploaderObj->getSavedFileName());
171 171
                             }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             return $smartObj;
197 197
         } else {
198 198
             if (!$storeResult) {
199
-                redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $smartObj->getHtmlErrors());
199
+                redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$smartObj->getHtmlErrors());
200 200
             }
201 201
 
202 202
             $redirect_page = $redirect_page ?: smart_get_page_before_form();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      */
221 221
     public function storeFromDefaultForm($created_success_msg, $modified_success_msg, $redirect_page = false, $debug = false, $x_param = false)
222 222
     {
223
-        $objectid = isset($_POST[$this->handler->keyName]) ? (int)$_POST[$this->handler->keyName] : 0;
223
+        $objectid = isset($_POST[$this->handler->keyName]) ? (int) $_POST[$this->handler->keyName] : 0;
224 224
         if ($debug) {
225 225
             if ($x_param) {
226 226
                 $smartObj = $this->handler->getD($objectid, true, $x_param);
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     {
297 297
         global $smart_previous_page;
298 298
 
299
-        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0;
299
+        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0;
300 300
         $smartObj = $this->handler->get($objectid);
301 301
 
302 302
         if ($smartObj->isNew()) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
307 307
         if ($confirm) {
308 308
             if (!$this->handler->delete($smartObj)) {
309
-                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors());
309
+                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors());
310 310
                 exit;
311 311
             }
312 312
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     {
337 337
         global $smart_previous_page, $xoopsTpl;
338 338
 
339
-        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0;
339
+        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0;
340 340
         $smartObj = $this->handler->get($objectid);
341 341
 
342 342
         if ($smartObj->isNew()) {
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
347 347
         if ($confirm) {
348 348
             if (!$this->handler->delete($smartObj)) {
349
-                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors());
349
+                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors());
350 350
                 exit;
351 351
             }
352 352
 
@@ -375,22 +375,22 @@  discard block
 block discarded – undo
375 375
      */
376 376
     public function getAdminViewItemLink(SmartObject $smartObj, $onlyUrl = false, $withimage = false)
377 377
     {
378
-        $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=view&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
378
+        $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=view&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
379 379
         if ($onlyUrl) {
380 380
             return $ret;
381 381
         } elseif ($withimage) {
382
-            return "<a href='" .
383
-                   $ret .
384
-                   "'><img src='" .
385
-                   SMARTOBJECT_IMAGES_ACTIONS_URL .
386
-                   "viewmag.png' style='vertical-align: middle;' alt='" .
387
-                   _CO_SOBJECT_ADMIN_VIEW .
388
-                   "'  title='" .
389
-                   _CO_SOBJECT_ADMIN_VIEW .
382
+            return "<a href='".
383
+                   $ret.
384
+                   "'><img src='".
385
+                   SMARTOBJECT_IMAGES_ACTIONS_URL.
386
+                   "viewmag.png' style='vertical-align: middle;' alt='".
387
+                   _CO_SOBJECT_ADMIN_VIEW.
388
+                   "'  title='".
389
+                   _CO_SOBJECT_ADMIN_VIEW.
390 390
                    "'/></a>";
391 391
         }
392 392
 
393
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
393
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
394 394
     }
395 395
 
396 396
     /**
@@ -412,31 +412,31 @@  discard block
 block discarded – undo
412 412
         $seoIncludeId = true;
413 413
 
414 414
         if ($seoMode === 'rewrite') {
415
-            $ret = XOOPS_URL .
416
-                   '/' .
417
-                   $seoModuleName .
418
-                   '.' .
419
-                   $this->handler->_itemname .
420
-                   ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') .
421
-                   '/' .
422
-                   $smartObj->getVar('short_url') .
415
+            $ret = XOOPS_URL.
416
+                   '/'.
417
+                   $seoModuleName.
418
+                   '.'.
419
+                   $this->handler->_itemname.
420
+                   ($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').
421
+                   '/'.
422
+                   $smartObj->getVar('short_url').
423 423
                    '.html';
424 424
         } elseif ($seoMode === 'pathinfo') {
425
-            $ret = SMARTOBJECT_URL .
426
-                   'seo.php/' .
427
-                   $seoModuleName .
428
-                   '.' .
429
-                   $this->handler->_itemname .
430
-                   ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') .
431
-                   '/' .
432
-                   $smartObj->getVar('short_url') .
425
+            $ret = SMARTOBJECT_URL.
426
+                   'seo.php/'.
427
+                   $seoModuleName.
428
+                   '.'.
429
+                   $this->handler->_itemname.
430
+                   ($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').
431
+                   '/'.
432
+                   $smartObj->getVar('short_url').
433 433
                    '.html';
434 434
         } else {
435
-            $ret = $this->handler->_moduleUrl . $this->handler->_page . '?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
435
+            $ret = $this->handler->_moduleUrl.$this->handler->_page.'?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
436 436
         }
437 437
 
438 438
         if (!$onlyUrl) {
439
-            $ret = "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
439
+            $ret = "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
440 440
         }
441 441
 
442 442
         return $ret;
@@ -450,30 +450,30 @@  discard block
 block discarded – undo
450 450
      */
451 451
     public function getEditLanguageLink($smartObj, $onlyUrl = false, $withimage = true)
452 452
     {
453
-        $ret = $this->handler->_moduleUrl .
454
-               'admin/' .
455
-               $this->handler->_page .
456
-               '?op=mod&' .
457
-               $this->handler->keyName .
458
-               '=' .
459
-               $smartObj->getVar($this->handler->keyName) .
460
-               '&language=' .
453
+        $ret = $this->handler->_moduleUrl.
454
+               'admin/'.
455
+               $this->handler->_page.
456
+               '?op=mod&'.
457
+               $this->handler->keyName.
458
+               '='.
459
+               $smartObj->getVar($this->handler->keyName).
460
+               '&language='.
461 461
                $smartObj->getVar('language');
462 462
         if ($onlyUrl) {
463 463
             return $ret;
464 464
         } elseif ($withimage) {
465
-            return "<a href='" .
466
-                   $ret .
467
-                   "'><img src='" .
468
-                   SMARTOBJECT_IMAGES_ACTIONS_URL .
469
-                   "wizard.png' style='vertical-align: middle;' alt='" .
470
-                   _CO_SOBJECT_LANGUAGE_MODIFY .
471
-                   "'  title='" .
472
-                   _CO_SOBJECT_LANGUAGE_MODIFY .
465
+            return "<a href='".
466
+                   $ret.
467
+                   "'><img src='".
468
+                   SMARTOBJECT_IMAGES_ACTIONS_URL.
469
+                   "wizard.png' style='vertical-align: middle;' alt='".
470
+                   _CO_SOBJECT_LANGUAGE_MODIFY.
471
+                   "'  title='".
472
+                   _CO_SOBJECT_LANGUAGE_MODIFY.
473 473
                    "'/></a>";
474 474
         }
475 475
 
476
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
476
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
477 477
     }
478 478
 
479 479
     /**
@@ -486,22 +486,22 @@  discard block
 block discarded – undo
486 486
     public function getEditItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false)
487 487
     {
488 488
         $admin_side = $userSide ? '' : 'admin/';
489
-        $ret        = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
489
+        $ret        = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
490 490
         if ($onlyUrl) {
491 491
             return $ret;
492 492
         } elseif ($withimage) {
493
-            return "<a href='" .
494
-                   $ret .
495
-                   "'><img src='" .
496
-                   SMARTOBJECT_IMAGES_ACTIONS_URL .
497
-                   "edit.png' style='vertical-align: middle;' alt='" .
498
-                   _CO_SOBJECT_MODIFY .
499
-                   "'  title='" .
500
-                   _CO_SOBJECT_MODIFY .
493
+            return "<a href='".
494
+                   $ret.
495
+                   "'><img src='".
496
+                   SMARTOBJECT_IMAGES_ACTIONS_URL.
497
+                   "edit.png' style='vertical-align: middle;' alt='".
498
+                   _CO_SOBJECT_MODIFY.
499
+                   "'  title='".
500
+                   _CO_SOBJECT_MODIFY.
501 501
                    "'/></a>";
502 502
         }
503 503
 
504
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
504
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
505 505
     }
506 506
 
507 507
     /**
@@ -514,22 +514,22 @@  discard block
 block discarded – undo
514 514
     public function getDeleteItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false)
515 515
     {
516 516
         $admin_side = $userSide ? '' : 'admin/';
517
-        $ret        = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=del&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
517
+        $ret        = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=del&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
518 518
         if ($onlyUrl) {
519 519
             return $ret;
520 520
         } elseif ($withimage) {
521
-            return "<a href='" .
522
-                   $ret .
523
-                   "'><img src='" .
524
-                   SMARTOBJECT_IMAGES_ACTIONS_URL .
525
-                   "editdelete.png' style='vertical-align: middle;' alt='" .
526
-                   _CO_SOBJECT_DELETE .
527
-                   "'  title='" .
528
-                   _CO_SOBJECT_DELETE .
521
+            return "<a href='".
522
+                   $ret.
523
+                   "'><img src='".
524
+                   SMARTOBJECT_IMAGES_ACTIONS_URL.
525
+                   "editdelete.png' style='vertical-align: middle;' alt='".
526
+                   _CO_SOBJECT_DELETE.
527
+                   "'  title='".
528
+                   _CO_SOBJECT_DELETE.
529 529
                    "'/></a>";
530 530
         }
531 531
 
532
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
532
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
533 533
     }
534 534
 
535 535
     /**
@@ -540,28 +540,28 @@  discard block
 block discarded – undo
540 540
     {
541 541
         global $xoopsConfig;
542 542
 
543
-        $printlink = $this->handler->_moduleUrl . 'print.php?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
544
-        $js        = "javascript:openWithSelfMain('" . $printlink . "', 'smartpopup', 700, 519);";
545
-        $printlink = '<a href="' . $js . '"><img  src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'fileprint.png" alt="" style="vertical-align: middle;"/></a>';
543
+        $printlink = $this->handler->_moduleUrl.'print.php?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
544
+        $js        = "javascript:openWithSelfMain('".$printlink."', 'smartpopup', 700, 519);";
545
+        $printlink = '<a href="'.$js.'"><img  src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'fileprint.png" alt="" style="vertical-align: middle;"/></a>';
546 546
 
547 547
         $smartModule = smart_getModuleInfo($smartObj->handler->_moduleName);
548 548
         $link        = smart_getCurrentPage();
549 549
         $mid         = $smartModule->getVar('mid');
550
-        $friendlink  = "<a href=\"javascript:openWithSelfMain('" .
551
-                       SMARTOBJECT_URL .
552
-                       'sendlink.php?link=' .
553
-                       $link .
554
-                       '&amp;mid=' .
555
-                       $mid .
556
-                       "', ',',',',',','sendmessage', 674, 500);\"><img src=\"" .
557
-                       SMARTOBJECT_IMAGES_ACTIONS_URL .
558
-                       "mail_send.png\"  alt=\"" .
559
-                       _CO_SOBJECT_EMAIL .
560
-                       "\" title=\"" .
561
-                       _CO_SOBJECT_EMAIL .
550
+        $friendlink  = "<a href=\"javascript:openWithSelfMain('".
551
+                       SMARTOBJECT_URL.
552
+                       'sendlink.php?link='.
553
+                       $link.
554
+                       '&amp;mid='.
555
+                       $mid.
556
+                       "', ',',',',',','sendmessage', 674, 500);\"><img src=\"".
557
+                       SMARTOBJECT_IMAGES_ACTIONS_URL.
558
+                       "mail_send.png\"  alt=\"".
559
+                       _CO_SOBJECT_EMAIL.
560
+                       "\" title=\"".
561
+                       _CO_SOBJECT_EMAIL.
562 562
                        "\" style=\"vertical-align: middle;\"/></a>";
563 563
 
564
-        $ret = '<span id="smartobject_print_button">' . $printlink . '&nbsp;</span>' . '<span id="smartobject_mail_button">' . $friendlink . '</span>';
564
+        $ret = '<span id="smartobject_print_button">'.$printlink.'&nbsp;</span>'.'<span id="smartobject_mail_button">'.$friendlink.'</span>';
565 565
 
566 566
         return $ret;
567 567
     }
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
      */
572 572
     public function getModuleItemString()
573 573
     {
574
-        $ret = $this->handler->_moduleName . '_' . $this->handler->_itemname;
574
+        $ret = $this->handler->_moduleName.'_'.$this->handler->_itemname;
575 575
 
576 576
         return $ret;
577 577
     }
Please login to merge, or discard this patch.
class/smartobjecthandler.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
      *
133 133
      * @param XoopsDatabase $db           {@link XoopsDatabase}
134 134
      *                                           object
135
-     * @param                      $itemname
135
+     * @param                      string $itemname
136 136
      * @param string               $keyname      Name of the table key that uniquely identify each {@link SmartObject}
137 137
      * @param string               $idenfierName Name of the field which properly identify the {@link SmartObject}
138
-     * @param                      $summaryName
138
+     * @param                      string $summaryName
139 139
      * @param                      $modulename
140 140
      * @internal param string $tablename Name of the table use to store this <a href='psi_element://SmartObject'>SmartObject</a>
141 141
      * @internal param Name $string of the class derived from <a href='psi_element://SmartObject'>SmartObject</a> and which this handler is handling and which this handler is handling
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
     /**
193 193
      * @param $criteria
194
-     * @param $perm_name
194
+     * @param boolean $perm_name
195 195
      * @return bool
196 196
      */
197 197
     public function setGrantedObjectsCriteria(&$criteria, $perm_name)
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     }
376 376
 
377 377
     /**
378
-     * @param        $sql
378
+     * @param        string $sql
379 379
      * @param        $criteria
380 380
      * @param  bool  $force
381 381
      * @param  bool  $debug
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -148,16 +148,16 @@  discard block
 block discarded – undo
148 148
 
149 149
         $this->_itemname      = $itemname;
150 150
         $this->_moduleName    = $modulename;
151
-        $this->table          = $db->prefix($modulename . '_' . $itemname);
151
+        $this->table          = $db->prefix($modulename.'_'.$itemname);
152 152
         $this->keyName        = $keyname;
153
-        $this->className      = ucfirst($modulename) . ucfirst($itemname);
153
+        $this->className      = ucfirst($modulename).ucfirst($itemname);
154 154
         $this->identifierName = $idenfierName;
155 155
         $this->summaryName    = $summaryName;
156
-        $this->_page          = $itemname . '.php';
157
-        $this->_modulePath    = XOOPS_ROOT_PATH . '/modules/' . $this->_moduleName . '/';
158
-        $this->_moduleUrl     = XOOPS_URL . '/modules/' . $this->_moduleName . '/';
159
-        $this->_uploadPath    = XOOPS_UPLOAD_PATH . '/' . $this->_moduleName . '/';
160
-        $this->_uploadUrl     = XOOPS_UPLOAD_URL . '/' . $this->_moduleName . '/';
156
+        $this->_page          = $itemname.'.php';
157
+        $this->_modulePath    = XOOPS_ROOT_PATH.'/modules/'.$this->_moduleName.'/';
158
+        $this->_moduleUrl     = XOOPS_URL.'/modules/'.$this->_moduleName.'/';
159
+        $this->_uploadPath    = XOOPS_UPLOAD_PATH.'/'.$this->_moduleName.'/';
160
+        $this->_uploadUrl     = XOOPS_UPLOAD_URL.'/'.$this->_moduleName.'/';
161 161
     }
162 162
 
163 163
     /**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public function addPermission($perm_name, $caption, $description = false)
182 182
     {
183
-        include_once(SMARTOBJECT_ROOT_PATH . 'class/smartobjectpermission.php');
183
+        include_once(SMARTOBJECT_ROOT_PATH.'class/smartobjectpermission.php');
184 184
 
185 185
         $this->permissionsArray[] = array(
186 186
             'perm_name'   => $perm_name,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $smartPermissionsHandler = new SmartobjectPermissionHandler($this);
200 200
         $grantedItems            = $smartPermissionsHandler->getGrantedItems($perm_name);
201 201
         if (count($grantedItems) > 0) {
202
-            $criteria->add(new Criteria($this->keyName, '(' . implode(', ', $grantedItems) . ')', 'IN'));
202
+            $criteria->add(new Criteria($this->keyName, '('.implode(', ', $grantedItems).')', 'IN'));
203 203
 
204 204
             return true;
205 205
         } else {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $obj = new $this->className($this);
236 236
         $obj->setImageDir($this->getImageUrl(), $this->getImagePath());
237 237
         if (!$obj->handler) {
238
-            $obj->handler =& $this;
238
+            $obj->handler = & $this;
239 239
         }
240 240
 
241 241
         if ($isNew === true) {
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      */
251 251
     public function getImageUrl()
252 252
     {
253
-        return $this->_uploadUrl . $this->_itemname . '/';
253
+        return $this->_uploadUrl.$this->_itemname.'/';
254 254
     }
255 255
 
256 256
     /**
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public function getImagePath()
260 260
     {
261
-        $dir = $this->_uploadPath . $this->_itemname;
261
+        $dir = $this->_uploadPath.$this->_itemname;
262 262
         if (!file_exists($dir)) {
263 263
             smart_admin_mkdir($dir);
264 264
         }
265 265
 
266
-        return $dir . '/';
266
+        return $dir.'/';
267 267
     }
268 268
 
269 269
     /**
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
         if ($this->generalSQL) {
352 352
             $sql = $this->generalSQL;
353 353
         } elseif (!$sql) {
354
-            $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname;
354
+            $sql = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname;
355 355
         }
356 356
 
357 357
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
358
-            $sql .= ' ' . $criteria->renderWhere();
358
+            $sql .= ' '.$criteria->renderWhere();
359 359
             if ($criteria->getSort() !== '') {
360
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
360
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
361 361
             }
362 362
             $limit = $criteria->getLimit();
363 363
             $start = $criteria->getStart();
@@ -386,12 +386,12 @@  discard block
 block discarded – undo
386 386
         $ret = array();
387 387
 
388 388
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
389
-            $sql .= ' ' . $criteria->renderWhere();
389
+            $sql .= ' '.$criteria->renderWhere();
390 390
             if ($criteria->groupby) {
391 391
                 $sql .= $criteria->getGroupby();
392 392
             }
393 393
             if ($criteria->getSort() !== '') {
394
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
394
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
395 395
             }
396 396
         }
397 397
         if ($debug) {
@@ -464,18 +464,18 @@  discard block
 block discarded – undo
464 464
             $obj->assignVars($myrow);
465 465
             if (!$id_as_key) {
466 466
                 if ($as_object) {
467
-                    $ret[] =& $obj;
467
+                    $ret[] = & $obj;
468 468
                 } else {
469 469
                     $ret[] = $obj->toArray();
470 470
                 }
471 471
             } else {
472 472
                 if ($as_object) {
473
-                    $value =& $obj;
473
+                    $value = & $obj;
474 474
                 } else {
475 475
                     $value = $obj->toArray();
476 476
                 }
477 477
                 if ($id_as_key === 'parentid') {
478
-                    $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] =& $value;
478
+                    $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] = & $value;
479 479
                 } else {
480 480
                     $ret[$obj->getVar($this->keyName)] = $value;
481 481
                 }
@@ -518,15 +518,15 @@  discard block
 block discarded – undo
518 518
             $criteria->setSort($this->getIdentifierName());
519 519
         }
520 520
 
521
-        $sql = 'SELECT ' . (is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName);
521
+        $sql = 'SELECT '.(is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName);
522 522
         if (!empty($this->identifierName)) {
523
-            $sql .= ', ' . $this->getIdentifierName();
523
+            $sql .= ', '.$this->getIdentifierName();
524 524
         }
525
-        $sql .= ' FROM ' . $this->table . ' AS ' . $this->_itemname;
525
+        $sql .= ' FROM '.$this->table.' AS '.$this->_itemname;
526 526
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
527
-            $sql .= ' ' . $criteria->renderWhere();
527
+            $sql .= ' '.$criteria->renderWhere();
528 528
             if ($criteria->getSort() !== '') {
529
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
529
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
530 530
             }
531 531
             $limit = $criteria->getLimit();
532 532
             $start = $criteria->getStart();
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
564 564
             if ($criteria->groupby !== '') {
565 565
                 $groupby = true;
566
-                $field   = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used
566
+                $field   = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used
567 567
             }
568 568
         }
569 569
         /**
@@ -574,10 +574,10 @@  discard block
 block discarded – undo
574 574
             $sql = $this->generalSQL;
575 575
             $sql = str_replace('SELECT *', 'SELECT COUNT(*)', $sql);
576 576
         } else {
577
-            $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table . ' AS ' . $this->_itemname;
577
+            $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table.' AS '.$this->_itemname;
578 578
         }
579 579
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
580
-            $sql .= ' ' . $criteria->renderWhere();
580
+            $sql .= ' '.$criteria->renderWhere();
581 581
             if ($criteria->groupby !== '') {
582 582
                 $sql .= $criteria->getGroupby();
583 583
             }
@@ -620,13 +620,13 @@  discard block
 block discarded – undo
620 620
         if (is_array($this->keyName)) {
621 621
             $clause = array();
622 622
             for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) {
623
-                $clause[] = $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]);
623
+                $clause[] = $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]);
624 624
             }
625 625
             $whereclause = implode(' AND ', $clause);
626 626
         } else {
627
-            $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName);
627
+            $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName);
628 628
         }
629
-        $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause;
629
+        $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause;
630 630
         if (false !== $force) {
631 631
             $result = $this->db->queryF($sql);
632 632
         } else {
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
              * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
688 688
              */
689 689
             if (!is_a($obj, $this->className)) {
690
-                $obj->setError(get_class($obj) . ' Differs from ' . $this->className);
690
+                $obj->setError(get_class($obj).' Differs from '.$this->className);
691 691
 
692 692
                 return false;
693 693
             }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
         $fieldsToStoreInDB = array();
749 749
         foreach ($obj->cleanVars as $k => $v) {
750 750
             if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) {
751
-                $cleanvars[$k] = (int)$v;
751
+                $cleanvars[$k] = (int) $v;
752 752
             } elseif (is_array($v)) {
753 753
                 $cleanvars[$k] = $this->db->quoteString(implode(',', $v));
754 754
             } else {
@@ -761,13 +761,13 @@  discard block
 block discarded – undo
761 761
         if ($obj->isNew()) {
762 762
             if (!is_array($this->keyName)) {
763 763
                 if ($cleanvars[$this->keyName] < 1) {
764
-                    $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq');
764
+                    $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq');
765 765
                 }
766 766
             }
767 767
 
768
-            $sql = 'INSERT INTO ' . $this->table . ' (' . implode(',', array_keys($fieldsToStoreInDB)) . ') VALUES (' . implode(',', array_values($fieldsToStoreInDB)) . ')';
768
+            $sql = 'INSERT INTO '.$this->table.' ('.implode(',', array_keys($fieldsToStoreInDB)).') VALUES ('.implode(',', array_values($fieldsToStoreInDB)).')';
769 769
         } else {
770
-            $sql = 'UPDATE ' . $this->table . ' SET';
770
+            $sql = 'UPDATE '.$this->table.' SET';
771 771
             foreach ($fieldsToStoreInDB as $key => $value) {
772 772
                 if ((!is_array($this->keyName) && $key == $this->keyName) || (is_array($this->keyName) && in_array($key, $this->keyName))) {
773 773
                     continue;
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
                 if (isset($notfirst)) {
776 776
                     $sql .= ',';
777 777
                 }
778
-                $sql .= ' ' . $key . ' = ' . $value;
778
+                $sql .= ' '.$key.' = '.$value;
779 779
                 $notfirst = true;
780 780
             }
781 781
             if (is_array($this->keyName)) {
@@ -784,12 +784,12 @@  discard block
 block discarded – undo
784 784
                     if ($i > 0) {
785 785
                         $whereclause .= ' AND ';
786 786
                     }
787
-                    $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]);
787
+                    $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]);
788 788
                 }
789 789
             } else {
790
-                $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName);
790
+                $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName);
791 791
             }
792
-            $sql .= ' WHERE ' . $whereclause;
792
+            $sql .= ' WHERE '.$whereclause;
793 793
         }
794 794
 
795 795
         if ($debug) {
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
      */
863 863
     public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false)
864 864
     {
865
-        $set_clause = $fieldname . ' = ';
865
+        $set_clause = $fieldname.' = ';
866 866
         if (is_numeric($fieldvalue)) {
867 867
             $set_clause .= $fieldvalue;
868 868
         } elseif (is_array($fieldvalue)) {
@@ -870,9 +870,9 @@  discard block
 block discarded – undo
870 870
         } else {
871 871
             $set_clause .= $this->db->quoteString($fieldvalue);
872 872
         }
873
-        $sql = 'UPDATE ' . $this->table . ' SET ' . $set_clause;
873
+        $sql = 'UPDATE '.$this->table.' SET '.$set_clause;
874 874
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
875
-            $sql .= ' ' . $criteria->renderWhere();
875
+            $sql .= ' '.$criteria->renderWhere();
876 876
         }
877 877
         if (false != $force) {
878 878
             $result = $this->db->queryF($sql);
@@ -896,8 +896,8 @@  discard block
 block discarded – undo
896 896
     public function deleteAll(CriteriaElement $criteria = null)
897 897
     {
898 898
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
899
-            $sql = 'DELETE FROM ' . $this->table;
900
-            $sql .= ' ' . $criteria->renderWhere();
899
+            $sql = 'DELETE FROM '.$this->table;
900
+            $sql .= ' '.$criteria->renderWhere();
901 901
             if (!$this->db->query($sql)) {
902 902
                 return false;
903 903
             }
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
      */
931 931
     public function getModuleItemString()
932 932
     {
933
-        $ret = $this->_moduleName . '_' . $this->_itemname;
933
+        $ret = $this->_moduleName.'_'.$this->_itemname;
934 934
 
935 935
         return $ret;
936 936
     }
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
     {
943 943
         if (isset($object->vars['counter'])) {
944 944
             $new_counter = $object->getVar('counter') + 1;
945
-            $sql         = 'UPDATE ' . $this->table . ' SET counter=' . $new_counter . ' WHERE ' . $this->keyName . '=' . $object->id();
945
+            $sql         = 'UPDATE '.$this->table.' SET counter='.$new_counter.' WHERE '.$this->keyName.'='.$object->id();
946 946
             $this->query($sql, null, true);
947 947
         }
948 948
     }
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
     public function getIdentifierName($withprefix = true)
987 987
     {
988 988
         if ($withprefix) {
989
-            return $this->_itemname . '.' . $this->identifierName;
989
+            return $this->_itemname.'.'.$this->identifierName;
990 990
         } else {
991 991
             return $this->identifierName;
992 992
         }
Please login to merge, or discard this patch.
class/smartobjectpermission.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     /**
34 34
      * @param        $gperm_name
35
-     * @param  null  $id
35
+     * @param  integer  $id
36 36
      * @return array
37 37
      */
38 38
     public function getGrantedGroups($gperm_name, $id = null)
Please login to merge, or discard this patch.
class/smartobjectsregistry.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     /**
19 19
      * Access the only instance of this class
20 20
      *
21
-     * @return XoopsObject
21
+     * @return SmartObjectsRegistry
22 22
      *
23 23
      * @static
24 24
      * @staticvar   object
Please login to merge, or discard this patch.
include/functions.php 2 patches
Doc Comments   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 }
326 326
 
327 327
 /**
328
- * @param              $key
328
+ * @param              string $key
329 329
  * @param  bool        $moduleName
330 330
  * @param  string      $default
331 331
  * @return null|string
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 /**
389 389
  * Thanks to the NewBB2 Development Team
390
- * @param $target
390
+ * @param string $target
391 391
  * @return bool
392 392
  */
393 393
 function smart_admin_mkdir($target)
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 
541 541
 /**
542 542
  * @param $dirname
543
- * @return bool
543
+ * @return boolean|null
544 544
  */
545 545
 function smart_deleteFile($dirname)
546 546
 {
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 }
756 756
 
757 757
 /**
758
- * @param $name
758
+ * @param string $name
759 759
  */
760 760
 function smart_close_collapsable($name)
761 761
 {
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 }
766 766
 
767 767
 /**
768
- * @param     $name
768
+ * @param     string $name
769 769
  * @param     $value
770 770
  * @param int $time
771 771
  */
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 }
780 780
 
781 781
 /**
782
- * @param         $name
782
+ * @param         string $name
783 783
  * @param  string $default
784 784
  * @return string
785 785
  */
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 }
939 939
 
940 940
 /**
941
- * @param $src
941
+ * @param string $src
942 942
  */
943 943
 function smart_addScript($src)
944 944
 {
@@ -1115,8 +1115,8 @@  discard block
 block discarded – undo
1115 1115
 }
1116 1116
 
1117 1117
 /**
1118
- * @param $module
1119
- * @param $file
1118
+ * @param string $module
1119
+ * @param string $file
1120 1120
  */
1121 1121
 function smart_loadLanguageFile($module, $file)
1122 1122
 {
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
  * This function should be able to cover almost all floats that appear in an european environment.
1233 1233
  * @param            $str
1234 1234
  * @param  bool      $set
1235
- * @return float|int
1235
+ * @return double
1236 1236
  */
1237 1237
 function smart_getfloat($str, $set = false)
1238 1238
 {
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
 /**
1268 1268
  * @param                         $var
1269 1269
  * @param  bool                   $currencyObj
1270
- * @return float|int|mixed|string
1270
+ * @return string
1271 1271
  */
1272 1272
 function smart_currency($var, $currencyObj = false)
1273 1273
 {
@@ -1295,7 +1295,7 @@  discard block
 block discarded – undo
1295 1295
 
1296 1296
 /**
1297 1297
  * @param $var
1298
- * @return float|int|mixed|string
1298
+ * @return string
1299 1299
  */
1300 1300
 function smart_float($var)
1301 1301
 {
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 /**
1344 1344
  * @param $moduleName
1345 1345
  * @param $items
1346
- * @return array
1346
+ * @return string[]
1347 1347
  */
1348 1348
 function smart_getTablesArray($moduleName, $items)
1349 1349
 {
Please login to merge, or discard this 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.
class/member.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 // ------------------------------------------------------------------------- //
31 31
 
32 32
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
33
-require_once XOOPS_ROOT_PATH . '/kernel/user.php';
34
-require_once XOOPS_ROOT_PATH . '/kernel/group.php';
35
-require_once XOOPS_ROOT_PATH . '/kernel/member.php';
33
+require_once XOOPS_ROOT_PATH.'/kernel/user.php';
34
+require_once XOOPS_ROOT_PATH.'/kernel/group.php';
35
+require_once XOOPS_ROOT_PATH.'/kernel/member.php';
36 36
 
37 37
 /**
38 38
  * XOOPS member handler class.
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 
152 152
         if ($notifyUser) {
153 153
             // send some notifications
154
-            $xoopsMailer =& getMailer();
154
+            $xoopsMailer = & getMailer();
155 155
             $xoopsMailer->useMail();
156
-            $xoopsMailer->setTemplateDir(SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/mail_template');
156
+            $xoopsMailer->setTemplateDir(SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/mail_template');
157 157
             $xoopsMailer->setTemplate('smartobject_notify_user_added_by_admin.tpl');
158 158
             $xoopsMailer->assign('XOOPS_USER_PASSWORD', $password);
159 159
             $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
160 160
             $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
161
-            $xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
161
+            $xoopsMailer->assign('SITEURL', XOOPS_URL.'/');
162 162
             $xoopsMailer->assign('NAME', $userObj->getVar('name'));
163 163
             $xoopsMailer->assign('UNAME', $userObj->getVar('uname'));
164 164
             $xoopsMailer->setToUsers($userObj);
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         if (strlen($name) > 0) {
205 205
             $name = explode(' ', trim($name));
206 206
             if (count($name) > 1) {
207
-                $basename = strtolower(substr($name[0], 0, 1) . $name[count($name) - 1]);
207
+                $basename = strtolower(substr($name[0], 0, 1).$name[count($name) - 1]);
208 208
             } else {
209 209
                 $basename = strtolower($name[0]);
210 210
             }
@@ -221,9 +221,9 @@  discard block
 block discarded – undo
221 221
         while ($i < $count) {
222 222
             $num = $this->genRandNumber();
223 223
             if ($onbasename < 0 && $hasbasename) {
224
-                $names[] = xoops_substr($basename, 0, 58, '') . $num;
224
+                $names[] = xoops_substr($basename, 0, 58, '').$num;
225 225
             } else {
226
-                $names[] = xoops_substr($emailname, 0, 58, '') . $num;
226
+                $names[] = xoops_substr($emailname, 0, 58, '').$num;
227 227
             }
228 228
             $i          = count($names);
229 229
             $onbasename = ~$onbasename;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     {
266 266
         static $randCalled = false;
267 267
         if (!$randCalled) {
268
-            mt_srand((double)microtime() * 1000000);
268
+            mt_srand((double) microtime() * 1000000);
269 269
             $randCalled = true;
270 270
         }
271 271
     }
Please login to merge, or discard this patch.
class/smartmlobject.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
14
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php';
14
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php';
15 15
 
16 16
 /**
17 17
  * SmartObject base Multilanguage-enabled class
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function stripMultilanguageFields()
53 53
     {
54
-        $objectVars    =& $this->getVars();
54
+        $objectVars    = & $this->getVars();
55 55
         $newObjectVars = array();
56 56
         foreach ($objectVars as $key => $var) {
57 57
             if (!$var['multilingual']) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
     public function stripNonMultilanguageFields()
65 65
     {
66
-        $objectVars    =& $this->getVars();
66
+        $objectVars    = & $this->getVars();
67 67
         $newObjectVars = array();
68 68
         foreach ($objectVars as $key => $var) {
69 69
             if ($var['multilingual'] || $key == $this->handler->keyName) {
@@ -118,21 +118,21 @@  discard block
 block discarded – undo
118 118
     public function getObjects($criteria = null, $id_as_key = false, $as_object = true, $debug = false, $language = false)
119 119
     {
120 120
         // Create the first part of the SQL query to join the "_text" table
121
-        $sql = 'SELECT * FROM ' .
122
-               $this->table .
123
-               ' AS ' .
124
-               $this->_itemname .
125
-               ' INNER JOIN ' .
126
-               $this->table .
127
-               '_text AS ' .
128
-               $this->_itemname .
129
-               '_text ON ' .
130
-               $this->_itemname .
131
-               '.' .
132
-               $this->keyName .
133
-               '=' .
134
-               $this->_itemname .
135
-               '_text.' .
121
+        $sql = 'SELECT * FROM '.
122
+               $this->table.
123
+               ' AS '.
124
+               $this->_itemname.
125
+               ' INNER JOIN '.
126
+               $this->table.
127
+               '_text AS '.
128
+               $this->_itemname.
129
+               '_text ON '.
130
+               $this->_itemname.
131
+               '.'.
132
+               $this->keyName.
133
+               '='.
134
+               $this->_itemname.
135
+               '_text.'.
136 136
                $this->keyName;
137 137
 
138 138
         if ($language) {
@@ -171,6 +171,6 @@  discard block
 block discarded – undo
171 171
 
172 172
     public function changeTableNameForML()
173 173
     {
174
-        $this->table = $this->db->prefix($this->_moduleName . '_' . $this->_itemname . '_text');
174
+        $this->table = $this->db->prefix($this->_moduleName.'_'.$this->_itemname.'_text');
175 175
     }
176 176
 }
Please login to merge, or discard this patch.
class/file.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
3 3
 
4
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/basedurl.php';
4
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/basedurl.php';
5 5
 
6 6
 /**
7 7
  * Class SmartobjectFile
Please login to merge, or discard this patch.