Completed
Push — master ( bf34f3...88111b )
by Michael
03:08
created
class/Form/Elements/SmartFormRichFileElement.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,28 +29,28 @@
 block discarded – undo
29 29
         parent::__construct($form_caption, ' ');
30 30
         if ('' !== $object->getVar('url')) {
31 31
             $caption = '' !== $object->getVar('caption') ? $object->getVar('caption') : $object->getVar('url');
32
-            $this->addElement(new \XoopsFormLabel('', _CO_SOBJECT_CURRENT_FILE . "<a href='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar('url')) . "' target='_blank' >" . $caption . '</a><br><br>'));
32
+            $this->addElement(new \XoopsFormLabel('', _CO_SOBJECT_CURRENT_FILE."<a href='".str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar('url'))."' target='_blank' >".$caption.'</a><br><br>'));
33 33
             //$this->addElement( new \XoopsFormLabel( '', "<br><a href = '".SMARTOBJECT_URL."admin/file.php?op=del&fileid=".$object->id()."'>"._CO_SOBJECT_DELETE_FILE."</a>"));
34 34
         }
35 35
 
36 36
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php';
37 37
         if ($object->isNew()) {
38 38
             $this->addElement(new SmartFormFileUploadElement($object, $key));
39
-            $this->addElement(new \XoopsFormLabel('', '<br><br><small>' . _CO_SOBJECT_URL_FILE_DSC . '</small>'));
40
-            $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE));
41
-            $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
39
+            $this->addElement(new \XoopsFormLabel('', '<br><br><small>'._CO_SOBJECT_URL_FILE_DSC.'</small>'));
40
+            $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE));
41
+            $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
42 42
         }
43
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CAPTION));
44
-        $this->addElement(new SmartFormTextElement($object, 'caption_' . $key));
45
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_DESC . '<br>'));
46
-        $this->addElement(new \XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description')));
43
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_CAPTION));
44
+        $this->addElement(new SmartFormTextElement($object, 'caption_'.$key));
45
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_DESC.'<br>'));
46
+        $this->addElement(new \XoopsFormTextArea('', 'desc_'.$key, $object->getVar('description')));
47 47
 
48 48
         if (!$object->isNew()) {
49
-            $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CHANGE_FILE));
49
+            $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_CHANGE_FILE));
50 50
             $this->addElement(new SmartFormFileUploadElement($object, $key));
51
-            $this->addElement(new \XoopsFormLabel('', '<br><br><small>' . _CO_SOBJECT_URL_FILE_DSC . '</small>'));
52
-            $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE));
53
-            $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
51
+            $this->addElement(new \XoopsFormLabel('', '<br><br><small>'._CO_SOBJECT_URL_FILE_DSC.'</small>'));
52
+            $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE));
53
+            $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
54 54
         }
55 55
     }
56 56
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormUserSigElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         $var     = $object->vars[$key];
30 30
         $control = $object->controls[$key];
31 31
 
32
-        parent::__construct($var['form_caption'], '<br><br>', $key . '_signature_tray');
32
+        parent::__construct($var['form_caption'], '<br><br>', $key.'_signature_tray');
33 33
 
34 34
         $signature_textarea = new \XoopsFormDhtmlTextArea('', $key, $object->getVar($key, 'e'));
35 35
         $this->addElement($signature_textarea);
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormImageUploadElement.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='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . ">
43
-        <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='" . $this->getName() . "'>";
41
+        return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'>
42
+        <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra().">
43
+        <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='" . $this->getName()."'>";
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormUrlLinkElement.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,18 +28,18 @@
 block discarded – undo
28 28
     {
29 29
         parent::__construct($form_caption, '&nbsp;');
30 30
 
31
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_URL));
32
-        $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
31
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_URLLINK_URL));
32
+        $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
33 33
 
34
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CAPTION));
35
-        $this->addElement(new SmartFormTextElement($object, 'caption_' . $key));
34
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_CAPTION));
35
+        $this->addElement(new SmartFormTextElement($object, 'caption_'.$key));
36 36
 
37
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_DESC . '<br>'));
38
-        $this->addElement(new \XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description')));
37
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_DESC.'<br>'));
38
+        $this->addElement(new \XoopsFormTextArea('', 'desc_'.$key, $object->getVar('description')));
39 39
 
40
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_TARGET));
40
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_URLLINK_TARGET));
41 41
         $targ_val    = $object->getVar('target');
42
-        $targetRadio = new \XoopsFormRadio('', 'target_' . $key, '' !== $targ_val ? $targ_val : '_blank');
42
+        $targetRadio = new \XoopsFormRadio('', 'target_'.$key, '' !== $targ_val ? $targ_val : '_blank');
43 43
         $control     = $object->getControl('target');
44 44
         $targetRadio->addOptionArray($control['options']);
45 45
 
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormImageElement.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,23 +34,23 @@
 block discarded – undo
34 34
         if ('' !== $object->getVar($key)
35 35
             && (0 === strpos($object->getVar($key), 'http')
36 36
                 || 0 === strpos($object->getVar($key), '{XOOPS_URL}'))) {
37
-            $this->addElement(new \XoopsFormLabel('', "<img src='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key)) . "' alt=''><br><br>"));
37
+            $this->addElement(new \XoopsFormLabel('', "<img src='".str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key))."' alt=''><br><br>"));
38 38
         } elseif ('' !== $object->getVar($key)) {
39
-            $this->addElement(new \XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt=''><br><br>"));
39
+            $this->addElement(new \XoopsFormLabel('', "<img src='".$object_imageurl.$object->getVar($key)."' alt=''><br><br>"));
40 40
         }
41 41
 
42 42
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php';
43 43
         $this->addElement(new SmartFormFileUploadElement($object, $key));
44 44
 
45
-        $this->addElement(new \XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">' . _CO_SOBJECT_URL_FILE_DSC . '</div>', ''));
45
+        $this->addElement(new \XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">'._CO_SOBJECT_URL_FILE_DSC.'</div>', ''));
46 46
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformtextelement.php';
47 47
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php';
48 48
 
49
-        $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE));
50
-        $this->addElement(new SmartFormTextElement($object, 'url_' . $key));
49
+        $this->addElement(new \XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE));
50
+        $this->addElement(new SmartFormTextElement($object, 'url_'.$key));
51 51
         $this->addElement(new \XoopsFormLabel('', '<br><br>'));
