XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
formbutton.php
1<?php
13
14if (!defined('XOOPS_ROOT_PATH')) {
15 exit();
16}
17
18class XoopsFormButton extends XoopsFormElement
19{
20
26 public $_value;
27
33 public $_type;
34
44 public function __construct($caption, $name, $value= '', $type= 'button')
45 {
46 $this->setCaption($caption);
47 $this->setName($name);
48 $this->_type = $type;
49 $this->setValue($value);
50 }
51 public function XoopsFormButton($caption, $name, $value= '', $type= 'button')
52 {
53 return self::__construct($caption, $name, $value, $type);
54 }
55
61 public function getValue()
62 {
63 return $this->_value;
64 }
65
72 public function setValue($value)
73 {
74 $this->_value = $value;
75 }
76
82 public function getType()
83 {
84 return $this->_type;
85 }
86
92 public function render()
93 {
94 $root =& XCube_Root::getSingleton();
95 $renderSystem =& $root->getRenderSystem(XOOPSFORM_DEPENDENCE_RENDER_SYSTEM);
96
97 $renderTarget =& $renderSystem->createRenderTarget('main');
98
99 $renderTarget->setAttribute('legacy_module', 'legacy');
100 $renderTarget->setTemplateName('legacy_xoopsform_button.html');
101 $renderTarget->setAttribute('element', $this);
102
103 $renderSystem->render($renderTarget);
104
105 return $renderTarget->getResult();
106 }
107}
__construct($caption, $name, $value='', $type='button')
setCaption($caption)