Completed
Push — master ( bf34f3...88111b )
by Michael
03:08
created
class/SmartJax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
25 25
 
26
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/projax/projax.php';
26
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/projax/projax.php';
27 27
 
28 28
 /**
29 29
  * Class SmartJax
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function initiateFromUserside()
34 34
     {
35 35
         global $xoTheme;
36
-        $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/prototype.js');
37
-        $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/scriptaculous.js');
36
+        $xoTheme->addScript(SMARTOBJECT_URL.'include/projax/js/prototype.js');
37
+        $xoTheme->addScript(SMARTOBJECT_URL.'include/projax/js/scriptaculous.js');
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
class/SmartObjectTable.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     public function addActionButton($op, $caption = false, $text = false)
99 99
     {
100
-        $action                 = [
100
+        $action = [
101 101
             'op'      => $op,
102 102
             'caption' => $caption,
103 103
             'text'    => $text
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $current_urls               = smart_getCurrentUrls();
134 134
         $current_url                = $current_urls['full'];
135
-        $this->_printerFriendlyPage = $current_url . '&print';
135
+        $this->_printerFriendlyPage = $current_url.'&print';
136 136
     }
137 137
 
138 138
     /**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function addDefaultIntroButton($caption)
167 167
     {
168
-        $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page . '?op=mod', $caption);
168
+        $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page.'?op=mod', $caption);
169 169
     }
170 170
 
171 171
     /**
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
     public function getDefaultSort()
191 191
     {
192 192
         if ($this->_sortsel) {
193
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel);
193
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel);
194 194
         } else {
195
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_objectHandler->identifierName);
195
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_objectHandler->identifierName);
196 196
         }
197 197
     }
198 198
 
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
     public function getDefaultOrder()
211 211
     {
212 212
         if ($this->_ordersel) {
213
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel);
213
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel);
214 214
         } else {
215
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', 'ASC');
215
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', 'ASC');
216 216
         }
217 217
     }
218 218
 
@@ -261,21 +261,21 @@  discard block
 block discarded – undo
261 261
 
262 262
     public function setSortOrder()
263 263
     {
264
-        $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] : $this->getDefaultSort();
264
+        $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] : $this->getDefaultSort();
265 265
         //$this->_sortsel = isset($_POST['sortsel']) ? $_POST['sortsel']: $this->_sortsel;
266
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel);
266
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel);
267 267
         $fieldsForSorting = $this->_tempObject->getFieldsForSorting($this->_sortsel);
268 268
 
269 269
         if (isset($this->_tempObject->vars[$this->_sortsel]['itemName'])
270 270
             && $this->_tempObject->vars[$this->_sortsel]['itemName']) {
271
-            $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'] . '.' . $this->_sortsel);
271
+            $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'].'.'.$this->_sortsel);
272 272
         } else {
273
-            $this->_criteria->setSort($this->_objectHandler->_itemname . '.' . $this->_sortsel);
273
+            $this->_criteria->setSort($this->_objectHandler->_itemname.'.'.$this->_sortsel);
274 274
         }
275 275
 
276
-        $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : $this->getDefaultOrder();
276
+        $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : $this->getDefaultOrder();
277 277
         //$this->_ordersel = isset($_POST['ordersel']) ? $_POST['ordersel']:$this->_ordersel;
278
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel);
278
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel);
279 279
         $ordersArray = $this->getOrdersArray();
280 280
         $this->_criteria->setOrder($this->_ordersel);
281 281
     }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
                         //$object->initiateCustomFields();
326 326
                     }
327 327
                     if ('checked' === $column->_keyname) {
328
-                        $value = '<input type ="checkbox" name="selected_smartobjects[]" value="' . $object->id() . '">';
328
+                        $value = '<input type ="checkbox" name="selected_smartobjects[]" value="'.$object->id().'">';
329 329
                     } elseif ($column->_customMethodForValue
330 330
                               && method_exists($object, $column->_customMethodForValue)) {
331 331
                         $method = $column->_customMethodForValue;
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                     }
371 371
                 }
372 372
 
373
-                require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php';
373
+                require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php';
374 374
                 $controller = new SmartObjectController($this->_objectHandler);
375 375
 
376 376
                 if ((!is_array($this->_actions)) || in_array('edit', $this->_actions)) {
@@ -410,9 +410,9 @@  discard block
 block discarded – undo
410 410
     public function getDefaultFilter()
411 411
     {
412 412
         if ($this->_filtersel) {
413
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
413
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel);
414 414
         } else {
415
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', 'default');
415
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', 'default');
416 416
         }
417 417
     }
418 418
 
@@ -462,9 +462,9 @@  discard block
 block discarded – undo
462 462
     public function getDefaultFilter2()
463 463
     {
464 464
         if ($this->_filtersel2) {
465
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2);
465
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2);
466 466
         } else {
467
-            return smart_getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', 'default');
467
+            return smart_getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', 'default');
468 468
         }
469 469
     }
470 470
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
      */
593 593
     public function render($fetchOnly = false, $debug = false)
594 594
     {
595
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
595
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
596 596
 
597 597
         $this->_tpl = new \XoopsTpl();
598 598
 
@@ -603,24 +603,24 @@  discard block
 block discarded – undo
603 603
          */
604 604
         $this->_tempObject = $this->_objectHandler->create();
605 605
 
606
-        $this->_criteria->setStart(isset($_GET['start' . $this->_objectHandler->keyName]) ? (int)$_GET['start' . $this->_objectHandler->keyName] : 0);
606
+        $this->_criteria->setStart(isset($_GET['start'.$this->_objectHandler->keyName]) ? (int) $_GET['start'.$this->_objectHandler->keyName] : 0);
607 607
 
608 608
         $this->setSortOrder();
609 609
 
610 610
         if (!$this->_isTree) {
611
-            $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : smart_getCookieVar($_SERVER['PHP_SELF'] . '_limitsel', '15');
611
+            $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : smart_getCookieVar($_SERVER['PHP_SELF'].'_limitsel', '15');
612 612
         } else {
613 613
             $this->_limitsel = 'all';
614 614
         }
615 615
 
616 616
         $this->_limitsel = isset($_POST['limitsel']) ? $_POST['limitsel'] : $this->_limitsel;
617
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_limitsel', $this->_limitsel);
617
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_limitsel', $this->_limitsel);
618 618
         $limitsArray = $this->getLimitsArray();
619 619
         $this->_criteria->setLimit($this->_limitsel);
620 620
 
621 621
         $this->_filtersel = isset($_GET['filtersel']) ? $_GET['filtersel'] : $this->getDefaultFilter();
622 622
         $this->_filtersel = isset($_POST['filtersel']) ? $_POST['filtersel'] : $this->_filtersel;
623
-        smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
623
+        smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel);
624 624
         $filtersArray = $this->getFiltersArray();
