@@ -18,59 +18,59 @@ |
||
| 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 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 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 |
||
| 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'])) { |
@@ -7,38 +7,38 @@ |
||
| 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 | } |
@@ -30,12 +30,12 @@ |
||
| 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 | } |
@@ -19,27 +19,27 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class SmartFormFileUploadElement extends Smartobject\Form\Elements\SmartFormUploadElement |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * SmartFormFileUploadElement 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 | + * SmartFormFileUploadElement 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='upload_" . $this->getName() . "' id='upload_" . $this->getName() . "'" . $this->getExtra() . "> |
| 43 | 43 | <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' 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='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 | } |
@@ -19,50 +19,50 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class SmartFormSetPasswordElement extends \XoopsFormElementTray |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * Size of the field. |
|
| 24 | - * @var int |
|
| 25 | - * @access private |
|
| 26 | - */ |
|
| 27 | - public $_size; |
|
| 22 | + /** |
|
| 23 | + * Size of the field. |
|
| 24 | + * @var int |
|
| 25 | + * @access private |
|
| 26 | + */ |
|
| 27 | + public $_size; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Maximum length of the text |
|
| 31 | - * @var int |
|
| 32 | - * @access private |
|
| 33 | - */ |
|
| 34 | - public $_maxlength; |
|
| 29 | + /** |
|
| 30 | + * Maximum length of the text |
|
| 31 | + * @var int |
|
| 32 | + * @access private |
|
| 33 | + */ |
|
| 34 | + public $_maxlength; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Initial content of the field. |
|
| 38 | - * @var string |
|
| 39 | - * @access private |
|
| 40 | - */ |
|
| 41 | - public $_value; |
|
| 36 | + /** |
|
| 37 | + * Initial content of the field. |
|
| 38 | + * @var string |
|
| 39 | + * @access private |
|
| 40 | + */ |
|
| 41 | + public $_value; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Constructor |
|
| 45 | - * |
|
| 46 | - * @param string $object |
|
| 47 | - * @param string $key |
|
| 48 | - * @internal param string $caption Caption |
|
| 49 | - * @internal param string $name "name" attribute |
|
| 50 | - * @internal param int $size Size of the field |
|
| 51 | - * @internal param int $maxlength Maximum length of the text |
|
| 52 | - * @internal param int $value Initial value of the field. |
|
| 53 | - * <b>Warning:</b> this is readable in cleartext in the page's source! |
|
| 54 | - */ |
|
| 55 | - public function __construct($object, $key) |
|
| 56 | - { |
|
| 57 | - $var = $object->vars[$key]; |
|
| 58 | - $control = $object->controls[$key]; |
|
| 43 | + /** |
|
| 44 | + * Constructor |
|
| 45 | + * |
|
| 46 | + * @param string $object |
|
| 47 | + * @param string $key |
|
| 48 | + * @internal param string $caption Caption |
|
| 49 | + * @internal param string $name "name" attribute |
|
| 50 | + * @internal param int $size Size of the field |
|
| 51 | + * @internal param int $maxlength Maximum length of the text |
|
| 52 | + * @internal param int $value Initial value of the field. |
|
| 53 | + * <b>Warning:</b> this is readable in cleartext in the page's source! |
|
| 54 | + */ |
|
| 55 | + public function __construct($object, $key) |
|
| 56 | + { |
|
| 57 | + $var = $object->vars[$key]; |
|
| 58 | + $control = $object->controls[$key]; |
|
| 59 | 59 | |
| 60 | - parent::__construct($var['form_caption'] . '<br>' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); |
|
| 60 | + parent::__construct($var['form_caption'] . '<br>' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); |
|
| 61 | 61 | |
| 62 | - $password_box1 = new \XoopsFormPassword('', $key . '1', 10, 32); |
|
| 63 | - $this->addElement($password_box1); |
|
| 62 | + $password_box1 = new \XoopsFormPassword('', $key . '1', 10, 32); |
|
| 63 | + $this->addElement($password_box1); |
|
| 64 | 64 | |
| 65 | - $password_box2 = new \XoopsFormPassword('', $key . '2', 10, 32); |
|
| 66 | - $this->addElement($password_box2); |
|
| 67 | - } |
|
| 65 | + $password_box2 = new \XoopsFormPassword('', $key . '2', 10, 32); |
|
| 66 | + $this->addElement($password_box2); |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -57,12 +57,12 @@ |
||
| 57 | 57 | $var = $object->vars[$key]; |
| 58 | 58 | $control = $object->controls[$key]; |
| 59 | 59 | |
| 60 | - parent::__construct($var['form_caption'] . '<br>' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); |
|
| 60 | + parent::__construct($var['form_caption'].'<br>'._US_TYPEPASSTWICE, ' ', $key.'_password_tray'); |
|
| 61 | 61 | |
| 62 | - $password_box1 = new \XoopsFormPassword('', $key . '1', 10, 32); |
|
| 62 | + $password_box1 = new \XoopsFormPassword('', $key.'1', 10, 32); |
|
| 63 | 63 | $this->addElement($password_box1); |
| 64 | 64 | |
| 65 | - $password_box2 = new \XoopsFormPassword('', $key . '2', 10, 32); |
|
| 65 | + $password_box2 = new \XoopsFormPassword('', $key.'2', 10, 32); |
|
| 66 | 66 | $this->addElement($password_box2); |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -26,41 +26,41 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class SmartFormSection extends \XoopsFormElement |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * Text |
|
| 31 | - * @var string |
|
| 32 | - * @access private |
|
| 33 | - */ |
|
| 34 | - public $_value; |
|
| 29 | + /** |
|
| 30 | + * Text |
|
| 31 | + * @var string |
|
| 32 | + * @access private |
|
| 33 | + */ |
|
| 34 | + public $_value; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * SmartFormSection constructor. |
|
| 38 | - * @param $sectionname |
|
| 39 | - * @param bool $value |
|
| 40 | - */ |
|
| 41 | - public function __construct($sectionname, $value = false) |
|
| 42 | - { |
|
| 43 | - $this->setName($sectionname); |
|
| 44 | - $this->_value = $value; |
|
| 45 | - } |
|
| 36 | + /** |
|
| 37 | + * SmartFormSection constructor. |
|
| 38 | + * @param $sectionname |
|
| 39 | + * @param bool $value |
|
| 40 | + */ |
|
| 41 | + public function __construct($sectionname, $value = false) |
|
| 42 | + { |
|
| 43 | + $this->setName($sectionname); |
|
| 44 | + $this->_value = $value; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Get the text |
|
| 49 | - * |
|
| 50 | - * @return string |
|
| 51 | - */ |
|
| 52 | - public function getValue() |
|
| 53 | - { |
|
| 54 | - return $this->_value; |
|
| 55 | - } |
|
| 47 | + /** |
|
| 48 | + * Get the text |
|
| 49 | + * |
|
| 50 | + * @return string |
|
| 51 | + */ |
|
| 52 | + public function getValue() |
|
| 53 | + { |
|
| 54 | + return $this->_value; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Prepare HTML for output |
|
| 59 | - * |
|
| 60 | - * @return string |
|
| 61 | - */ |
|
| 62 | - public function render() |
|
| 63 | - { |
|
| 64 | - return $this->getValue(); |
|
| 65 | - } |
|
| 57 | + /** |
|
| 58 | + * Prepare HTML for output |
|
| 59 | + * |
|
| 60 | + * @return string |
|
| 61 | + */ |
|
| 62 | + public function render() |
|
| 63 | + { |
|
| 64 | + return $this->getValue(); |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -26,41 +26,41 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class SmartFormSectionClose extends \XoopsFormElement |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * Text |
|
| 31 | - * @var string |
|
| 32 | - * @access private |
|
| 33 | - */ |
|
| 34 | - public $_value; |
|
| 29 | + /** |
|
| 30 | + * Text |
|
| 31 | + * @var string |
|
| 32 | + * @access private |
|
| 33 | + */ |
|
| 34 | + public $_value; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * SmartFormSectionClose constructor. |
|
| 38 | - * @param $sectionname |
|
| 39 | - * @param bool $value |
|
| 40 | - */ |
|
| 41 | - public function __construct($sectionname, $value = false) |
|
| 42 | - { |
|
| 43 | - $this->setName($sectionname); |
|
| 44 | - $this->_value = $value; |
|
| 45 | - } |
|
| 36 | + /** |
|
| 37 | + * SmartFormSectionClose constructor. |
|
| 38 | + * @param $sectionname |
|
| 39 | + * @param bool $value |
|
| 40 | + */ |
|
| 41 | + public function __construct($sectionname, $value = false) |
|
| 42 | + { |
|
| 43 | + $this->setName($sectionname); |
|
| 44 | + $this->_value = $value; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Get the text |
|
| 49 | - * |
|
| 50 | - * @return string |
|
| 51 | - */ |
|
| 52 | - public function getValue() |
|
| 53 | - { |
|
| 54 | - return $this->_value; |
|
| 55 | - } |
|
| 47 | + /** |
|
| 48 | + * Get the text |
|
| 49 | + * |
|
| 50 | + * @return string |
|
| 51 | + */ |
|
| 52 | + public function getValue() |
|
| 53 | + { |
|
| 54 | + return $this->_value; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Prepare HTML for output |
|
| 59 | - * |
|
| 60 | - * @return string |
|
| 61 | - */ |
|
| 62 | - public function render() |
|
| 63 | - { |
|
| 64 | - return $this->getValue(); |
|
| 65 | - } |
|
| 57 | + /** |
|
| 58 | + * Prepare HTML for output |
|
| 59 | + * |
|
| 60 | + * @return string |
|
| 61 | + */ |
|
| 62 | + public function render() |
|
| 63 | + { |
|
| 64 | + return $this->getValue(); |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class SmartFormEmailElement extends \XoopsFormElement |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * @param bool $withtags |
|
| 31 | - * @return string |
|
| 32 | - */ |
|
| 33 | - public function renderValidationJS($withtags = true) |
|
| 34 | - { |
|
| 35 | - $js = ''; |
|
| 29 | + /** |
|
| 30 | + * @param bool $withtags |
|
| 31 | + * @return string |
|
| 32 | + */ |
|
| 33 | + public function renderValidationJS($withtags = true) |
|
| 34 | + { |
|
| 35 | + $js = ''; |
|
| 36 | 36 | |
| 37 | - return $js; |
|
| 38 | - } |
|
| 37 | + return $js; |
|
| 38 | + } |
|
| 39 | 39 | } |
@@ -17,13 +17,13 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class SmartFormDateTimeElement extends \XoopsFormDateTime |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * SmartFormDateTimeElement constructor. |
|
| 22 | - * @param mixed $object |
|
| 23 | - * @param mixed $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 | + * SmartFormDateTimeElement constructor. |
|
| 22 | + * @param mixed $object |
|
| 23 | + * @param mixed $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 | } |
@@ -18,39 +18,39 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class SmartFormRichFileElement extends \XoopsFormElementTray |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * SmartFormRichFileElement 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 | - if ('' !== $object->getVar('url')) { |
|
| 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>')); |
|
| 33 | - //$this->addElement( new \XoopsFormLabel( '', "<br><a href = '".SMARTOBJECT_URL."admin/file.php?op=del&fileid=".$object->id()."'>"._CO_SOBJECT_DELETE_FILE."</a>")); |
|
| 34 | - } |
|
| 21 | + /** |
|
| 22 | + * SmartFormRichFileElement 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 | + if ('' !== $object->getVar('url')) { |
|
| 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>')); |
|
| 33 | + //$this->addElement( new \XoopsFormLabel( '', "<br><a href = '".SMARTOBJECT_URL."admin/file.php?op=del&fileid=".$object->id()."'>"._CO_SOBJECT_DELETE_FILE."</a>")); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | // require_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php'; |
| 37 | - if ($object->isNew()) { |
|
| 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)); |
|
| 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'))); |
|
| 37 | + if ($object->isNew()) { |
|
| 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)); |
|
| 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'))); |
|
| 47 | 47 | |
| 48 | - if (!$object->isNew()) { |
|
| 49 | - $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CHANGE_FILE)); |
|
| 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)); |
|
| 54 | - } |
|
| 55 | - } |
|
| 48 | + if (!$object->isNew()) { |
|
| 49 | + $this->addElement(new \XoopsFormLabel('', '<br>' . _CO_SOBJECT_CHANGE_FILE)); |
|
| 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)); |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -29,28 +29,28 @@ |
||
| 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 | } |