21 defined(
'XOOPS_ROOT_PATH') or die("XOOPS root path not defined");
32 $value = !is_numeric($value) ? time() : intval($value);
33 $value = ($value == 0) ? time() : $value;
34 $this->XoopsFormText($caption, $name, $size, 25, $value);
39 static $included =
false;
40 include_once XOOPS_ROOT_PATH .
'/language/' .
$GLOBALS[
'xoopsConfig'][
'language'] .
'/calendar.php';
42 $ele_name = $this->getName();
43 $ele_value = $this->getValue(
false);
44 if (is_string($ele_value)) {
45 $display_value = $ele_value;
52 if (is_object(
$GLOBALS[
'xoTheme'])) {
53 $GLOBALS[
'xoTheme']->addScript(
'include/calendar.js');
54 $GLOBALS[
'xoTheme']->addStylesheet(
'include/calendar-blue.css');
57 $GLOBALS[
'xoTheme']->addScript(
'',
'',
'
60 function selected(cal, date) {
64 function closeHandler(cal) {
66 Calendar.removeEvent(document, "mousedown", checkCalendar);
69 function checkCalendar(ev) {
70 var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
71 for (; el != null; el = el.parentNode)
72 if (el == calendar.element || el.tagName == "A") break;
74 calendar.callCloseHandler(); Calendar.stopEvent(ev);
77 function showCalendar(id) {
78 var el = xoopsGetElementById(id);
79 if (calendar != null) {
82 var cal = new Calendar(true, "' . $jstime .
'", selected, closeHandler);
84 cal.setRange(1900, 2100);
88 calendar.parseDate(el.value);
89 calendar.showAtElement(el);
90 Calendar.addEvent(document, "mousedown", checkCalendar);
94 Calendar._DN = new Array
103 Calendar._MN = new Array
126 Calendar._TT["PART_TODAY"] = "(' .
_CAL_TODAY .
')";
129 Calendar._TT["CLOSE"] = "' .
_CLOSE .
'";
133 Calendar._TT["DEF_DATE_FORMAT"] = "' .
_CAL_FORMAT .
'";
134 Calendar._TT["TT_DATE_FORMAT"] = "' .
_CAL_FORMAT .
'";
136 Calendar._TT["WK"] = "";
140 return "<input type='text' name='" . $ele_name .
"' id='" . $ele_name .
"' size='" . $this->getSize() .
"' maxlength='" . $this->getMaxlength() .
"' value='" . $display_value .
"'" . $this->getExtra() .
" /><input type='reset' value=' ... ' onclick='return showCalendar(\"" . $ele_name .
"\");'>";