@@ -19,23 +19,23 @@ |
||
19 | 19 | */ |
20 | 20 | class SmartFormUserSigElement extends \XoopsFormElementTray |
21 | 21 | { |
22 | - /** |
|
23 | - * SmartFormUserSigElement constructor. |
|
24 | - * @param string $object |
|
25 | - * @param string $key |
|
26 | - */ |
|
27 | - public function __construct($object, $key) |
|
28 | - { |
|
29 | - $var = $object->vars[$key]; |
|
30 | - $control = $object->controls[$key]; |
|
22 | + /** |
|
23 | + * SmartFormUserSigElement constructor. |
|
24 | + * @param string $object |
|
25 | + * @param string $key |
|
26 | + */ |
|
27 | + public function __construct($object, $key) |
|
28 | + { |
|
29 | + $var = $object->vars[$key]; |
|
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 | - $signature_textarea = new \XoopsFormDhtmlTextArea('', $key, $object->getVar($key, 'e')); |
|
35 | - $this->addElement($signature_textarea); |
|
34 | + $signature_textarea = new \XoopsFormDhtmlTextArea('', $key, $object->getVar($key, 'e')); |
|
35 | + $this->addElement($signature_textarea); |
|
36 | 36 | |
37 | - $attach_checkbox = new \XoopsFormCheckBox('', 'attachsig', $object->getVar('attachsig', 'e')); |
|
38 | - $attach_checkbox->addOption(1, _US_SHOWSIG); |
|
39 | - $this->addElement($attach_checkbox); |
|
40 | - } |
|
37 | + $attach_checkbox = new \XoopsFormCheckBox('', 'attachsig', $object->getVar('attachsig', 'e')); |
|
38 | + $attach_checkbox->addOption(1, _US_SHOWSIG); |
|
39 | + $this->addElement($attach_checkbox); |
|
40 | + } |
|
41 | 41 | } |
@@ -29,7 +29,7 @@ |
||
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); |
@@ -19,27 +19,27 @@ |
||
19 | 19 | */ |
20 | 20 | class SmartFormImageUploadElement extends Smartobject\Form\Elements\SmartFormUploadElement |
21 | 21 | { |
22 | - /** |
|
23 | - * SmartFormImageUploadElement constructor. |
|
24 | - * @param string $object |
|
25 | - * @param string $key |
|
26 | - */ |
|
27 | - public function __construct($object, $key) |
|
28 | - { |
|
29 | - $this->SmartFormFileElement($object, $key); |
|
30 | - // Override name for upload purposes |
|
31 | - $this->setName('upload_' . $key); |
|
32 | - } |
|
22 | + /** |
|
23 | + * SmartFormImageUploadElement constructor. |
|
24 | + * @param string $object |
|
25 | + * @param string $key |
|
26 | + */ |
|
27 | + public function __construct($object, $key) |
|
28 | + { |
|
29 | + $this->SmartFormFileElement($object, $key); |
|
30 | + // Override name for upload purposes |
|
31 | + $this->setName('upload_' . $key); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * prepare HTML for output |
|
36 | - * |
|
37 | - * @return string HTML |
|
38 | - */ |
|
39 | - public function render() |
|
40 | - { |
|
41 | - return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'> |
|
34 | + /** |
|
35 | + * prepare HTML for output |
|
36 | + * |
|
37 | + * @return string HTML |
|
38 | + */ |
|
39 | + public function render() |
|
40 | + { |
|
41 | + return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'> |
|
42 | 42 | <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . "> |
43 | 43 | <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='" . $this->getName() . "'>"; |
44 | - } |
|
44 | + } |
|
45 | 45 | } |
@@ -28,7 +28,7 @@ discard block |
||
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 |
||
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 | } |
@@ -18,36 +18,36 @@ |
||
18 | 18 | */ |
19 | 19 | class SmartFormUserElement extends \XoopsFormSelect |
20 | 20 | { |
21 | - public $multiple = false; |
|
22 | - |
|
23 | - /** |
|
24 | - * SmartFormUserElement constructor. |
|
25 | - * @param string $object |
|
26 | - * @param string $key |
|
27 | - */ |
|
28 | - public function __construct($object, $key) |
|
29 | - { |
|
30 | - $var = $object->vars[$key]; |
|
31 | - $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
32 | - |
|
33 | - parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $size, $this->multiple); |
|
34 | - |
|
35 | - // Adding the options inside this SelectBox |
|
36 | - // If the custom method is not from a module, than it's from the core |
|
37 | - $control = $object->getControl($key); |
|
38 | - |
|
39 | - global $xoopsDB; |
|
40 | - $ret = []; |
|
41 | - $limit = $start = 0; |
|
42 | - $sql = 'SELECT uid, uname FROM ' . $xoopsDB->prefix('users'); |
|
43 | - $sql .= ' ORDER BY uname ASC'; |
|
44 | - |
|
45 | - $result = $xoopsDB->query($sql); |
|
46 | - if ($result) { |
|
47 | - while (false !== ($myrow = $xoopsDB->fetchArray($result))) { |
|
48 | - $uArray[$myrow['uid']] = $myrow['uname']; |
|
49 | - } |
|
50 | - } |
|
51 | - $this->addOptionArray($uArray); |
|
52 | - } |
|
21 | + public $multiple = false; |
|
22 | + |
|
23 | + /** |
|
24 | + * SmartFormUserElement constructor. |
|
25 | + * @param string $object |
|
26 | + * @param string $key |
|
27 | + */ |
|
28 | + public function __construct($object, $key) |
|
29 | + { |
|
30 | + $var = $object->vars[$key]; |
|
31 | + $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
32 | + |
|
33 | + parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $size, $this->multiple); |
|
34 | + |
|
35 | + // Adding the options inside this SelectBox |
|
36 | + // If the custom method is not from a module, than it's from the core |
|
37 | + $control = $object->getControl($key); |
|
38 | + |
|
39 | + global $xoopsDB; |
|
40 | + $ret = []; |
|
41 | + $limit = $start = 0; |
|
42 | + $sql = 'SELECT uid, uname FROM ' . $xoopsDB->prefix('users'); |
|
43 | + $sql .= ' ORDER BY uname ASC'; |
|
44 | + |
|
45 | + $result = $xoopsDB->query($sql); |
|
46 | + if ($result) { |
|
47 | + while (false !== ($myrow = $xoopsDB->fetchArray($result))) { |
|
48 | + $uArray[$myrow['uid']] = $myrow['uname']; |
|
49 | + } |
|
50 | + } |
|
51 | + $this->addOptionArray($uArray); |
|
52 | + } |
|
53 | 53 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | global $xoopsDB; |
33 | 33 | $ret = []; |
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); |
@@ -18,59 +18,59 @@ |
||
18 | 18 | */ |
19 | 19 | class SmartFormSelectElement extends \XoopsFormSelect |
20 | 20 | { |
21 | - public $multiple = false; |
|
21 | + public $multiple = false; |
|
22 | 22 | |
23 | - /** |
|
24 | - * SmartFormSelectElement constructor. |
|
25 | - * @param string $object |
|
26 | - * @param string $key |
|
27 | - */ |
|
28 | - public function __construct($object, $key) |
|
29 | - { |
|
30 | - $var = $object->vars[$key]; |
|
31 | - $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
23 | + /** |
|
24 | + * SmartFormSelectElement constructor. |
|
25 | + * @param string $object |
|
26 | + * @param string $key |
|
27 | + */ |
|
28 | + public function __construct($object, $key) |
|
29 | + { |
|
30 | + $var = $object->vars[$key]; |
|
31 | + $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1); |
|
32 | 32 | |
33 | - // Adding the options inside this SelectBox |
|
34 | - // If the custom method is not from a module, than it's from the core |
|
35 | - $control = $object->getControl($key); |
|
33 | + // Adding the options inside this SelectBox |
|
34 | + // If the custom method is not from a module, than it's from the core |
|
35 | + $control = $object->getControl($key); |
|
36 | 36 | |
37 | - $value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e'); |
|
37 | + $value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e'); |
|
38 | 38 | |
39 | - parent::__construct($var['form_caption'], $key, $value, $size, $this->multiple); |
|
39 | + parent::__construct($var['form_caption'], $key, $value, $size, $this->multiple); |
|
40 | 40 | |
41 | - if (isset($control['options'])) { |
|
42 | - $this->addOptionArray($control['options']); |
|
43 | - } else { |
|
44 | - // let's find if the method we need to call comes from an already defined object |
|
45 | - if (isset($control['object'])) { |
|
46 | - if (method_exists($control['object'], $control['method'])) { |
|
47 | - if ($option_array = $control['object']->{$control['method']}()) { |
|
48 | - // Adding the options array to the XoopsFormSelect |
|
49 | - $this->addOptionArray($option_array); |
|
50 | - } |
|
51 | - } |
|
52 | - } else { |
|
53 | - // finding the itemHandler; if none, let's take the itemHandler of the $object |
|
54 | - if (isset($control['itemHandler'])) { |
|
55 | - if (!$control['module']) { |
|
56 | - // Creating the specified core object handler |
|
57 | - $controlHandler = xoops_getHandler($control['itemHandler']); |
|
58 | - } else { |
|
59 | - $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
|
60 | - } |
|
61 | - } else { |
|
62 | - $controlHandler = $object->handler; |
|
63 | - } |
|
41 | + if (isset($control['options'])) { |
|
42 | + $this->addOptionArray($control['options']); |
|
43 | + } else { |
|
44 | + // let's find if the method we need to call comes from an already defined object |
|
45 | + if (isset($control['object'])) { |
|
46 | + if (method_exists($control['object'], $control['method'])) { |
|
47 | + if ($option_array = $control['object']->{$control['method']}()) { |
|
48 | + // Adding the options array to the XoopsFormSelect |
|
49 | + $this->addOptionArray($option_array); |
|
50 | + } |
|
51 | + } |
|
52 | + } else { |
|
53 | + // finding the itemHandler; if none, let's take the itemHandler of the $object |
|
54 | + if (isset($control['itemHandler'])) { |
|
55 | + if (!$control['module']) { |
|
56 | + // Creating the specified core object handler |
|
57 | + $controlHandler = xoops_getHandler($control['itemHandler']); |
|
58 | + } else { |
|
59 | + $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']); |
|
60 | + } |
|
61 | + } else { |
|
62 | + $controlHandler = $object->handler; |
|
63 | + } |
|
64 | 64 | |
65 | - // Checking if the specified method exists |
|
66 | - if (method_exists($controlHandler, $control['method'])) { |
|
67 | - // TODO: How could I pass the parameters in the following call ... |
|
68 | - if ($option_array = $controlHandler->{$control['method']}()) { |
|
69 | - // Adding the options array to the XoopsFormSelect |
|
70 | - $this->addOptionArray($option_array); |
|
71 | - } |
|
72 | - } |
|
73 | - } |
|
74 | - } |
|
75 | - } |
|
65 | + // Checking if the specified method exists |
|
66 | + if (method_exists($controlHandler, $control['method'])) { |
|
67 | + // TODO: How could I pass the parameters in the following call ... |
|
68 | + if ($option_array = $controlHandler->{$control['method']}()) { |
|
69 | + // Adding the options array to the XoopsFormSelect |
|
70 | + $this->addOptionArray($option_array); |
|
71 | + } |
|
72 | + } |
|
73 | + } |
|
74 | + } |
|
75 | + } |
|
76 | 76 | } |
@@ -18,31 +18,31 @@ |
||
18 | 18 | */ |
19 | 19 | class SmartFormUrlLinkElement extends \XoopsFormElementTray |
20 | 20 | { |
21 | - /** |
|
22 | - * SmartFormUrlLinkElement constructor. |
|
23 | - * @param string $form_caption |
|
24 | - * @param string $key |
|
25 | - * @param string $object |
|
26 | - */ |
|
27 | - public function __construct($form_caption, $key, $object) |
|
28 | - { |
|
29 | - parent::__construct($form_caption, ' '); |
|
30 | - |
|
31 | - $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_URL)); |
|
32 | - $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
33 | - |
|
34 | - $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CAPTION)); |
|
35 | - $this->addElement(new SmartFormTextElement($object, 'caption_' . $key)); |
|
36 | - |
|
37 | - $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_DESC . '<br>')); |
|
38 | - $this->addElement(new \XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description'))); |
|
39 | - |
|
40 | - $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_TARGET)); |
|
41 | - $targ_val = $object->getVar('target'); |
|
42 | - $targetRadio = new \XoopsFormRadio('', 'target_' . $key, '' !== $targ_val ? $targ_val : '_blank'); |
|
43 | - $control = $object->getControl('target'); |
|
44 | - $targetRadio->addOptionArray($control['options']); |
|
45 | - |
|
46 | - $this->addElement($targetRadio); |
|
47 | - } |
|
21 | + /** |
|
22 | + * SmartFormUrlLinkElement constructor. |
|
23 | + * @param string $form_caption |
|
24 | + * @param string $key |
|
25 | + * @param string $object |
|
26 | + */ |
|
27 | + public function __construct($form_caption, $key, $object) |
|
28 | + { |
|
29 | + parent::__construct($form_caption, ' '); |
|
30 | + |
|
31 | + $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_URL)); |
|
32 | + $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
33 | + |
|
34 | + $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CAPTION)); |
|
35 | + $this->addElement(new SmartFormTextElement($object, 'caption_' . $key)); |
|
36 | + |
|
37 | + $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_DESC . '<br>')); |
|
38 | + $this->addElement(new \XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description'))); |
|
39 | + |
|
40 | + $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_TARGET)); |
|
41 | + $targ_val = $object->getVar('target'); |
|
42 | + $targetRadio = new \XoopsFormRadio('', 'target_' . $key, '' !== $targ_val ? $targ_val : '_blank'); |
|
43 | + $control = $object->getControl('target'); |
|
44 | + $targetRadio->addOptionArray($control['options']); |
|
45 | + |
|
46 | + $this->addElement($targetRadio); |
|
47 | + } |
|
48 | 48 | } |
@@ -28,18 +28,18 @@ |
||
28 | 28 | { |
29 | 29 | parent::__construct($form_caption, ' '); |
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 |
@@ -26,20 +26,20 @@ |
||
26 | 26 | */ |
27 | 27 | class SmartFormHidden extends \XoopsFormHidden |
28 | 28 | { |
29 | - /** |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public function render() |
|
33 | - { |
|
34 | - if (is_array($this->getValue())) { |
|
35 | - $ret = ''; |
|
36 | - foreach ($this->getValue() as $value) { |
|
37 | - $ret .= "<input type='hidden' name='" . $this->getName() . "[]' id='" . $this->getName() . "' value='" . $value . "'>\n"; |
|
38 | - } |
|
39 | - } else { |
|
40 | - $ret = "<input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "'>"; |
|
41 | - } |
|
29 | + /** |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public function render() |
|
33 | + { |
|
34 | + if (is_array($this->getValue())) { |
|
35 | + $ret = ''; |
|
36 | + foreach ($this->getValue() as $value) { |
|
37 | + $ret .= "<input type='hidden' name='" . $this->getName() . "[]' id='" . $this->getName() . "' value='" . $value . "'>\n"; |
|
38 | + } |
|
39 | + } else { |
|
40 | + $ret = "<input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "'>"; |
|
41 | + } |
|
42 | 42 | |
43 | - return $ret; |
|
44 | - } |
|
43 | + return $ret; |
|
44 | + } |
|
45 | 45 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | if (is_array($this->getValue())) { |
33 | 33 | $ret = ''; |
34 | 34 | foreach ($this->getValue() as $value) { |
35 | - $ret .= "<input type='hidden' name='" . $this->getName() . "[]' id='" . $this->getName() . "' value='" . $value . "'>\n"; |
|
35 | + $ret .= "<input type='hidden' name='".$this->getName()."[]' id='".$this->getName()."' value='".$value."'>\n"; |
|
36 | 36 | } |
37 | 37 | } else { |
38 | - $ret = "<input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "'>"; |
|
38 | + $ret = "<input type='hidden' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."'>"; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | return $ret; |
@@ -18,39 +18,39 @@ |
||
18 | 18 | */ |
19 | 19 | class SmartFormImageElement extends \XoopsFormElementTray |
20 | 20 | { |
21 | - /** |
|
22 | - * SmartFormImageElement constructor. |
|
23 | - * @param string $object |
|
24 | - * @param string $key |
|
25 | - */ |
|
26 | - public function __construct($object, $key) |
|
27 | - { |
|
28 | - $var = $object->vars[$key]; |
|
29 | - $object_imageurl = $object->getImageDir(); |
|
30 | - parent::__construct($var['form_caption'], ' '); |
|
31 | - |
|
32 | - $objectArray['image'] = str_replace('{XOOPS_URL}', XOOPS_URL, $objectArray['image']); |
|
33 | - |
|
34 | - if ('' !== $object->getVar($key) |
|
35 | - && (0 === strpos($object->getVar($key), 'http') |
|
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>")); |
|
38 | - } elseif ('' !== $object->getVar($key)) { |
|
39 | - $this->addElement(new \XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt=''><br><br>")); |
|
40 | - } |
|
21 | + /** |
|
22 | + * SmartFormImageElement constructor. |
|
23 | + * @param string $object |
|
24 | + * @param string $key |
|
25 | + */ |
|
26 | + public function __construct($object, $key) |
|
27 | + { |
|
28 | + $var = $object->vars[$key]; |
|
29 | + $object_imageurl = $object->getImageDir(); |
|
30 | + parent::__construct($var['form_caption'], ' '); |
|
31 | + |
|
32 | + $objectArray['image'] = str_replace('{XOOPS_URL}', XOOPS_URL, $objectArray['image']); |
|
33 | + |
|
34 | + if ('' !== $object->getVar($key) |
|
35 | + && (0 === strpos($object->getVar($key), 'http') |
|
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>")); |
|
38 | + } elseif ('' !== $object->getVar($key)) { |
|
39 | + $this->addElement(new \XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt=''><br><br>")); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | // require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php'; |
43 | - $this->addElement(new SmartFormFileUploadElement($object, $key)); |
|
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)); |
|
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>'); |
|
54 | - $this->addElement($delete_check); |
|
55 | - } |
|
49 | + $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE)); |
|
50 | + $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
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>'); |
|
54 | + $this->addElement($delete_check); |
|
55 | + } |
|
56 | 56 | } |
@@ -34,23 +34,23 @@ |
||
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 | } |
@@ -18,24 +18,24 @@ |
||
18 | 18 | */ |
19 | 19 | class SmartFormTextElement extends \XoopsFormText |
20 | 20 | { |
21 | - /** |
|
22 | - * SmartFormTextElement constructor. |
|
23 | - * @param string $object |
|
24 | - * @param string $key |
|
25 | - */ |
|
26 | - public function __construct($object, $key) |
|
27 | - { |
|
28 | - $var = $object->vars[$key]; |
|
21 | + /** |
|
22 | + * SmartFormTextElement constructor. |
|
23 | + * @param string $object |
|
24 | + * @param string $key |
|
25 | + */ |
|
26 | + public function __construct($object, $key) |
|
27 | + { |
|
28 | + $var = $object->vars[$key]; |
|
29 | 29 | |
30 | - if (isset($object->controls[$key])) { |
|
31 | - $control = $object->controls[$key]; |
|
32 | - $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); |
|
33 | - $form_size = isset($control['size']) ? $control['size'] : 50; |
|
34 | - } else { |
|
35 | - $form_maxlength = 255; |
|
36 | - $form_size = 50; |
|
37 | - } |
|
30 | + if (isset($object->controls[$key])) { |
|
31 | + $control = $object->controls[$key]; |
|
32 | + $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); |
|
33 | + $form_size = isset($control['size']) ? $control['size'] : 50; |
|
34 | + } else { |
|
35 | + $form_maxlength = 255; |
|
36 | + $form_size = 50; |
|
37 | + } |
|
38 | 38 | |
39 | - parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e')); |
|
40 | - } |
|
39 | + parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e')); |
|
40 | + } |
|
41 | 41 | } |
@@ -27,35 +27,35 @@ |
||
27 | 27 | */ |
28 | 28 | class Configurator |
29 | 29 | { |
30 | - public $name; |
|
31 | - public $paths = []; |
|
32 | - public $uploadFolders = []; |
|
33 | - public $copyBlankFiles = []; |
|
34 | - public $copyTestFolders = []; |
|
35 | - public $templateFolders = []; |
|
36 | - public $oldFiles = []; |
|
37 | - public $oldFolders = []; |
|
38 | - public $modCopyright; |
|
30 | + public $name; |
|
31 | + public $paths = []; |
|
32 | + public $uploadFolders = []; |
|
33 | + public $copyBlankFiles = []; |
|
34 | + public $copyTestFolders = []; |
|
35 | + public $templateFolders = []; |
|
36 | + public $oldFiles = []; |
|
37 | + public $oldFolders = []; |
|
38 | + public $modCopyright; |
|
39 | 39 | |
40 | - /** |
|
41 | - * Configurator constructor. |
|
42 | - */ |
|
43 | - public function __construct() |
|
44 | - { |
|
45 | - $moduleDirName = basename(dirname(__DIR__)); |
|
46 | - $capsDirName = strtoupper($moduleDirName); |
|
40 | + /** |
|
41 | + * Configurator constructor. |
|
42 | + */ |
|
43 | + public function __construct() |
|
44 | + { |
|
45 | + $moduleDirName = basename(dirname(__DIR__)); |
|
46 | + $capsDirName = strtoupper($moduleDirName); |
|
47 | 47 | |
48 | - require_once __DIR__ . '/../../include/config.php'; |
|
49 | - $config = getConfig(); |
|
48 | + require_once __DIR__ . '/../../include/config.php'; |
|
49 | + $config = getConfig(); |
|
50 | 50 | |
51 | - $this->name = $config->name; |
|
52 | - $this->paths = $config->paths; |
|
53 | - $this->uploadFolders = $config->uploadFolders; |
|
54 | - $this->copyBlankFiles = $config->copyBlankFiles; |
|
55 | - $this->copyTestFolders = $config->copyTestFolders; |
|
56 | - $this->templateFolders = $config->templateFolders; |
|
57 | - $this->oldFiles = $config->oldFiles; |
|
58 | - $this->oldFolders = $config->oldFolders; |
|
59 | - $this->modCopyright = $config->modCopyright; |
|
60 | - } |
|
51 | + $this->name = $config->name; |
|
52 | + $this->paths = $config->paths; |
|
53 | + $this->uploadFolders = $config->uploadFolders; |
|
54 | + $this->copyBlankFiles = $config->copyBlankFiles; |
|
55 | + $this->copyTestFolders = $config->copyTestFolders; |
|
56 | + $this->templateFolders = $config->templateFolders; |
|
57 | + $this->oldFiles = $config->oldFiles; |
|
58 | + $this->oldFolders = $config->oldFolders; |
|
59 | + $this->modCopyright = $config->modCopyright; |
|
60 | + } |
|
61 | 61 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | */ |
22 | 22 | |
23 | -require_once __DIR__ . '/../../include/common.php'; |
|
23 | +require_once __DIR__.'/../../include/common.php'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Class Configurator |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $moduleDirName = basename(dirname(__DIR__)); |
46 | 46 | $capsDirName = strtoupper($moduleDirName); |
47 | 47 | |
48 | - require_once __DIR__ . '/../../include/config.php'; |
|
48 | + require_once __DIR__.'/../../include/config.php'; |
|
49 | 49 | $config = getConfig(); |
50 | 50 | |
51 | 51 | $this->name = $config->name; |