XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
formtextdateselect.php
1<?php
13
14if (!defined('XOOPS_ROOT_PATH')) {
15 exit();
16}
17
18
19class XoopsFormTextDateSelect extends XoopsFormText
20{
21
22 public function __construct($caption, $name, $size = 15, $value= 0)
23 {
24 $value = !is_numeric($value) ? time() : (int)$value;
25 $this->XoopsFormText($caption, $name, $size, 25, $value);
26 }
27 public function XoopsFormTextDateSelect($caption, $name, $size = 15, $value= 0)
28 {
29 return $this->__construct($caption, $name, $size, $value);
30 }
31
32 public function render()
33 {
34 $root =& XCube_Root::getSingleton();
35 $renderSystem =& $root->getRenderSystem(XOOPSFORM_DEPENDENCE_RENDER_SYSTEM);
36
37 $renderTarget =& $renderSystem->createRenderTarget('main');
38
39 $renderTarget->setAttribute('legacy_module', 'legacy');
40 $renderTarget->setTemplateName('legacy_xoopsform_textdateselect.html');
41 $renderTarget->setAttribute('element', $this);
42 $renderTarget->setAttribute('date', date('Y-m-d', $this->getValue()));
43
44 $jstime = formatTimestamp($this->getValue(), '"F j, Y H:i:s"');
45 include_once XOOPS_ROOT_PATH.'/include/calendarjs.php'; //< FIXME
46
47 $renderSystem->render($renderTarget);
48
49 return $renderTarget->getResult();
50 }
51}