625 625
 
626 626
         if ($filtersArray) {
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                     $filters2Array = $this->getFilters2Array();
647 647
                     $this->_tpl->assign('smartobject_optionssel_filters2Array', $filters2Array);
648 648
 
649
-                    smart_setCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2);
649
+                    smart_setCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2);
650 650
                     if ('default' !== $this->_filtersel2) {
651 651
                         $this->_criteria->add(new \Criteria($this->_filtersel, $this->_filtersel2));
652 652
                     }
@@ -655,21 +655,21 @@  discard block
 block discarded – undo
655 655
         }
656 656
         // Check if we have a quicksearch
657 657
 
658
-        if (isset($_POST['quicksearch_' . $this->_id]) && '' != $_POST['quicksearch_' . $this->_id]) {
658
+        if (isset($_POST['quicksearch_'.$this->_id]) && '' != $_POST['quicksearch_'.$this->_id]) {
659 659
             $quicksearch_criteria = new \CriteriaCompo();
660 660
             if (is_array($this->_quickSearch['fields'])) {
661 661
                 foreach ($this->_quickSearch['fields'] as $v) {
662
-                    $quicksearch_criteria->add(new \Criteria($v, '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'), 'OR');
662
+                    $quicksearch_criteria->add(new \Criteria($v, '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'), 'OR');
663 663
                 }
664 664
             } else {
665
-                $quicksearch_criteria->add(new \Criteria($this->_quickSearch['fields'], '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'));
665
+                $quicksearch_criteria->add(new \Criteria($this->_quickSearch['fields'], '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'));
666 666
             }
667 667
             $this->_criteria->add($quicksearch_criteria);
668 668
         }
669 669
 
670 670
         $this->_objects = $this->fetchObjects($debug);
671 671
 
672
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
672
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
673 673
         if ($this->_criteria->getLimit() > 0) {
674 674
 
675 675
             /**
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
              */
686 686
             $params_of_the_options_sel = [];
687 687
 
688
-            $not_needed_params = ['sortsel', 'limitsel', 'ordersel', 'start' . $this->_objectHandler->keyName];
688
+            $not_needed_params = ['sortsel', 'limitsel', 'ordersel', 'start'.$this->_objectHandler->keyName];
689 689
             foreach ($_GET as $k => $v) {
690 690
                 if (!in_array($k, $not_needed_params)) {
691 691
                     $new_get_array[]             = "$k=$v";
@@ -696,12 +696,12 @@  discard block
 block discarded – undo
696 696
             /**
697 697
              * Adding the new params of the pagenav
698 698
              */
699
-            $new_get_array[] = 'sortsel=' . $this->_sortsel;
700
-            $new_get_array[] = 'ordersel=' . $this->_ordersel;
701
-            $new_get_array[] = 'limitsel=' . $this->_limitsel;
699
+            $new_get_array[] = 'sortsel='.$this->_sortsel;
700
+            $new_get_array[] = 'ordersel='.$this->_ordersel;
701
+            $new_get_array[] = 'limitsel='.$this->_limitsel;
702 702
             $otherParams     = implode('&', $new_get_array);
703 703
 
704
-            $pagenav = new \XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start' . $this->_objectHandler->keyName, $otherParams);
704
+            $pagenav = new \XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start'.$this->_objectHandler->keyName, $otherParams);
705 705
             $this->_tpl->assign('smartobject_pagenav', $pagenav->renderNav());
706 706
         }
707 707
         $this->renderOptionSelection($limitsArray, $params_of_the_options_sel);
@@ -737,20 +737,20 @@  discard block
 block discarded – undo
737 737
             $aColumn['align'] = $column->getAlign();
738 738
             $aColumn['key']   = $column->getKeyName();
739 739
             if ('checked' === $column->_keyname) {
740
-                $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"' . ' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_' . $this->_id . ', \'selected_smartobjects\');">';
740
+                $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"'.' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_'.$this->_id.', \'selected_smartobjects\');">';
741 741
             } elseif ($column->getCustomCaption()) {
742 742
                 $aColumn['caption'] = $column->getCustomCaption();
743 743
             } else {
744 744
                 $aColumn['caption'] = isset($this->_tempObject->vars[$column->getKeyName()]['form_caption']) ? $this->_tempObject->vars[$column->getKeyName()]['form_caption'] : $column->getKeyName();
745 745
             }
746 746
             // Are we doing a GET sort on this column ?
747
-            $getSort = (isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'])
748
-                        && $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] == $column->getKeyName())
747
+            $getSort = (isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel'])
748
+                        && $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] == $column->getKeyName())
749 749
                        || ($this->_sortsel == $column->getKeyName());
750
-            $order   = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : 'DESC';
750
+            $order   = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : 'DESC';
751 751
 
752
-            if (isset($_REQUEST['quicksearch_' . $this->_id]) && '' != $_REQUEST['quicksearch_' . $this->_id]) {
753
-                $qs_param = '&quicksearch_' . $this->_id . '=' . $_REQUEST['quicksearch_' . $this->_id];
752
+            if (isset($_REQUEST['quicksearch_'.$this->_id]) && '' != $_REQUEST['quicksearch_'.$this->_id]) {
753
+                $qs_param = '&quicksearch_'.$this->_id.'='.$_REQUEST['quicksearch_'.$this->_id];
754 754
             }
755 755
             if (!$this->_enableColumnsSorting || 'checked' === $column->_keyname || !$column->isSortable()) {
756 756
                 $aColumn['caption'] = $aColumn['caption'];
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
                                       . $orderArray[$order]['image']
778 778
                                       . '" alt="ASC"></a>';
779 779
             } else {
780
-                $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=ASC' . $qs_param . '&' . $new_query_string . '">' . $aColumn['caption'] . '</a>';
780
+                $aColumn['caption'] = '<a href="'.$current_url.'?'.$this->_objectHandler->_itemname.'_'.'sortsel='.$column->getKeyName().'&'.$this->_objectHandler->_itemname.'_'.'ordersel=ASC'.$qs_param.'&'.$new_query_string.'">'.$aColumn['caption'].'</a>';
781 781
             }
782 782
             $aColumns[] = $aColumn;
783 783
         }
@@ -807,9 +807,9 @@  discard block
 block discarded – undo
807 807
 
808 808
         $smartobjectTable_template = $this->_customTemplate ?: 'smartobject_smarttable_display.tpl';
809 809
         if ($fetchOnly) {
810
-            return $this->_tpl->fetch('db:' . $smartobjectTable_template);
810
+            return $this->_tpl->fetch('db:'.$smartobjectTable_template);
811 811
         } else {
812
-            $this->_tpl->display('db:' . $smartobjectTable_template);
812
+            $this->_tpl->display('db:'.$smartobjectTable_template);
813 813
         }
814 814
     }