52
-        $delete_check = new SmartFormCheckElement('', 'delete_' . $key);
53
-        $delete_check->addOption(1, '<span style="color:red;">' . _CO_SOBJECT_DELETE . '</span>');
52
+        $delete_check = new SmartFormCheckElement('', 'delete_'.$key);
53
+        $delete_check->addOption(1, '<span style="color:red;">'._CO_SOBJECT_DELETE.'</span>');
54 54
         $this->addElement($delete_check);
55 55
     }
56 56
 }
Please login to merge, or discard this patch.
class/SmartobjectRatingHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function __construct(\XoopsDatabase $db)
43 43
     {
44 44
         parent::__construct($db, 'rating', 'ratingid', 'rate', '', 'smartobject');
45
-        $this->generalSQL = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->db->prefix('users') . ' AS user ON ' . $this->_itemname . '.uid=user.uid';
45
+        $this->generalSQL = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname.' INNER JOIN '.$this->db->prefix('users').' AS user ON '.$this->_itemname.'.uid=user.uid';
46 46
 
47 47
         $this->_rateOptions[1] = 1;
48 48
         $this->_rateOptions[2] = 2;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function getRatingAverageByItemId($itemid, $dirname, $item)
87 87
     {
88
-        $sql    = 'SELECT AVG(rate), COUNT(ratingid) FROM ' . $this->table . " WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid";
88
+        $sql    = 'SELECT AVG(rate), COUNT(ratingid) FROM '.$this->table." WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid";
89 89
         $result = $this->db->query($sql);
90 90
         if (!$result) {
91 91
             return 0;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $criteria->add(new \Criteria('dirname', $dirname));
113 113
         $criteria->add(new \Criteria('user.uid', $uid));
114 114
 
115
-        $ret =& $this->getObjects($criteria);
115
+        $ret = & $this->getObjects($criteria);
116 116
 
117 117
         if (!$ret) {
118 118
             return false;
Please login to merge, or discard this patch.
class/SmartPluginHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getPlugin($dirname)
37 37
     {
38
-        $pluginName = SMARTOBJECT_ROOT_PATH . 'plugins/' . $dirname . '.php';
38
+        $pluginName = SMARTOBJECT_ROOT_PATH.'plugins/'.$dirname.'.php';
39 39
         if (file_exists($pluginName)) {
40 40
             require_once $pluginName;
41
-            $function = 'smartobject_plugin_' . $dirname;
41
+            $function = 'smartobject_plugin_'.$dirname;
42 42
             if (function_exists($function)) {
43 43
                 $array = $function();
44 44
                 $ret   = new SmartPlugin($array);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function getPluginsArray()
57 57
     {
58
-        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
58
+        require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
59 59
 
60 60
         $moduleHandler = xoops_getHandler('module');
61 61
         $criteria      = new \CriteriaCompo();
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
             $modulesObj[$moduleObj->getVar('dirname')] = $moduleObj;
67 67
         }
68 68
 
69
-        $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/');
69
+        $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH.'plugins/');
70 70
         $ret    = [];
71 71
         foreach ($aFiles as $file) {
72 72
             if ('.php' === substr($file, strlen($file) - 4, 4)) {
73 73
                 $pluginName                = str_replace('.php', '', $file);
74
-                $module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/$pluginName/xoops_version.php";
74
+                $module_xoops_version_file = XOOPS_ROOT_PATH."/modules/$pluginName/xoops_version.php";
75 75
                 if (file_exists($module_xoops_version_file) && isset($modulesObj[$pluginName])) {
76 76
                     $ret[$pluginName] = $modulesObj[$pluginName]->getVar('name');
77 77
                 }
Please login to merge, or discard this patch.
class/SmartMlObject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function stripMultilanguageFields()
55 55
     {
56
-        $objectVars    =& $this->getVars();
56
+        $objectVars    = & $this->getVars();
57 57
         $newObjectVars = [];
58 58
         foreach ($objectVars as $key => $var) {
59 59
             if (!$var['multilingual']) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function stripNonMultilanguageFields()
67 67
     {
68
-        $objectVars    =& $this->getVars();
68
+        $objectVars    = & $this->getVars();
69 69
         $newObjectVars = [];
70 70
         foreach ($objectVars as $key => $var) {
71 71
             if ($var['multilingual'] || $key == $this->handler->keyName) {
Please login to merge, or discard this patch.
class/Helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     protected function __construct($debug = false)
35 35
     {
36
-        $this->debug   = $debug;
36
+        $this->debug = $debug;
37 37
        parent::__construct(basename(dirname(__DIR__)));
38 38
     }
39 39
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $ret   = false;
73 73
         $db    = \XoopsDatabaseFactory::getDatabaseConnection();
74
-        $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler';
74
+        $class = '\\XoopsModules\\'.ucfirst(strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler';
75 75
         $ret   = new $class($db);
76 76
         return $ret;
77 77
     }
Please login to merge, or discard this patch.