Completed
Push — master ( bf34f3...88111b )
by Michael
03:08
created
class/Form/Elements/SmartFormYesnoElement.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@
 block discarded – undo
18 18
  */
19 19
 class SmartFormYesnoElement extends \XoopsFormRadioYN
20 20
 {
21
-    /**
22
-     * SmartFormYesnoElement constructor.
23
-     * @param string $object
24
-     * @param string $key
25
-     */
26
-    public function __construct($object, $key)
27
-    {
28
-        parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
29
-    }
21
+	/**
22
+	 * SmartFormYesnoElement constructor.
23
+	 * @param string $object
24
+	 * @param string $key
25
+	 */
26
+	public function __construct($object, $key)
27
+	{
28
+		parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
29
+	}
30 30
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartAutocompleteElement.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -18,38 +18,38 @@
 block discarded – undo
18 18
  */
19 19
 class SmartAutocompleteElement extends \XoopsFormText
20 20
 {
21
-    public $_include_file;
22
-
23
-    /**
24
-     * SmartAutocompleteElement constructor.
25
-     * @param string $caption
26
-     * @param string $name
27
-     * @param int    $include_file
28
-     * @param int    $size
29
-     * @param string $maxlength
30
-     * @param string $value
31
-     */
32
-    public function __construct($caption, $name, $include_file, $size, $maxlength, $value = '')
33
-    {
34
-        $this->_include_file = $include_file;
35
-        parent::__construct($caption, $name, $size, $maxlength, $value);
36
-    }
37
-
38
-    /**
39
-     * Prepare HTML for output
40
-     *
41
-     * @return string HTML
42
-     */
43
-    public function render()
44
-    {
45
-        $ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . '>';
46
-
47
-        $ret .= '   <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div>
21
+	public $_include_file;
22
+
23
+	/**
24
+	 * SmartAutocompleteElement constructor.
25
+	 * @param string $caption
26
+	 * @param string $name
27
+	 * @param int    $include_file
28
+	 * @param int    $size
29
+	 * @param string $maxlength
30
+	 * @param string $value
31
+	 */
32
+	public function __construct($caption, $name, $include_file, $size, $maxlength, $value = '')
33
+	{
34
+		$this->_include_file = $include_file;
35
+		parent::__construct($caption, $name, $size, $maxlength, $value);
36
+	}
37
+
38
+	/**
39
+	 * Prepare HTML for output
40
+	 *
41
+	 * @return string HTML
42
+	 */
43
+	public function render()
44
+	{
45
+		$ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . '>';
46
+
47
+		$ret .= '   <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div>
48 48
 
49 49
     <script type="text/javascript">
50 50
         new Ajax.Autocompleter("' . $this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '");
51 51
     </script>';
52 52
 
53
-        return $ret;
54
-    }
53
+		return $ret;
54
+	}
55 55
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@
 block discarded – undo
35 35
      */
36 36
     public function render()
37 37
     {
38
-        $ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . '>';
38
+        $ret = "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra().'>';
39 39
 
40
-        $ret .= '   <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div>
40
+        $ret .= '   <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint'.$this->getName().'"></div>
41 41
 
42 42
     <script type="text/javascript">
43
-        new Ajax.Autocompleter("' . $this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '");
43
+        new Ajax.Autocompleter("' . $this->getName().'","smartobject_autocomplete_hint'.$this->getName().'","'.$this->_include_file.'?key='.$this->getName().'");
44 44
     </script>';
45 45
 
46 46
         return $ret;
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormAutocompleteElement.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,18 +18,18 @@
 block discarded – undo
18 18
  */
19 19
 class SmartFormAutocompleteElement extends Smartobject\Form\Elements\SmartAutocompleteElement
20 20
 {
21
-    /**
22
-     * SmartFormAutocompleteElement constructor.
23
-     * @param string $object
24
-     * @param string $key
25
-     */
26
-    public function __construct($object, $key)
27
-    {
28
-        $var            = $object->vars[$key];
29
-        $control        = $object->controls[$key];
30
-        $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255);
21
+	/**
22
+	 * SmartFormAutocompleteElement constructor.
23
+	 * @param string $object
24
+	 * @param string $key
25
+	 */
26
+	public function __construct($object, $key)
27
+	{
28
+		$var            = $object->vars[$key];
29
+		$control        = $object->controls[$key];
30
+		$form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255);
31 31
 
32
-        $form_size = isset($control['size']) ? $control['size'] : 50;
33
-        parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e'));
34
-    }
32
+		$form_size = isset($control['size']) ? $control['size'] : 50;
33
+		parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e'));
34
+	}
35 35
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormSelectMultiElement.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
  */
20 20
 class SmartFormSelectMultiElement extends Smartobject\Form\Elements\SmartFormSelectElement
21 21
 {
22
-    /**
23
-     * SmartFormSelectMultiElement constructor.
24
-     * @param string $object
25
-     * @param string $key
26
-     */
27
-    public function __construct($object, $key)
28
-    {
29
-        $this->multiple = true;
30
-        parent::__construct($object, $key);
31
-    }
22
+	/**
23
+	 * SmartFormSelectMultiElement constructor.
24
+	 * @param string $object
25
+	 * @param string $key
26
+	 */
27
+	public function __construct($object, $key)
28
+	{
29
+		$this->multiple = true;
30
+		parent::__construct($object, $key);
31
+	}
32 32
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormTimeElement.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,23 +18,23 @@
 block discarded – undo
18 18
  */
19 19
 class SmartFormTimeElement extends \XoopsFormSelect
20 20
 {
21
-    /**
22
-     * SmartFormTimeElement constructor.
23
-     * @param string $object
24
-     * @param string $key
25
-     */
26
-    public function __construct($object, $key)
27
-    {
28
-        $var       = $object->vars[$key];
29
-        $timearray = [];
30
-        for ($i = 0; $i < 24; ++$i) {
31
-            for ($j = 0; $j < 60; $j += 10) {
32
-                $key_t             = ($i * 3600) + ($j * 60);
33
-                $timearray[$key_t] = (0 != $j) ? $i . ':' . $j : $i . ':0' . $j;
34
-            }
35
-        }
36
-        ksort($timearray);
37
-        parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
38
-        $this->addOptionArray($timearray);
39
-    }
21
+	/**
22
+	 * SmartFormTimeElement constructor.
23
+	 * @param string $object
24
+	 * @param string $key
25
+	 */
26
+	public function __construct($object, $key)
27
+	{
28
+		$var       = $object->vars[$key];
29
+		$timearray = [];
30
+		for ($i = 0; $i < 24; ++$i) {
31
+			for ($j = 0; $j < 60; $j += 10) {
32
+				$key_t             = ($i * 3600) + ($j * 60);
33
+				$timearray[$key_t] = (0 != $j) ? $i . ':' . $j : $i . ':0' . $j;
34
+			}
35
+		}
36
+		ksort($timearray);
37
+		parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
38
+		$this->addOptionArray($timearray);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         for ($i = 0; $i < 24; ++$i) {
24 24
             for ($j = 0; $j < 60; $j += 10) {
25 25
                 $key_t             = ($i * 3600) + ($j * 60);
26
-                $timearray[$key_t] = (0 != $j) ? $i . ':' . $j : $i . ':0' . $j;
26
+                $timearray[$key_t] = (0 != $j) ? $i.':'.$j : $i.':0'.$j;
27 27
             }
28 28
         }
29 29
         ksort($timearray);
Please login to merge, or discard this patch.
class/Form/Elements/smartformdateelement.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
  */
18 18
 class SmartFormDateElement extends \XoopsFormTextDateSelect
19 19
 {
20
-    /**
21
-     * SmartFormDateElement constructor.
22
-     * @param $object
23
-     * @param $key
24
-     */
25
-    public function __construct($object, $key)
26
-    {
27
-        parent::__construct($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e'));
28
-    }
20
+	/**
21
+	 * SmartFormDateElement constructor.
22
+	 * @param $object
23
+	 * @param $key
24
+	 */
25
+	public function __construct($object, $key)
26
+	{
27
+		parent::__construct($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e'));
28
+	}
29 29
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormLanguageElement.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@
 block discarded – undo
18 18
  */
19 19
 class SmartFormLanguageElement extends \XoopsFormSelectLang
20 20
 {
21
-    /**
22
-     * SmartFormLanguageElement constructor.
23
-     * @param string $object
24
-     * @param string $key
25
-     */
26
-    public function __construct($object, $key)
27
-    {
28
-        $var     = $object->vars[$key];
29
-        $control = $object->controls[$key];
30
-        $all     = isset($control['all']) ? true : false;
21
+	/**
22
+	 * SmartFormLanguageElement constructor.
23
+	 * @param string $object
24
+	 * @param string $key
25
+	 */
26
+	public function __construct($object, $key)
27
+	{
28
+		$var     = $object->vars[$key];
29
+		$control = $object->controls[$key];
30
+		$all     = isset($control['all']) ? true : false;
31 31
 
32
-        parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
33
-        if ($all) {
34
-            $this->addOption('all', _ALL);
35
-        }
36
-    }
32
+		parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
33
+		if ($all) {
34
+			$this->addOption('all', _ALL);
35
+		}
36
+	}
37 37
 }
Please login to merge, or discard this patch.
class/Form/Elements/SmartFormParentCategoryElement.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -18,59 +18,59 @@
 block discarded – undo
18 18
  */
19 19
 class SmartFormParentCategoryElement extends \XoopsFormSelect
20 20
 {
21
-    /**
22
-     * SmartFormParentcategoryElement constructor.
23
-     * @param string $object
24
-     * @param string $key
25
-     */
26
-    public function __construct($object, $key)
27
-    {
28
-        $addNoParent = isset($object->controls[$key]['addNoParent']) ? $object->controls[$key]['addNoParent'] : true;
29
-        $criteria    = new \CriteriaCompo();
30
-        $criteria->setSort('weight, name');
31
-        $categoryHandler = xoops_getModuleHandler('category', $object->handler->_moduleName);
32
-        $categories      = $categoryHandler->getObjects($criteria);
21
+	/**
22
+	 * SmartFormParentcategoryElement constructor.
23
+	 * @param string $object
24
+	 * @param string $key
25
+	 */
26
+	public function __construct($object, $key)
27
+	{
28
+		$addNoParent = isset($object->controls[$key]['addNoParent']) ? $object->controls[$key]['addNoParent'] : true;
29
+		$criteria    = new \CriteriaCompo();
30
+		$criteria->setSort('weight, name');
31
+		$categoryHandler = xoops_getModuleHandler('category', $object->handler->_moduleName);
32
+		$categories      = $categoryHandler->getObjects($criteria);
33 33
 
34
-        require_once XOOPS_ROOT_PATH . '/class/tree.php';
35
-        $mytree = new \XoopsObjectTree($categories, 'categoryid', 'parentid');
36
-        parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
34
+		require_once XOOPS_ROOT_PATH . '/class/tree.php';
35
+		$mytree = new \XoopsObjectTree($categories, 'categoryid', 'parentid');
36
+		parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
37 37
 
38
-        $ret     = [];
39
-        $options = $this->getOptionArray($mytree, 'name', 0, '', $ret);
40
-        if ($addNoParent) {
41
-            $newOptions = ['0' => '----'];
42
-            foreach ($options as $k => $v) {
43
-                $newOptions[$k] = $v;
44
-            }
45
-            $options = $newOptions;
46
-        }
47
-        $this->addOptionArray($options);
48
-    }
38
+		$ret     = [];
39
+		$options = $this->getOptionArray($mytree, 'name', 0, '', $ret);
40
+		if ($addNoParent) {
41
+			$newOptions = ['0' => '----'];
42
+			foreach ($options as $k => $v) {
43
+				$newOptions[$k] = $v;
44
+			}
45
+			$options = $newOptions;
46
+		}
47
+		$this->addOptionArray($options);
48
+	}
49 49
 
50
-    /**
51
-     * Get options for a category select with hierarchy (recursive)
52
-     *
53
-     * @param \XoopsObjectTree $tree
54
-     * @param string          $fieldName
55
-     * @param int             $key
56
-     * @param string          $prefix_curr
57
-     * @param array           $ret
58
-     *
59
-     * @return array
60
-     */
61
-    public function getOptionArray($tree, $fieldName, $key, $prefix_curr = '', &$ret)
62
-    {
63
-        if ($key > 0) {
64
-            $value       = $tree->tree[$key]['obj']->getVar($tree->_myId);
65
-            $ret[$key]   = $prefix_curr . $tree->tree[$key]['obj']->getVar($fieldName);
66
-            $prefix_curr .= '-';
67
-        }
68
-        if (isset($tree->tree[$key]['child']) && !empty($tree->tree[$key]['child'])) {
69
-            foreach ($tree->tree[$key]['child'] as $childkey) {
70
-                $this->getOptionArray($tree, $fieldName, $childkey, $prefix_curr, $ret);
71
-            }
72
-        }
50
+	/**
51
+	 * Get options for a category select with hierarchy (recursive)
52
+	 *
53
+	 * @param \XoopsObjectTree $tree
54
+	 * @param string          $fieldName
55
+	 * @param int             $key
56
+	 * @param string          $prefix_curr
57
+	 * @param array           $ret
58
+	 *
59
+	 * @return array
60
+	 */
61
+	public function getOptionArray($tree, $fieldName, $key, $prefix_curr = '', &$ret)
62
+	{
63
+		if ($key > 0) {
64
+			$value       = $tree->tree[$key]['obj']->getVar($tree->_myId);
65
+			$ret[$key]   = $prefix_curr . $tree->tree[$key]['obj']->getVar($fieldName);
66
+			$prefix_curr .= '-';
67
+		}
68
+		if (isset($tree->tree[$key]['child']) && !empty($tree->tree[$key]['child'])) {
69
+			foreach ($tree->tree[$key]['child'] as $childkey) {
70
+				$this->getOptionArray($tree, $fieldName, $childkey, $prefix_curr, $ret);
71
+			}
72
+		}
73 73
 
74
-        return $ret;
75
-    }
74
+		return $ret;
75
+	}
76 76
 }
Please login to merge, or discard this 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/SmartFormFileElement.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -7,38 +7,38 @@
 block discarded – undo
7 7
  */
8 8
 class SmartFormFileElement extends \XoopsFormFile
9 9
 {
10
-    public $object;
11
-    public $key;
10
+	public $object;
11
+	public $key;
12 12
 
13
-    /**
14
-     * SmartFormFileElement constructor.
15
-     * @param string $object
16
-     * @param string $key
17
-     */
18
-    public function __construct($object, $key)
19
-    {
20
-        $this->object = $object;
21
-        $this->key    = $key;
22
-        parent::__construct($object->vars[$key]['form_caption'], $key, isset($object->vars[$key]['form_maxfilesize']) ? $object->vars[$key]['form_maxfilesize'] : 0);
23
-        $this->setExtra(' size=50');
24
-    }
13
+	/**
14
+	 * SmartFormFileElement constructor.
15
+	 * @param string $object
16
+	 * @param string $key
17
+	 */
18
+	public function __construct($object, $key)
19
+	{
20
+		$this->object = $object;
21
+		$this->key    = $key;
22
+		parent::__construct($object->vars[$key]['form_caption'], $key, isset($object->vars[$key]['form_maxfilesize']) ? $object->vars[$key]['form_maxfilesize'] : 0);
23
+		$this->setExtra(' size=50');
24
+	}
25 25
 
26
-    /**
27
-     * prepare HTML for output
28
-     *
29
-     * @return string HTML
30
-     */
31
-    public function render()
32
-    {
33
-        $ret = '';
34
-        if ('' !== $this->object->getVar($this->key)) {
35
-            $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>';
36
-        }
26
+	/**
27
+	 * prepare HTML for output
28
+	 *
29
+	 * @return string HTML
30
+	 */
31
+	public function render()
32
+	{
33
+		$ret = '';
34
+		if ('' !== $this->object->getVar($this->key)) {
35
+			$ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>';
36
+		}
37 37
 
38
-        $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
38
+		$ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
39 39
                 <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . ">
40 40
                 <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'></div>";
41 41
 
42
-        return $ret;
43
-    }
42
+		return $ret;
43
+	}
44 44
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
     {
31 31
         $ret = '';
32 32
         if ('' !== $this->object->getVar($this->key)) {
33
-            $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>';
33
+            $ret .= '<div>'._CO_SOBJECT_CURRENT_FILE.$this->object->getVar($this->key).'</div>';
34 34
         }
35 35
 
36
-        $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'>
37
-                <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . ">
38
-                <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'></div>";
36
+        $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'>
37
+                <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra().">
38
+                <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."'></div>";
39 39
 
40 40
         return $ret;
41 41
     }
Please login to merge, or discard this patch.