815 815
 
Please login to merge, or discard this patch.
class/SmartobjectTagHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      */
44 44
     public function getLanguages()
45 45
     {
46
-        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
46
+        require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
47 47
         $aLanguages     = XoopsLists::getLangList();
48 48
         $ret['default'] = _CO_SOBJECT_ALL;
49 49
         foreach ($aLanguages as $lang) {
Please login to merge, or discard this patch.
class/BaseSmartObject.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
17 17
 
18
-require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
18
+require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
19 19
 
20 20
 if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) {
21 21
     define('XOBJ_DTYPE_SIMPLE_ARRAY', 101);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function closeSection($section_name)
116 116
     {
117
-        $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
117
+        $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true);
118 118
     }
119 119
 
120 120
     /**
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
         }
153 153
         parent::initVar($key, $data_type, $value, $required, $maxlength, $options);
154 154
         if ($this->handler && (!$form_caption || '' === $form_caption)) {
155
-            $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key);
155
+            $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key);
156 156
             if (defined($dyn_form_caption)) {
157 157
                 $form_caption = constant($dyn_form_caption);
158 158
             }
159 159
         }
160 160
         if ($this->handler && (!$form_dsc || '' === $form_dsc)) {
161
-            $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC');
161
+            $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC');
162 162
             if (defined($dyn_form_dsc)) {
163 163
                 $form_dsc = constant($dyn_form_dsc);
164 164
             }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
     public function toArray()
455 455
     {
456 456
         $ret  = [];
457
-        $vars =& $this->getVars();
457
+        $vars = & $this->getVars();
458 458
         foreach ($vars as $key => $var) {
459 459
             $value     = $this->getVar($key);
460 460
             $ret[$key] = $value;
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         }
473 473
 
474 474
         // Hightlighting searched words
475
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smarthighlighter.php';
475
+        require_once SMARTOBJECT_ROOT_PATH.'class/smarthighlighter.php';
476 476
         $highlight = smart_getConfig('module_search_highlighter', false, true);
477 477
 
478 478
         if ($highlight && isset($_GET['keywords'])) {
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             }
504 504
         } else {
505 505
             if ($prefix) {
506
-                $err_str = '[' . $prefix . '] ' . $err_str;
506
+                $err_str = '['.$prefix.'] '.$err_str;
507 507
             }
508 508
             parent::setErrors($err_str);
509 509
         }
@@ -831,8 +831,8 @@  discard block
 block discarded – undo
831 831
                             $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
832 832
                             continue 2;
833 833
                         }
834
-                        if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) {
835
-                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength']));
834
+                        if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) {
835
+                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength']));
836 836
                             continue 2;
837 837
                         }
838 838
                         if (!$v['not_gpc']) {
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                         break;
862 862
                     case XOBJ_DTYPE_INT:
863 863
                     case XOBJ_DTYPE_TIME_ONLY:
864
-                        $cleanv = (int)$cleanv;
864
+                        $cleanv = (int) $cleanv;
865 865
                         break;
866 866
 
867 867
                     case XOBJ_DTYPE_CURRENCY:
@@ -892,10 +892,10 @@  discard block
 block discarded – undo
892 892
                             continue 2;
893 893
                         }
894 894
                         if ('' !== $cleanv && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
895
-                            $cleanv = 'http://' . $cleanv;
895
+                            $cleanv = 'http://'.$cleanv;
896 896
                         }
897 897
                         if (!$v['not_gpc']) {
898
-                            $cleanv =& $ts->stripSlashesGPC($cleanv);
898
+                            $cleanv = & $ts->stripSlashesGPC($cleanv);
899 899
                         }
900 900
                         break;
901 901
                     case XOBJ_DTYPE_SIMPLE_ARRAY:
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
                     case XOBJ_DTYPE_STIME:
908 908
                     case XOBJ_DTYPE_MTIME:
909 909
                     case XOBJ_DTYPE_LTIME:
910
-                        $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv);
910
+                        $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv);
911 911
                         if (!($cleanv > 0)) {
912 912
                             $cleanv = strtotime($cleanv);
913 913
                         }
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
                         break;
917 917
                 }
918 918
             }
919
-            $this->cleanVars[$k] =& $cleanv;
919
+            $this->cleanVars[$k] = & $cleanv;
920 920
             unset($cleanv);
921 921
         }
922 922
         if (count($this->_errors) > 0) {
@@ -1141,10 +1141,10 @@  discard block
 block discarded – undo
1141 1141
                 }
1142 1142
                 break;
1143 1143
             case XOBJ_DTYPE_SIMPLE_ARRAY:
1144
-                $ret =& explode('|', $ret);
1144
+                $ret = & explode('|', $ret);
1145 1145
                 break;
1146 1146
             case XOBJ_DTYPE_ARRAY:
1147
-                $ret =& unserialize($ret);
1147
+                $ret = & unserialize($ret);
1148 1148
                 break;
1149 1149
             case XOBJ_DTYPE_SOURCE:
1150 1150
                 switch (strtolower($format)) {
@@ -1302,7 +1302,7 @@  discard block
 block discarded – undo
1302 1302
         $actions = [],
1303 1303
         $headerAsRow = true
1304 1304
     ) {
1305
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectsingleview.php';
1305
+        require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectsingleview.php';
1306 1306
         $singleview = new SmartObjectSingleView($this, $userSide, $actions, $headerAsRow);
1307 1307
         // add all fields mark as displayOnSingleView except the keyid
1308 1308
         foreach ($this->vars as $key => $var) {
Please login to merge, or discard this patch.
class/SmartobjectAdsense.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -104,23 +104,23 @@  discard block
 block discarded – undo
104 104
     {
105 105
         global $smartobjectAdsenseHandler;
106 106
         if ('' !== $this->getVar('style', 'n')) {
107
-            $ret = '<div style="' . $this->getVar('style', 'n') . '">';
107
+            $ret = '<div style="'.$this->getVar('style', 'n').'">';
108 108
         } else {
109 109
             $ret = '<div>';
110 110
         }
111 111
 
112 112
         $ret .= '<script type="text/javascript"><!--
113
-google_ad_client = "' . $this->getVar('client_id', 'n') . '";
114
-google_ad_width = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['width'] . ';
115
-google_ad_height = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['height'] . ';
116
-google_ad_format = "' . $this->getVar('format', 'n') . '";
113
+google_ad_client = "' . $this->getVar('client_id', 'n').'";
114
+google_ad_width = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['width'].';
115
+google_ad_height = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['height'].';
116
+google_ad_format = "' . $this->getVar('format', 'n').'";
117 117
 google_ad_type = "text";
118 118
 google_ad_channel ="";
119
-google_color_border = "' . $this->getVar('border_color', 'n') . '";
120
-google_color_bg = "' . $this->getVar('background_color', 'n') . '";
121
-google_color_link = "' . $this->getVar('link_color', 'n') . '";
122
-google_color_url = "' . $this->getVar('url_color', 'n') . '";
123
-google_color_text = "' . $this->getVar('text_color', 'n') . '";
119
+google_color_border = "' . $this->getVar('border_color', 'n').'";
120
+google_color_bg = "' . $this->getVar('background_color', 'n').'";
121
+google_color_link = "' . $this->getVar('link_color', 'n').'";
122
+google_color_url = "' . $this->getVar('url_color', 'n').'";
123
+google_color_text = "' . $this->getVar('text_color', 'n').'";
124 124
 //--></script>
125 125
 <script type="text/javascript"
126 126
   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function getXoopsCode()
137 137
     {
138
-        $ret = '[adsense]' . $this->getVar('tag', 'n') . '[/adsense]';
138
+        $ret = '[adsense]'.$this->getVar('tag', 'n').'[/adsense]';
139 139
 
140 140
         return $ret;
141 141
     }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function getCloneLink()
258 258
     {
259
-        $ret = '<a href="' . SMARTOBJECT_URL . 'admin/adsense.php?op=clone&adsenseid=' . $this->getVar('adsenseid') . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'editcopy.png" alt="' . _CO_SOBJECT_ADSENSE_CLONE . '" title="' . _CO_SOBJECT_ADSENSE_CLONE . '"></a>';
259
+        $ret = '<a href="'.SMARTOBJECT_URL.'admin/adsense.php?op=clone&adsenseid='.$this->getVar('adsenseid').'"><img src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'editcopy.png" alt="'._CO_SOBJECT_ADSENSE_CLONE.'" title="'._CO_SOBJECT_ADSENSE_CLONE.'"></a>';
260 260
 
261 261
         return $ret;
262 262
     }
Please login to merge, or discard this patch.
class/SmartObjectController.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
         foreach (array_keys($smartObj->vars) as $key) {
53 53
             switch ($smartObj->vars[$key]['data_type']) {
54 54
                 case XOBJ_DTYPE_IMAGE:
55
-                    if (isset($_POST['url_' . $key]) && '' !== $_POST['url_' . $key]) {
56
-                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
57
-                        $smartObj->setVar($key, $_POST['url_' . $key]);
55
+                    if (isset($_POST['url_'.$key]) && '' !== $_POST['url_'.$key]) {
56
+                        $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e');
57
+                        $smartObj->setVar($key, $_POST['url_'.$key]);
58 58
                         if (file_exists($oldFile)) {
59 59
                             unlink($oldFile);
60 60
                         }
61 61
                     }
62
-                    if (isset($_POST['delete_' . $key]) && '1' == $_POST['delete_' . $key]) {
63
-                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
62
+                    if (isset($_POST['delete_'.$key]) && '1' == $_POST['delete_'.$key]) {
63
+                        $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e');
64 64
                         $smartObj->setVar($key, '');
65 65
                         if (file_exists($oldFile)) {
66 66
                             unlink($oldFile);
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 
71 71
                 case XOBJ_DTYPE_URLLINK:
72 72
                     $linkObj = $smartObj->getUrlLinkObj($key);
73
-                    $linkObj->setVar('caption', $_POST['caption_' . $key]);
74
-                    $linkObj->setVar('description', $_POST['desc_' . $key]);
75
-                    $linkObj->setVar('target', $_POST['target_' . $key]);
76
-                    $linkObj->setVar('url', $_POST['url_' . $key]);
73
+                    $linkObj->setVar('caption', $_POST['caption_'.$key]);
74
+                    $linkObj->setVar('description', $_POST['desc_'.$key]);
75
+                    $linkObj->setVar('target', $_POST['target_'.$key]);
76
+                    $linkObj->setVar('url', $_POST['url_'.$key]);
77 77
                     if ('' !== $linkObj->getVar('url')) {
78 78
                         $smartObj->storeUrlLinkObj($linkObj);
79 79
                     }
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
                     break;
83 83
 
84 84
                 case XOBJ_DTYPE_FILE:
85
-                    if (!isset($_FILES['upload_' . $key]['name']) || '' === $_FILES['upload_' . $key]['name']) {
85
+                    if (!isset($_FILES['upload_'.$key]['name']) || '' === $_FILES['upload_'.$key]['name']) {
86 86
                         $fileObj = $smartObj->getFileObj($key);
87
-                        $fileObj->setVar('caption', $_POST['caption_' . $key]);
88
-                        $fileObj->setVar('description', $_POST['desc_' . $key]);
89
-                        $fileObj->setVar('url', $_POST['url_' . $key]);
87
+                        $fileObj->setVar('caption', $_POST['caption_'.$key]);
88
+                        $fileObj->setVar('description', $_POST['desc_'.$key]);
89
+                        $fileObj->setVar('url', $_POST['url_'.$key]);
90 90
                         if (!('' === $fileObj->getVar('url') && '' === $fileObj->getVar('url')
91 91
                               && '' === $fileObj->getVar('url'))) {
92 92
                             $res = $smartObj->storeFileObj($fileObj);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                         $value = strtotime($_POST[$key]);
111 111
                         //if strtotime returns false, the value is already a time stamp
112 112
                         if (!$value) {
113
-                            $value = (int)$_POST[$key];
113
+                            $value = (int) $_POST[$key];
114 114
                         }
115 115
                     }
116 116
                     $smartObj->setVar($key, $value);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 if (isset($file_array['name']) && '' !== $file_array['name']
160 160
                     && in_array(str_replace('upload_', '', $name), array_keys($smartObj->vars))) {
161 161
                     if ($uploaderObj->fetchMedia($name)) {
162
-                        $uploaderObj->setTargetFileName(time() . '_' . $uploaderObj->getMediaName());
162
+                        $uploaderObj->setTargetFileName(time().'_'.$uploaderObj->getMediaName());
163 163
                         if ($uploaderObj->upload()) {
164 164
                             // Find the related field in the SmartObject
165 165
                             $related_field   = str_replace('upload_', '', $name);
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
                             if (XOBJ_DTYPE_FILE === $smartObj->vars[$related_field]['data_type']) {
169 169
                                 $object_fileurl = $smartObj->getUploadDir();
170 170
                                 $fileObj        = $smartObj->getFileObj($related_field);
171
-                                $fileObj->setVar('url', $object_fileurl . $uploaderObj->getSavedFileName());
172
-                                $fileObj->setVar('caption', $_POST['caption_' . $related_field]);
173
-                                $fileObj->setVar('description', $_POST['desc_' . $related_field]);
171
+                                $fileObj->setVar('url', $object_fileurl.$uploaderObj->getSavedFileName());
172
+                                $fileObj->setVar('caption', $_POST['caption_'.$related_field]);
173
+                                $fileObj->setVar('description', $_POST['desc_'.$related_field]);
174 174
                                 $smartObj->storeFileObj($fileObj);
175 175
                                 //todo: catch errors
176 176
                                 $smartObj->setVar($related_field, $fileObj->getVar('fileid'));
177 177
                             } else {
178
-                                $old_file = $smartObj->getUploadDir(true) . $smartObj->getVar($related_field);
178
+                                $old_file = $smartObj->getUploadDir(true).$smartObj->getVar($related_field);
179 179
                                 unlink($old_file);
180 180
                                 $smartObj->setVar($related_field, $uploaderObj->getSavedFileName());
181 181
                             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             return $smartObj;
207 207
         } else {
208 208
             if (!$storeResult) {
209
-                redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $smartObj->getHtmlErrors());
209
+                redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$smartObj->getHtmlErrors());
210 210
             }
211 211
 
212 212
             $redirect_page = $redirect_page ?: smart_get_page_before_form();
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $debug = false,
236 236
         $x_param = false
237 237
     ) {
238
-        $objectid = isset($_POST[$this->handler->keyName]) ? (int)$_POST[$this->handler->keyName] : 0;
238
+        $objectid = isset($_POST[$this->handler->keyName]) ? (int) $_POST[$this->handler->keyName] : 0;
239 239
         if ($debug) {
240 240
             if ($x_param) {
241 241
                 $smartObj = $this->handler->getD($objectid, true, $x_param);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
     {
312 312
         global $smart_previous_page;
313 313
 
314
-        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0;
314
+        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0;
315 315
         $smartObj = $this->handler->get($objectid);
316 316
 
317 317
         if ($smartObj->isNew()) {
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
322 322
         if ($confirm) {
323 323
             if (!$this->handler->delete($smartObj)) {
324
-                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors());
324
+                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors());
325 325
             }
326 326
 
327 327
             redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_SUCCESS);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     {
355 355
         global $smart_previous_page, $xoopsTpl;
356 356
 
357
-        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0;
357
+        $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0;
358 358
         $smartObj = $this->handler->get($objectid);
359 359
 
360 360
         if ($smartObj->isNew()) {
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
365 365
         if ($confirm) {
366 366
             if (!$this->handler->delete($smartObj)) {
367
-                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors());
367
+                redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors());
368 368
             }
369 369
 
370 370
             redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_SUCCESS);
@@ -396,14 +396,14 @@  discard block
 block discarded – undo
396 396
      */
397 397
     public function getAdminViewItemLink(SmartObject $smartObj, $onlyUrl = false, $withimage = false)
398 398
     {
399
-        $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=view&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
399
+        $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=view&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
400 400
         if ($onlyUrl) {
401 401
             return $ret;
402 402
         } elseif ($withimage) {
403
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "viewmag.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_ADMIN_VIEW . "'  title='" . _CO_SOBJECT_ADMIN_VIEW . "'></a>";
403
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."viewmag.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_ADMIN_VIEW."'  title='"._CO_SOBJECT_ADMIN_VIEW."'></a>";
404 404
         }
405 405
 
406
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
406
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
407 407
     }
408 408
 
409 409
     /**
@@ -425,15 +425,15 @@  discard block
 block discarded – undo
425 425
         $seoIncludeId = true;
426 426
 
427 427
         if ('rewrite' === $seoMode) {
428
-            $ret = XOOPS_URL . '/' . $seoModuleName . '.' . $this->handler->_itemname . ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . '/' . $smartObj->getVar('short_url') . '.html';
428
+            $ret = XOOPS_URL.'/'.$seoModuleName.'.'.$this->handler->_itemname.($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').'/'.$smartObj->getVar('short_url').'.html';
429 429
         } elseif ('pathinfo' === $seoMode) {
430
-            $ret = SMARTOBJECT_URL . 'seo.php/' . $seoModuleName . '.' . $this->handler->_itemname . ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . '/' . $smartObj->getVar('short_url') . '.html';
430
+            $ret = SMARTOBJECT_URL.'seo.php/'.$seoModuleName.'.'.$this->handler->_itemname.($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').'/'.$smartObj->getVar('short_url').'.html';
431 431
         } else {
432
-            $ret = $this->handler->_moduleUrl . $this->handler->_page . '?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
432
+            $ret = $this->handler->_moduleUrl.$this->handler->_page.'?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
433 433
         }
434 434
 
435 435
         if (!$onlyUrl) {
436
-            $ret = "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
436
+            $ret = "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
437 437
         }
438 438
 
439 439
         return $ret;
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
      */
448 448
     public function getEditLanguageLink($smartObj, $onlyUrl = false, $withimage = true)
449 449
     {
450
-        $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName) . '&language=' . $smartObj->getVar('language');
450
+        $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName).'&language='.$smartObj->getVar('language');
451 451
         if ($onlyUrl) {
452 452
             return $ret;
453 453
         } elseif ($withimage) {
454
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "wizard.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_LANGUAGE_MODIFY . "'  title='" . _CO_SOBJECT_LANGUAGE_MODIFY . "'></a>";
454
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."wizard.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_LANGUAGE_MODIFY."'  title='"._CO_SOBJECT_LANGUAGE_MODIFY."'></a>";
455 455
         }
