2 if ( empty ( $PHP_SELF ) && ! empty ( $_SERVER ) &&
3 ! empty ( $_SERVER['PHP_SELF'] ) ) {
4 $PHP_SELF = $_SERVER['PHP_SELF'];
6 if ( ! empty ( $PHP_SELF ) && preg_match ( "/\/includes\//", $PHP_SELF ) ) {
7 die ( "You can't access this file directly!" );
9 global $month, $day, $year;
12 <script type="text/javascript">
15 NS4 = (document.layers) ? 1 : 0;
16 IE4 = (document.all) ? 1 : 0;
17 // W3C stands for the W3C standard, implemented in Mozilla (and Netscape 6) and IE5
18 W3C = (document.getElementById) ? 1 : 0;
19 //Function is similar to visible.php, but effects the parent
20 function makeVisible ( name ) {
24 ele = window.opener.document.getElementById(name);
26 ele = window.opener.document.layers[name];
28 ele = window.opener.document.all[name];
32 ele.visibility = "show";
33 } else { // IE4 & W3C & Mozilla
34 ele.style.visibility = "visible";
38 function schedule_event(hours, minutes) {
39 var year =<?php echo $year ?> ;
40 var month =<?php echo $month ?> ;
41 var day =<?php echo $day ?> ;
42 if (confirm("<?php etranslate("Change the date and time of this entry?")?>")) {
43 var parentForm = window.opener.document.editentryform;
44 parentForm.timetype.selectedIndex = 1;
45 //Make time controls visible on parent
46 makeVisible ( "timeentrystart" );
47 if ( parentForm.duration_h ) {
48 makeVisible ( "timeentryduration" );
50 makeVisible ( "timeentryend" );
53 parentForm.hour.value = hours - 12;
54 if ( parentForm.ampm ) {
55 parentForm.ampm[1].checked = true;
58 parentForm.hour.value = hours;
59 if ( hours == 12 && parentForm.ampm ) {
60 parentForm.ampm[1].checked = true;
62 if ( parentForm.ampm ) {
63 parentForm.ampm[0].checked = true;
67 parentForm.minute.value = minutes;
68 parentForm.day.selectedIndex = day - 1;
69 parentForm.month.selectedIndex = month - 1;
70 for ( i = 0; i < parentForm.year.length; i++ ) {
71 if ( parentForm.year.options[i].value == year ) {
72 parentForm.year.selectedIndex = i;