forked from sauruscms/Saurus-CMS-Community-Edition
-
Notifications
You must be signed in to change notification settings - Fork 1
/
kalender.php
112 lines (98 loc) · 3.75 KB
/
kalender.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* This source file is is part of Saurus CMS content management software.
* It is licensed under MPL 1.1 (http://www.opensource.org/licenses/mozilla1.1.php).
* Copyright (C) 2000-2010 Saurused Ltd (http://www.saurus.info/).
* Redistribution of this file must retain the above copyright notice.
*
* Please note that the original authors never thought this would turn out
* such a great piece of software when the work started using Perl in year 2000.
* Due to organic growth, you may find parts of the software being
* a bit (well maybe more than a bit) old fashioned and here's where you can help.
* Good luck and keep your open source minds open!
*
* @package SaurusCMS
* @copyright 2000-2010 Saurused Ltd (http://www.saurus.info/)
* @license Mozilla Public License 1.1 (http://www.opensource.org/licenses/mozilla1.1.php)
*
*/
##############################
# Shows calendar in popup window
# : is usually target for selecting dates links/buttons in forms
# : writes selected date into form field (given by parameters "vorm", "lahter")
# : is independent script, not for including, new Site is generated
##############################
global $site;
preg_match('/\/(admin|editor)\//i', $_SERVER["REQUEST_URI"], $matches);
$class_path = $matches[1] == "editor" ? "../classes/" : "./classes/";
include($class_path."port.inc.php");
$site = new Site(array(
on_debug=>0,
on_admin_keel => 1
));
?>
<html>
<head>
<title><?=$site->title?> <?= $site->cms_version ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$site->encoding ?>">
<link rel="stylesheet" href="<?=$site->CONF['wwwroot'].$site->CONF['styles_path']?>/scms_general.css">
<link rel="stylesheet" href="<?=$site->CONF['wwwroot'].$site->CONF['styles_path']?>/datepicker.css">
<script type="text/javascript" src="<?=$site->CONF['wwwroot'].$site->CONF['js_path'] ?>/yld.js"></script>
<script type="text/javascript" src="<?=$site->CONF['wwwroot'].$site->CONF['js_path'] ?>/jquery.js"></script>
<script type="text/javascript" src="<?=$site->CONF['wwwroot'].$site->CONF['js_path'] ?>/datepicker.js"></script>
<script type="text/javascript" src="<?=$site->CONF['wwwroot'];?>/common.js.php"></script>
<script type="text/javascript">
//<!--
// Handle click of OK link
function handleOK(selected_date) {
if (opener && !opener.closed) {
opener.document.<?if(isset($site->fdat['form'])){echo $site->fdat['form'];}else{ echo $site->fdat['vorm'];}?>.<?if(isset($site->fdat['form_field'])){echo $site->fdat['form_field'];}else{ echo $site->fdat['lahter'];}?>.value=selected_date;
opener.document.<?if(isset($site->fdat['form'])){echo $site->fdat['form'];}else{ echo $site->fdat['vorm'];}?>.<?if(isset($site->fdat['form_field'])){echo $site->fdat['form_field'];}else{ echo $site->fdat['lahter'];}?>.focus();
} else {
alert('You have closed the main window.\n\nNo action will be taken on the choices in this dialog box.');
}
window.close();
return false;
}
//-->
</script>
</head>
<body onLoad="if (opener) opener.blockEvents()" onUnload="if (opener) opener.unblockEvents()">
<?
if($site->fdat['month']>=1&&$site->fdat['month']<=12)
{
$month = $site->fdat['month'];
}else{
$month = date("m");
}
if(is_numeric($site->fdat['year'])){
$year = $site->fdat['year'];
}else{
$year = date("Y");
}
if(is_numeric($site->fdat['day'])){
$day = $site->fdat['day'];
}else{
$day = date("d");
}
?>
<script type="text/javascript">
jQuery(function($){
load_datepicker_settings();
$('#inlinekalender').datepicker({
defaultDate: new Date(<?=$year;?>, <?=$month;?> - 1, <?=$day;?>),
onSelect: function(date) {
handleOK(date)
}
});
});
</script>
<table align="center" border="0">
<tr>
<td>
<span id="inlinekalender"></span>
</td>
</tr>
</table>
</body>
</html>