456 456
 
457
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
457
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
458 458
     }
459 459
 
460 460
     /**
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
     public function getEditItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false)
468 468
     {
469 469
         $admin_side = $userSide ? '' : 'admin/';
470
-        $ret        = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
470
+        $ret        = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
471 471
         if ($onlyUrl) {
472 472
             return $ret;
473 473
         } elseif ($withimage) {
474
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "edit.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_MODIFY . "'  title='" . _CO_SOBJECT_MODIFY . "'></a>";
474
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."edit.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_MODIFY."'  title='"._CO_SOBJECT_MODIFY."'></a>";
475 475
         }
476 476
 
477
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
477
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
478 478
     }
479 479
 
480 480
     /**
@@ -487,14 +487,14 @@  discard block
 block discarded – undo
487 487
     public function getDeleteItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false)
488 488
     {
489 489
         $admin_side = $userSide ? '' : 'admin/';
490
-        $ret        = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=del&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
490
+        $ret        = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=del&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
491 491
         if ($onlyUrl) {
492 492
             return $ret;
493 493
         } elseif ($withimage) {
494
-            return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "editdelete.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_DELETE . "'  title='" . _CO_SOBJECT_DELETE . "'></a>";
494
+            return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."editdelete.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_DELETE."'  title='"._CO_SOBJECT_DELETE."'></a>";
495 495
         }
496 496
 
497
-        return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>';
497
+        return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>';
498 498
     }
499 499
 
500 500
     /**
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
     {
506 506
         global $xoopsConfig;
507 507
 
508
-        $printlink = $this->handler->_moduleUrl . 'print.php?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName);
509
-        $js        = "javascript:openWithSelfMain('" . $printlink . "', 'smartpopup', 700, 519);";
510
-        $printlink = '<a href="' . $js . '"><img  src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'fileprint.png" alt="" style="vertical-align: middle;"></a>';
508
+        $printlink = $this->handler->_moduleUrl.'print.php?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName);
509
+        $js        = "javascript:openWithSelfMain('".$printlink."', 'smartpopup', 700, 519);";
510
+        $printlink = '<a href="'.$js.'"><img  src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'fileprint.png" alt="" style="vertical-align: middle;"></a>';
511 511
 
512 512
         $smartModule = smart_getModuleInfo($smartObj->handler->_moduleName);
513 513
         $link        = smart_getCurrentPage();
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                        . _CO_SOBJECT_EMAIL
527 527
                        . '" style="vertical-align: middle;"></a>';
528 528
 
529
-        $ret = '<span id="smartobject_print_button">' . $printlink . '&nbsp;</span>' . '<span id="smartobject_mail_button">' . $friendlink . '</span>';
529
+        $ret = '<span id="smartobject_print_button">'.$printlink.'&nbsp;</span>'.'<span id="smartobject_mail_button">'.$friendlink.'</span>';
530 530
 
531 531
         return $ret;
532 532
     }
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
      */
