1: <?php
2: /**
3: * XOOPS form element
4: *
5: * You may not change or alter any portion of this comment or credits
6: * of supporting developers from this source code or any supporting source code
7: * which is considered copyrighted (c) material of the original comment or credit authors.
8: * This program is distributed in the hope that it will be useful,
9: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * @copyright (c) 2000-2017 XOOPS Project (www.xoops.org)
13: * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
14: * @package kernel
15: * @subpackage form
16: * @since 2.0.0
17: * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
18: */
19:
20: defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
21:
22: /**
23: * A text field with calendar popup
24: */
25: class XoopsFormTextDateSelect extends XoopsFormText
26: {
27: /**
28: * @param string $caption
29: * @param string $name
30: * @param int $size
31: * @param int $value
32: */
33: public function __construct($caption, $name, $size = 15, $value = 0)
34: {
35: $value = !is_numeric($value) ? time() : (int)$value;
36: $value = ($value == 0) ? time() : $value;
37: parent::__construct($caption, $name, $size, 25, $value);
38: }
39:
40: /**
41: * {@inheritDoc}
42: * @see XoopsFormText::render()
43: */
44: public function render()
45: {
46: return XoopsFormRenderer::getInstance()->get()->renderFormTextDateSelect($this);
47: }
48: }
49: