XOOPS  2.6.0
calendarjs.php
Go to the documentation of this file.
1 <?php
3 ?>
4 <link rel="stylesheet" type="text/css" media="all" href="<?php echo $xoops_url;?>/include/calendar-blue.css"/>
5 <script type="text/javascript" src="<?php echo $xoops_url . '/include/calendar.js';?>"></script>
6 <script type="text/javascript">
7  <!--
8  var calendar = null;
9 
10  function selected(cal, date)
11  {
12  cal.sel.value = date;
13  }
14 
15  function closeHandler(cal)
16  {
17  cal.hide();
18  Calendar.removeEvent(document, "mousedown", checkCalendar);
19  }
20 
21  function checkCalendar(ev)
22  {
23  var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
24  for (; el != null; el = el.parentNode) {
25  if (el == calendar.element || el.tagName == "A") {
26  break;
27  }
28  }
29  if (el == null) {
30  calendar.callCloseHandler();
31  Calendar.stopEvent(ev);
32  }
33  }
34  function showCalendar(id)
35  {
36  var el = xoopsGetElementById(id);
37  if (calendar != null) {
38  calendar.hide();
39  } else {
40  var cal = new Calendar(true, "<?php if (isset($jstime)) {
41  echo $jstime;
42  } else {
43  echo 'null';
44  }?>", selected, closeHandler);
45  calendar = cal;
46  cal.setRange(1900, 2100);
47  calendar.create();
48  }
49  calendar.sel = el;
50  calendar.parseDate(el.value);
51  calendar.showAtElement(el);
52  Calendar.addEvent(document, "mousedown", checkCalendar);
53  return false;
54  }
55 
56  Calendar._DN = new Array
57  ("<?php echo XoopsLocale::L_DAY_SUNDAY;?>",
58  "<?php echo XoopsLocale::L_DAY_MONDAY;?>",
59  "<?php echo XoopsLocale::L_DAY_TUESDAY;?>",
60  "<?php echo XoopsLocale::L_DAY_WEDNESDAY;?>",
61  "<?php echo XoopsLocale::L_DAY_THURSDAY;?>",
62  "<?php echo XoopsLocale::L_DAY_FRIDAY;?>",
63  "<?php echo XoopsLocale::L_DAY_SATURDAY;?>",
64  "<?php echo XoopsLocale::L_DAY_SUNDAY;?>");
65  Calendar._MN = new Array
66  ("<?php echo XoopsLocale::L_MONTH_JANUARY;?>",
67  "<?php echo XoopsLocale::L_MONTH_FEBRUARY;?>",
68  "<?php echo XoopsLocale::L_MONTH_MARCH;?>",
69  "<?php echo XoopsLocale::L_MONTH_APRIL;?>",
70  "<?php echo XoopsLocale::L_MONTH_MAY;?>",
71  "<?php echo XoopsLocale::L_MONTH_JUNE;?>",
72  "<?php echo XoopsLocale::L_MONTH_JULY;?>",
73  "<?php echo XoopsLocale::L_MONTH_AUGUST;?>",
74  "<?php echo XoopsLocale::L_MONTH_SEPTEMBER;?>",
75  "<?php echo XoopsLocale::L_MONTH_OCTOBER;?>",
76  "<?php echo XoopsLocale::L_MONTH_NOVEMBER;?>",
77  "<?php echo XoopsLocale::L_MONTH_DECEMBER;?>");
78 
79  Calendar._TT = {};
80  Calendar._TT["TOGGLE"] = "<?php echo XoopsLocale::TOGGLE_FIRST_DAY_OF_WEEK;?>";
81  Calendar._TT["PREV_YEAR"] = "<?php echo XoopsLocale::PREVIOUS_YEAR;?>";
82  Calendar._TT["PREV_MONTH"] = "<?php echo XoopsLocale::PREVIOUS_MONTH;?>";
83  Calendar._TT["GO_TODAY"] = "<?php echo XoopsLocale::GO_TODAY;?>";
84  Calendar._TT["NEXT_MONTH"] = "<?php echo XoopsLocale::NEXT_MONTH;?>";
85  Calendar._TT["NEXT_YEAR"] = "<?php echo XoopsLocale::NEXT_YEAR;?>";
86  Calendar._TT["SEL_DATE"] = "<?php echo XoopsLocale::SELECT_DATE;?>";
87  Calendar._TT["DRAG_TO_MOVE"] = "<?php echo XoopsLocale::DRAG_TO_MOVE;?>";
88  Calendar._TT["PART_TODAY"] = "(<?php echo XoopsLocale::TODAY;?>)";
89  Calendar._TT["MON_FIRST"] = "<?php echo XoopsLocale::DISPLAY_MONDAY_FIRST;?>";
90  Calendar._TT["SUN_FIRST"] = "<?php echo XoopsLocale::DISPLAY_SUNDAY_FIRST;?>";
91  Calendar._TT["CLOSE"] = "<?php echo XoopsLocale::A_CLOSE;?>";
92  Calendar._TT["TODAY"] = "<?php echo XoopsLocale::TODAY;?>";
93 
94  // date formats
95  // todo, strings not defined bellow?
96  Calendar._TT["DEF_DATE_FORMAT"] = "<?php echo _CAL_DEF_DATE_FORMAT;?>";
97  Calendar._TT["TT_DATE_FORMAT"] = "<?php echo _CAL_TT_DATE_FORMAT;?>";
98 
99  Calendar._TT["WK"] = "";
100  //-->
101 </script>
static get($name)
$xoops_url
Definition: calendarjs.php:2