537 537
     public function getModuleItemString()
538 538
     {
539
-        $ret = $this->handler->_moduleName . '_' . $this->handler->_itemname;
539
+        $ret = $this->handler->_moduleName.'_'.$this->handler->_itemname;
540 540
 
541 541
         return $ret;
542 542
     }
Please login to merge, or discard this patch.
class/Form/SmartObjectForm.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 use XoopsModules\Smartobject\Form\Elements\SmartFormSectionClose;
26 26
 use XoopsModules\Smartobject\Form\Elements\SmartFormUrlLinkElement;
27 27
 
28
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
28
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
29 29
 //require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsection.php';
30 30
 //require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsectionclose.php';
31 31
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $cancel_js_action = false,
71 71
         $captcha = false
72 72
     ) {
73
-        $this->targetObject           =& $target;
73
+        $this->targetObject           = & $target;
74 74
         $this->form_fields            = $form_fields;
75 75
         $this->_cancel_js_action      = $cancel_js_action;
76 76
         $this->_captcha               = $captcha;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     public function addCaptcha()
100 100
     {
101
-        require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/formcaptcha.php';
101
+        require_once SMARTOBJECT_ROOT_PATH.'include/captcha/formcaptcha.php';
102 102
         $this->addElement(new \XoopsFormCaptcha(), true);
103 103
     }
104 104
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function addCustomButton($name, $caption, $onclick = false)
111 111
     {
112
-        $custom_button_array    = [
112
+        $custom_button_array = [
113 113
             'name'    => $name,
114 114
             'caption' => $caption,
115 115
             'onclick' => $onclick
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         if ($key) {
131 131
             if ($this->targetObject->vars[$key]['readonly']) {
132 132
                 $formElement->setExtra('disabled="disabled"');
133
-                $formElement->setName($key . '-readonly');
133
+                $formElement->setName($key.'-readonly');
134 134
                 // Since this element is disable, we still want to pass it's value in the form
135 135
                 $hidden = new \XoopsFormHidden($key, $this->targetObject->vars[$key]['value']);
136 136
                 $this->addElement($hidden);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 $this->addElement($hidden);
142 142
                 $otherExtra      = isset($var['form_extra']) ? $var['form_extra'] : '';
143 143
                 $onchangedString = "this.form.elements.changedField.value='$key'; this.form.elements.op.value='changedField'; submit()";
144
-                $formElement->setExtra('onchange="' . $onchangedString . '"' . ' ' . $otherExtra);
144
+                $formElement->setExtra('onchange="'.$onchangedString.'"'.' '.$otherExtra);
145 145
             } else {
146 146
                 if (isset($var['form_extra'])) {
147 147
                     $formElement->setExtra($var['form_extra']);
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
             asort($group_list);
309 309
             foreach ($permissions as $permission) {
310 310
                 if ($this->targetObject->isNew()) {
311
-                    if (isset($smartModuleConfig['def_perm_' . $permission['perm_name']])) {
312
-                        $groups_value = $smartModuleConfig['def_perm_' . $permission['perm_name']];
311
+                    if (isset($smartModuleConfig['def_perm_'.$permission['perm_name']])) {
312
+                        $groups_value = $smartModuleConfig['def_perm_'.$permission['perm_name']];
313 313
                     }
314 314
                 } else {
315 315
                     $groups_value = $this->targetObject->getGroupPerm($permission['perm_name']);
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         } else {
342 342
             $butt_create = new \XoopsFormButton('', 'modify_button', $submit_button_caption, 'submit');
343 343
         }
344
-        $butt_create->setExtra('onclick="this.form.elements.op.value=\'' . $form_name . '\'"');
344
+        $butt_create->setExtra('onclick="this.form.elements.op.value=\''.$form_name.'\'"');
345 345
         $button_tray->addElement($butt_create);
346 346
 
347 347
         //creating custom buttons
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             foreach ($this->_custom_button as $custom_button) {
350 350
                 $butt_custom = new \XoopsFormButton('', $custom_button['name'], $custom_button['caption'], 'submit');
351 351
                 if ($custom_button['onclick']) {
352
-                    $butt_custom->setExtra('onclick="' . $custom_button['onclick'] . '"');
352
+                    $butt_custom->setExtra('onclick="'.$custom_button['onclick'].'"');
353 353
                 }
354 354
                 $button_tray->addElement($butt_custom);
355 355
                 unset($butt_custom);
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         // creating the "cancel" button
360 360
         $butt_cancel = new \XoopsFormButton('', 'cancel_button', _CO_SOBJECT_CANCEL, 'button');
361 361
         if ($this->_cancel_js_action) {
362
-            $butt_cancel->setExtra('onclick="' . $this->_cancel_js_action . '"');
362
+            $butt_cancel->setExtra('onclick="'.$this->_cancel_js_action.'"');
363 363
         } else {
364 364
             $butt_cancel->setExtra('onclick="history.go(-1)"');
365 365
         }
@@ -461,21 +461,21 @@  discard block
 block discarded – undo
461 461
                 break;
462 462
 
463 463
             default:
464
-                $classname = 'SmartForm' . ucfirst($controlName) . 'Element';
464
+                $classname = 'SmartForm'.ucfirst($controlName).'Element';
465 465
                 if (!class_exists($classname)) {
466
-                    if (file_exists(SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php')) {
466
+                    if (file_exists(SMARTOBJECT_ROOT_PATH.'class/form/elements/'.strtolower($classname).'.php')) {
467 467
 //                        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php';
468 468
                     } else {
469 469
                         // perhaps this is a control created by the module
470 470
                         $moduleName             = $this->targetObject->handler->_moduleName;
471
-                        $moduleFormElementsPath = $this->targetObject->handler->_modulePath . 'class/form/elements/';
472
-                        $classname              = ucfirst($moduleName) . ucfirst($controlName) . 'Element';
473
-                        $classFileName          = strtolower($classname) . '.php';
471
+                        $moduleFormElementsPath = $this->targetObject->handler->_modulePath.'class/form/elements/';
472
+                        $classname              = ucfirst($moduleName).ucfirst($controlName).'Element';
473
+                        $classFileName          = strtolower($classname).'.php';
474 474
 
475
-                        if (file_exists($moduleFormElementsPath . $classFileName)) {
475
+                        if (file_exists($moduleFormElementsPath.$classFileName)) {
476 476
 //                            require_once $moduleFormElementsPath . $classFileName;
477 477
                         } else {
478
-                            trigger_error($classname . ' Not found', E_USER_WARNING);
478
+                            trigger_error($classname.' Not found', E_USER_WARNING);
479 479
 
480 480
                             return new \XoopsFormLabel(); //Empty object
481 481
                         }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
         $editor_configs['height'] = '400px';
545 545
 
546 546
         $dhtml            = true;
547
-        $xoopseditorclass = XOOPS_ROOT_PATH . '/class/xoopsform/formeditor.php';
547
+        $xoopseditorclass = XOOPS_ROOT_PATH.'/class/xoopsform/formeditor.php';
548 548
 
549 549
         if (file_exists($xoopseditorclass)) {
550 550
             require_once $xoopseditorclass;
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
 
555 555
                 case 'tiny':
556 556
                     if (!$xoops22) {
557
-                        if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php')) {
558
-                            require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php';
557
+                        if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php')) {
558
+                            require_once XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php';
559 559
                             $editor = new \XoopsFormTinymce([
560 560
                                                                     'caption' => $caption,
561 561
                                                                     'name'    => $name,
@@ -662,10 +662,10 @@  discard block
 block discarded – undo
662 662
         $size         = $multiple ? 5 : 1;
663 663
         $theme_select = new \XoopsFormSelect($var['form_caption'], $key, $this->targetObject->getVar($key), $size, $multiple);
664 664
 
665
-        $handle  = opendir(XOOPS_THEME_PATH . '/');
665
+        $handle  = opendir(XOOPS_THEME_PATH.'/');
666 666
         $dirlist = [];
667 667
         while (false !== ($file = readdir($handle))) {
668
-            if (is_dir(XOOPS_THEME_PATH . '/' . $file) && !preg_match('/^[.]{1,2}$/', $file)
668
+            if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match('/^[.]{1,2}$/', $file)
669 669
                 && 'cvs' !== strtolower($file)) {
670 670
                 $dirlist[$file] = $file;
671 671
             }
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
     {
688 688
         foreach ($this->_elements as $eleObj) {
689 689
             if ($eleObj->getName() == $keyname) {
690
-                $ret =& $eleObj;
690
+                $ret = & $eleObj;
691 691
                 break;
692 692
             }
693 693
         }
@@ -704,9 +704,9 @@  discard block
 block discarded – undo
704 704
     {
705 705
         $required = $this->getRequired();
706 706
         $ret      = "
707
-            <form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "' onsubmit='return xoopsFormValidate_" . $this->getName() . "(this);'" . $this->getExtra() . ">
707
+            <form name='" . $this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' onsubmit='return xoopsFormValidate_".$this->getName()."(this);'".$this->getExtra().">
708 708
             <table width='100%' class='outer' cellspacing='1'>
709
-            <tr><th colspan='2'>" . $this->getTitle() . '</th></tr>
709
+            <tr><th colspan='2'>" . $this->getTitle().'</th></tr>
710 710
         ';
711 711
         $hidden   = '';
712 712
         $class    = 'even';
@@ -715,11 +715,11 @@  discard block
 block discarded – undo
715 715
                 $ret .= $ele;
716 716
             } elseif (!$ele->isHidden()) {
717 717
                 //$class = ( $class == 'even' ) ? 'odd': 'even';
718
-                $ret .= "<tr id='" . $ele->getName() . "' valign='top' align='left'><td class='head'>" . $ele->getCaption();
718
+                $ret .= "<tr id='".$ele->getName()."' valign='top' align='left'><td class='head'>".$ele->getCaption();
719 719
                 if ('' !== $ele->getDescription()) {
720
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $ele->getDescription() . '</span>';
720
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
721 721
                 }
722
-                $ret .= "</td><td class='$class'>" . $ele->render() . "</td></tr>\n";
722
+                $ret .= "</td><td class='$class'>".$ele->render()."</td></tr>\n";
723 723
             } else {
724 724
                 $hidden .= $ele->render();
725 725
             }
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
             'name'       => $this->getName(),
768 768
             'action'     => $this->getAction(),
769 769
             'method'     => $this->getMethod(),
770
-            'extra'      => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '(this);"' . $this->getExtra(),
770
+            'extra'      => 'onsubmit="return xoopsFormValidate_'.$this->getName().'(this);"'.$this->getExtra(),
771 771
             'javascript' => $js,
772 772
             'elements'   => $elements
773 773
         ]);
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
         }
786 786
         $myts     = \MyTextSanitizer::getInstance();
787 787
         $formname = $this->getName();
788
-        $js       .= "function xoopsFormValidate_{$formname}(myform) {";
788
+        $js .= "function xoopsFormValidate_{$formname}(myform) {";
789 789
         // First, output code to check required elements
790 790
         $elements = $this->getRequired();
791 791
         foreach ($elements as $elt) {
@@ -836,15 +836,15 @@  discard block
 block discarded – undo
836 836
                         window.alert(\"{$eltmsg}\"); myform['{$eltname}'][0].focus(); return false; }\n";
837 837
                 }
838 838
             } else {
839
-                $js .= "if ( myform.{$eltname}.value == \"\" ) " . "{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
839
+                $js .= "if ( myform.{$eltname}.value == \"\" ) "."{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
840 840
             }
841 841
         }
842 842
         // Now, handle custom validation code
843
-        $elements =& $this->getElements(true);
843
+        $elements = & $this->getElements(true);
844 844
         foreach ($elements as $elt) {
845 845
             if (method_exists($elt, 'renderValidationJS') && 'xoopsformcheckbox' !== strtolower(get_class($elt))) {
846 846
                 if ($eltjs = $elt->renderValidationJS()) {
847
-                    $js .= $eltjs . "\n";
847
+                    $js .= $eltjs."\n";
848 848
                 }
849 849
             }
850 850
         }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormParentCategoryElement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $categoryHandler = xoops_getModuleHandler('category', $object->handler->_moduleName);
32 32
         $categories      = $categoryHandler->getObjects($criteria);
33 33
 
34
-        require_once XOOPS_ROOT_PATH . '/class/tree.php';
34
+        require_once XOOPS_ROOT_PATH.'/class/tree.php';
35 35
         $mytree = new \XoopsObjectTree($categories, 'categoryid', 'parentid');
36 36
         parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
37 37
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     {
63 63
         if ($key > 0) {
64 64
             $value       = $tree->tree[$key]['obj']->getVar($tree->_myId);
65
-            $ret[$key]   = $prefix_curr . $tree->tree[$key]['obj']->getVar($fieldName);
65
+            $ret[$key]   = $prefix_curr.$tree->tree[$key]['obj']->getVar($fieldName);
66 66
             $prefix_curr .= '-';
67 67
         }
68 68
         if (isset($tree->tree[$key]['child']) && !empty($tree->tree[$key]['child'])) {
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormFileUploadElement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $this->SmartFormFileElement($object, $key);
30 30
         // Override name for upload purposes
31
-        $this->setName('upload_' . $key);
31
+        $this->setName('upload_'.$key);
32 32
     }
33 33
 
34 34
     /**
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function render()
40 40
     {
41
-        return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
42
-        <input type='file' name='upload_" . $this->getName() . "' id='upload_" . $this->getName() . "'" . $this->getExtra() . ">
43
-        <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'>";
41
+        return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'>
42
+        <input type='file' name='upload_" . $this->getName()."' id='upload_".$this->getName()."'".$this->getExtra().">
43
+        <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."'>";
44 44
     }
45 45
 }
Please login to merge, or discard this patch.