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