@@ -11,59 +11,59 @@ |
||
11 | 11 | */ |
12 | 12 | class SmartFormSelectElement extends XoopsFormSelect |
13 | 13 | { |
14 | - public $multiple = false; |
|
14 | + public $multiple = false; |
|
15 | 15 | |
16 | - /** |
|
17 | - * SmartFormSelectElement constructor. |
|
18 | - * @param string $object |
|
19 | - * @param string $key |
|
20 | - */ |
|
21 | - public function __construct($object, $key) |
|
22 | - { |
|
23 | - $var = $object->vars[$key]; |
|
24 | - $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
16 | + /** |
|
17 | + * SmartFormSelectElement constructor. |
|
18 | + * @param string $object |
|
19 | + * @param string $key |
|
20 | + */ |
|
21 | + public function __construct($object, $key) |
|
22 | + { |
|
23 | + $var = $object->vars[$key]; |
|
24 | + $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
25 | 25 | |
26 | - // Adding the options inside this SelectBox |
|
27 | - // If the custom method is not from a module, than it's from the core |
|
28 | - $control = $object->getControl($key); |
|
26 | + // Adding the options inside this SelectBox |
|
27 | + // If the custom method is not from a module, than it's from the core |
|
28 | + $control = $object->getControl($key); |
|
29 | 29 | |
30 | - $value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e'); |
|
30 | + $value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e'); |
|
31 | 31 | |
32 | - parent::__construct($var['form_caption'], $key, $value, $size, $this->multiple); |
|
32 | + parent::__construct($var['form_caption'], $key, $value, $size, $this->multiple); |
|
33 | 33 | |
34 | - if (isset($control['options'])) { |
|
35 | - $this->addOptionArray($control['options']); |
|
36 | - } else { |
|
37 | - // let's find if the method we need to call comes from an already defined object |
|
38 | - if (isset($control['object'])) { |
|
39 | - if (method_exists($control['object'], $control['method'])) { |
|
40 | - if ($option_array = $control['object']->{$control['method']}()) { |
|
41 | - // Adding the options array to the XoopsFormSelect |
|
42 | - $this->addOptionArray($option_array); |
|
43 | - } |
|
44 | - } |
|
45 | - } else { |
|
46 | - // finding the itemHandler; if none, let's take the itemHandler of the $object |
|
47 | - if (isset($control['itemHandler'])) { |
|
48 | - if (!$control['module']) { |
|
49 | - // Creating the specified core object handler |
|
50 | - $controlHandler = xoops_getHandler($control['itemHandler']); |
|
51 | - } else { |
|
52 | - $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
|
53 | - } |
|
54 | - } else { |
|
55 | - $controlHandler =& $object->handler; |
|
56 | - } |
|
34 | + if (isset($control['options'])) { |
|
35 | + $this->addOptionArray($control['options']); |
|
36 | + } else { |
|
37 | + // let's find if the method we need to call comes from an already defined object |
|
38 | + if (isset($control['object'])) { |
|
39 | + if (method_exists($control['object'], $control['method'])) { |
|
40 | + if ($option_array = $control['object']->{$control['method']}()) { |
|
41 | + // Adding the options array to the XoopsFormSelect |
|
42 | + $this->addOptionArray($option_array); |
|
43 | + } |
|
44 | + } |
|
45 | + } else { |
|
46 | + // finding the itemHandler; if none, let's take the itemHandler of the $object |
|
47 | + if (isset($control['itemHandler'])) { |
|
48 | + if (!$control['module']) { |
|
49 | + // Creating the specified core object handler |
|
50 | + $controlHandler = xoops_getHandler($control['itemHandler']); |
|
51 | + } else { |
|
52 | + $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
|
53 | + } |
|
54 | + } else { |
|
55 | + $controlHandler =& $object->handler; |
|
56 | + } |
|
57 | 57 | |
58 | - // Checking if the specified method exists |
|
59 | - if (method_exists($controlHandler, $control['method'])) { |
|
60 | - // TODO: How could I pass the parameters in the following call ... |
|
61 | - if ($option_array = $controlHandler->{$control['method']}()) { |
|
62 | - // Adding the options array to the XoopsFormSelect |
|
63 | - $this->addOptionArray($option_array); |
|
64 | - } |
|
65 | - } |
|
66 | - } |
|
67 | - } |
|
68 | - } |
|
58 | + // Checking if the specified method exists |
|
59 | + if (method_exists($controlHandler, $control['method'])) { |
|
60 | + // TODO: How could I pass the parameters in the following call ... |
|
61 | + if ($option_array = $controlHandler->{$control['method']}()) { |
|
62 | + // Adding the options array to the XoopsFormSelect |
|
63 | + $this->addOptionArray($option_array); |
|
64 | + } |
|
65 | + } |
|
66 | + } |
|
67 | + } |
|
68 | + } |
|
69 | 69 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
48 | 48 | } |
49 | 49 | } else { |
50 | - $controlHandler =& $object->handler; |
|
50 | + $controlHandler = & $object->handler; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // Checking if the specified method exists |
@@ -11,36 +11,36 @@ |
||
11 | 11 | */ |
12 | 12 | class SmartFormUserElement extends XoopsFormSelect |
13 | 13 | { |
14 | - public $multiple = false; |
|
14 | + public $multiple = false; |
|
15 | 15 | |
16 | - /** |
|
17 | - * SmartFormUserElement constructor. |
|
18 | - * @param string $object |
|
19 | - * @param string $key |
|
20 | - */ |
|
21 | - public function __construct($object, $key) |
|
22 | - { |
|
23 | - $var = $object->vars[$key]; |
|
24 | - $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
16 | + /** |
|
17 | + * SmartFormUserElement constructor. |
|
18 | + * @param string $object |
|
19 | + * @param string $key |
|
20 | + */ |
|
21 | + public function __construct($object, $key) |
|
22 | + { |
|
23 | + $var = $object->vars[$key]; |
|
24 | + $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
25 | 25 | |
26 | - parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $size, $this->multiple); |
|
26 | + parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $size, $this->multiple); |
|
27 | 27 | |
28 | - // Adding the options inside this SelectBox |
|
29 | - // If the custom method is not from a module, than it's from the core |
|
30 | - $control = $object->getControl($key); |
|
28 | + // Adding the options inside this SelectBox |
|
29 | + // If the custom method is not from a module, than it's from the core |
|
30 | + $control = $object->getControl($key); |
|
31 | 31 | |
32 | - global $xoopsDB; |
|
33 | - $ret = array(); |
|
34 | - $limit = $start = 0; |
|
35 | - $sql = 'SELECT uid, uname FROM ' . $xoopsDB->prefix('users'); |
|
36 | - $sql .= ' ORDER BY uname ASC'; |
|
32 | + global $xoopsDB; |
|
33 | + $ret = array(); |
|
34 | + $limit = $start = 0; |
|
35 | + $sql = 'SELECT uid, uname FROM ' . $xoopsDB->prefix('users'); |
|
36 | + $sql .= ' ORDER BY uname ASC'; |
|
37 | 37 | |
38 | - $result = $xoopsDB->query($sql); |
|
39 | - if ($result) { |
|
40 | - while ($myrow = $xoopsDB->fetchArray($result)) { |
|
41 | - $uArray[$myrow['uid']] = $myrow['uname']; |
|
42 | - } |
|
43 | - } |
|
44 | - $this->addOptionArray($uArray); |
|
45 | - } |
|
38 | + $result = $xoopsDB->query($sql); |
|
39 | + if ($result) { |
|
40 | + while ($myrow = $xoopsDB->fetchArray($result)) { |
|
41 | + $uArray[$myrow['uid']] = $myrow['uname']; |
|
42 | + } |
|
43 | + } |
|
44 | + $this->addOptionArray($uArray); |
|
45 | + } |
|
46 | 46 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | global $xoopsDB; |
33 | 33 | $ret = array(); |
34 | 34 | $limit = $start = 0; |
35 | - $sql = 'SELECT uid, uname FROM ' . $xoopsDB->prefix('users'); |
|
35 | + $sql = 'SELECT uid, uname FROM '.$xoopsDB->prefix('users'); |
|
36 | 36 | $sql .= ' ORDER BY uname ASC'; |
37 | 37 | |
38 | 38 | $result = $xoopsDB->query($sql); |
@@ -16,27 +16,27 @@ |
||
16 | 16 | */ |
17 | 17 | class SmartFormImageUploadElement extends SmartFormUploadElement |
18 | 18 | { |
19 | - /** |
|
20 | - * SmartFormImageUploadElement constructor. |
|
21 | - * @param string $object |
|
22 | - * @param string $key |
|
23 | - */ |
|
24 | - public function __construct($object, $key) |
|
25 | - { |
|
26 | - $this->SmartFormFileElement($object, $key); |
|
27 | - // Override name for upload purposes |
|
28 | - $this->setName('upload_' . $key); |
|
29 | - } |
|
19 | + /** |
|
20 | + * SmartFormImageUploadElement constructor. |
|
21 | + * @param string $object |
|
22 | + * @param string $key |
|
23 | + */ |
|
24 | + public function __construct($object, $key) |
|
25 | + { |
|
26 | + $this->SmartFormFileElement($object, $key); |
|
27 | + // Override name for upload purposes |
|
28 | + $this->setName('upload_' . $key); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * prepare HTML for output |
|
33 | - * |
|
34 | - * @return string HTML |
|
35 | - */ |
|
36 | - public function render() |
|
37 | - { |
|
38 | - return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' /> |
|
31 | + /** |
|
32 | + * prepare HTML for output |
|
33 | + * |
|
34 | + * @return string HTML |
|
35 | + */ |
|
36 | + public function render() |
|
37 | + { |
|
38 | + return "<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_image[]' id='smart_upload_image[]' value='" . $this->getName() . "' />"; |
41 | - } |
|
41 | + } |
|
42 | 42 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @package SmartObject |
10 | 10 | * @subpackage SmartObjectForm |
11 | 11 | */ |
12 | -include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformuploadelement.php'; |
|
12 | +include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformuploadelement.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Class SmartFormImageUploadElement |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | $this->SmartFormFileElement($object, $key); |
27 | 27 | // Override name for upload purposes |
28 | - $this->setName('upload_' . $key); |
|
28 | + $this->setName('upload_'.$key); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function render() |
37 | 37 | { |
38 | - return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' /> |
|
39 | - <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . " /> |
|
40 | - <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='" . $this->getName() . "' />"; |
|
38 | + return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /> |
|
39 | + <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra()." /> |
|
40 | + <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='" . $this->getName()."' />"; |
|
41 | 41 | } |
42 | 42 | } |
@@ -6,41 +6,41 @@ |
||
6 | 6 | */ |
7 | 7 | class SmartFormSection extends XoopsFormElement |
8 | 8 | { |
9 | - /** |
|
10 | - * Text |
|
11 | - * @var string |
|
12 | - * @access private |
|
13 | - */ |
|
14 | - public $_value; |
|
9 | + /** |
|
10 | + * Text |
|
11 | + * @var string |
|
12 | + * @access private |
|
13 | + */ |
|
14 | + public $_value; |
|
15 | 15 | |
16 | - /** |
|
17 | - * SmartFormSection constructor. |
|
18 | - * @param $sectionname |
|
19 | - * @param bool $value |
|
20 | - */ |
|
21 | - public function __construct($sectionname, $value = false) |
|
22 | - { |
|
23 | - $this->setName($sectionname); |
|
24 | - $this->_value = $value; |
|
25 | - } |
|
16 | + /** |
|
17 | + * SmartFormSection constructor. |
|
18 | + * @param $sectionname |
|
19 | + * @param bool $value |
|
20 | + */ |
|
21 | + public function __construct($sectionname, $value = false) |
|
22 | + { |
|
23 | + $this->setName($sectionname); |
|
24 | + $this->_value = $value; |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Get the text |
|
29 | - * |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public function getValue() |
|
33 | - { |
|
34 | - return $this->_value; |
|
35 | - } |
|
27 | + /** |
|
28 | + * Get the text |
|
29 | + * |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public function getValue() |
|
33 | + { |
|
34 | + return $this->_value; |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Prepare HTML for output |
|
39 | - * |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function render() |
|
43 | - { |
|
44 | - return $this->getValue(); |
|
45 | - } |
|
37 | + /** |
|
38 | + * Prepare HTML for output |
|
39 | + * |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function render() |
|
43 | + { |
|
44 | + return $this->getValue(); |
|
45 | + } |
|
46 | 46 | } |
@@ -35,14 +35,14 @@ |
||
35 | 35 | */ |
36 | 36 | class SmartFormSelectElement extends XoopsFormElement |
37 | 37 | { |
38 | - /** |
|
39 | - * @param bool $withtags |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function renderValidationJS($withtags = true) |
|
43 | - { |
|
44 | - $js = ''; |
|
38 | + /** |
|
39 | + * @param bool $withtags |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function renderValidationJS($withtags = true) |
|
43 | + { |
|
44 | + $js = ''; |
|
45 | 45 | |
46 | - return $js; |
|
47 | - } |
|
46 | + return $js; |
|
47 | + } |
|
48 | 48 | } |
@@ -36,20 +36,20 @@ |
||
36 | 36 | */ |
37 | 37 | class SmartFormHidden extends XoopsFormHidden |
38 | 38 | { |
39 | - /** |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function render() |
|
43 | - { |
|
44 | - if (is_array($this->getValue())) { |
|
45 | - $ret = ''; |
|
46 | - foreach ($this->getValue() as $value) { |
|
47 | - $ret .= "<input type='hidden' name='" . $this->getName() . "[]' id='" . $this->getName() . "' value='" . $value . "' />\n"; |
|
48 | - } |
|
49 | - } else { |
|
50 | - $ret = "<input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "' />"; |
|
51 | - } |
|
39 | + /** |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function render() |
|
43 | + { |
|
44 | + if (is_array($this->getValue())) { |
|
45 | + $ret = ''; |
|
46 | + foreach ($this->getValue() as $value) { |
|
47 | + $ret .= "<input type='hidden' name='" . $this->getName() . "[]' id='" . $this->getName() . "' value='" . $value . "' />\n"; |
|
48 | + } |
|
49 | + } else { |
|
50 | + $ret = "<input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "' />"; |
|
51 | + } |
|
52 | 52 | |
53 | - return $ret; |
|
54 | - } |
|
53 | + return $ret; |
|
54 | + } |
|
55 | 55 | } |
@@ -44,10 +44,10 @@ |
||
44 | 44 | if (is_array($this->getValue())) { |
45 | 45 | $ret = ''; |
46 | 46 | foreach ($this->getValue() as $value) { |
47 | - $ret .= "<input type='hidden' name='" . $this->getName() . "[]' id='" . $this->getName() . "' value='" . $value . "' />\n"; |
|
47 | + $ret .= "<input type='hidden' name='".$this->getName()."[]' id='".$this->getName()."' value='".$value."' />\n"; |
|
48 | 48 | } |
49 | 49 | } else { |
50 | - $ret = "<input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "' />"; |
|
50 | + $ret = "<input type='hidden' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."' />"; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | return $ret; |
@@ -11,13 +11,13 @@ |
||
11 | 11 | */ |
12 | 12 | class SmartFormDate_timeElement extends XoopsFormDateTime |
13 | 13 | { |
14 | - /** |
|
15 | - * SmartFormDate_timeElement constructor. |
|
16 | - * @param mixed $object |
|
17 | - * @param mixed $key |
|
18 | - */ |
|
19 | - public function __construct($object, $key) |
|
20 | - { |
|
21 | - parent::__construct($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e')); |
|
22 | - } |
|
14 | + /** |
|
15 | + * SmartFormDate_timeElement constructor. |
|
16 | + * @param mixed $object |
|
17 | + * @param mixed $key |
|
18 | + */ |
|
19 | + public function __construct($object, $key) |
|
20 | + { |
|
21 | + parent::__construct($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e')); |
|
22 | + } |
|
23 | 23 | } |
@@ -6,41 +6,41 @@ |
||
6 | 6 | */ |
7 | 7 | class SmartFormSectionClose extends XoopsFormElement |
8 | 8 | { |
9 | - /** |
|
10 | - * Text |
|
11 | - * @var string |
|
12 | - * @access private |
|
13 | - */ |
|
14 | - public $_value; |
|
9 | + /** |
|
10 | + * Text |
|
11 | + * @var string |
|
12 | + * @access private |
|
13 | + */ |
|
14 | + public $_value; |
|
15 | 15 | |
16 | - /** |
|
17 | - * SmartFormSectionClose constructor. |
|
18 | - * @param $sectionname |
|
19 | - * @param bool $value |
|
20 | - */ |
|
21 | - public function __construct($sectionname, $value = false) |
|
22 | - { |
|
23 | - $this->setName($sectionname); |
|
24 | - $this->_value = $value; |
|
25 | - } |
|
16 | + /** |
|
17 | + * SmartFormSectionClose constructor. |
|
18 | + * @param $sectionname |
|
19 | + * @param bool $value |
|
20 | + */ |
|
21 | + public function __construct($sectionname, $value = false) |
|
22 | + { |
|
23 | + $this->setName($sectionname); |
|
24 | + $this->_value = $value; |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Get the text |
|
29 | - * |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public function getValue() |
|
33 | - { |
|
34 | - return $this->_value; |
|
35 | - } |
|
27 | + /** |
|
28 | + * Get the text |
|
29 | + * |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public function getValue() |
|
33 | + { |
|
34 | + return $this->_value; |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Prepare HTML for output |
|
39 | - * |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function render() |
|
43 | - { |
|
44 | - return $this->getValue(); |
|
45 | - } |
|
37 | + /** |
|
38 | + * Prepare HTML for output |
|
39 | + * |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function render() |
|
43 | + { |
|
44 | + return $this->getValue(); |
|
45 | + } |
|
46 | 46 | } |
@@ -11,54 +11,54 @@ |
||
11 | 11 | */ |
12 | 12 | class SmartFormRadioElement extends XoopsFormRadio |
13 | 13 | { |
14 | - /** |
|
15 | - * SmartFormRadioElement constructor. |
|
16 | - * @param string $object |
|
17 | - * @param string $key |
|
18 | - */ |
|
19 | - public function __construct($object, $key) |
|
20 | - { |
|
21 | - $var = $object->vars[$key]; |
|
14 | + /** |
|
15 | + * SmartFormRadioElement constructor. |
|
16 | + * @param string $object |
|
17 | + * @param string $key |
|
18 | + */ |
|
19 | + public function __construct($object, $key) |
|
20 | + { |
|
21 | + $var = $object->vars[$key]; |
|
22 | 22 | |
23 | - parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e')); |
|
23 | + parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e')); |
|
24 | 24 | |
25 | - // Adding the options inside this SelectBox |
|
26 | - // If the custom method is not from a module, than it's from the core |
|
27 | - $control = $object->getControl($key); |
|
25 | + // Adding the options inside this SelectBox |
|
26 | + // If the custom method is not from a module, than it's from the core |
|
27 | + $control = $object->getControl($key); |
|
28 | 28 | |
29 | - if (isset($control['options'])) { |
|
30 | - $this->addOptionArray($control['options']); |
|
31 | - } else { |
|
32 | - // let's find if the method we need to call comes from an already defined object |
|
33 | - if (isset($control['object'])) { |
|
34 | - if (method_exists($control['object'], $control['method'])) { |
|
35 | - if ($option_array = $control['object']->{$control['method']}()) { |
|
36 | - // Adding the options array to the XoopsFormSelect |
|
37 | - $this->addOptionArray($option_array); |
|
38 | - } |
|
39 | - } |
|
40 | - } else { |
|
41 | - // finding the itemHandler; if none, let's take the itemHandler of the $object |
|
42 | - if (isset($control['itemHandler'])) { |
|
43 | - if (!$control['module']) { |
|
44 | - // Creating the specified core object handler |
|
45 | - $controlHandler = xoops_getHandler($control['itemHandler']); |
|
46 | - } else { |
|
47 | - $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
|
48 | - } |
|
49 | - } else { |
|
50 | - $controlHandler =& $object->handler; |
|
51 | - } |
|
29 | + if (isset($control['options'])) { |
|
30 | + $this->addOptionArray($control['options']); |
|
31 | + } else { |
|
32 | + // let's find if the method we need to call comes from an already defined object |
|
33 | + if (isset($control['object'])) { |
|
34 | + if (method_exists($control['object'], $control['method'])) { |
|
35 | + if ($option_array = $control['object']->{$control['method']}()) { |
|
36 | + // Adding the options array to the XoopsFormSelect |
|
37 | + $this->addOptionArray($option_array); |
|
38 | + } |
|
39 | + } |
|
40 | + } else { |
|
41 | + // finding the itemHandler; if none, let's take the itemHandler of the $object |
|
42 | + if (isset($control['itemHandler'])) { |
|
43 | + if (!$control['module']) { |
|
44 | + // Creating the specified core object handler |
|
45 | + $controlHandler = xoops_getHandler($control['itemHandler']); |
|
46 | + } else { |
|
47 | + $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
|
48 | + } |
|
49 | + } else { |
|
50 | + $controlHandler =& $object->handler; |
|
51 | + } |
|
52 | 52 | |
53 | - // Checking if the specified method exists |
|
54 | - if (method_exists($controlHandler, $control['method'])) { |
|
55 | - // TODO: How could I pass the parameters in the following call ... |
|
56 | - if ($option_array = $controlHandler->{$control['method']}()) { |
|
57 | - // Adding the options array to the XoopsFormSelect |
|
58 | - $this->addOptionArray($option_array); |
|
59 | - } |
|
60 | - } |
|
61 | - } |
|
62 | - } |
|
63 | - } |
|
53 | + // Checking if the specified method exists |
|
54 | + if (method_exists($controlHandler, $control['method'])) { |
|
55 | + // TODO: How could I pass the parameters in the following call ... |
|
56 | + if ($option_array = $controlHandler->{$control['method']}()) { |
|
57 | + // Adding the options array to the XoopsFormSelect |
|
58 | + $this->addOptionArray($option_array); |
|
59 | + } |
|
60 | + } |
|
61 | + } |
|
62 | + } |
|
63 | + } |
|
64 | 64 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
48 | 48 | } |
49 | 49 | } else { |
50 | - $controlHandler =& $object->handler; |
|
50 | + $controlHandler = & $object->handler; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // Checking if the specified method exists |