1 |
552
|
thorn
|
<?php
|
2 |
|
|
|
3 |
643
|
thorn
|
// $Id$
|
4 |
552
|
thorn
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
915
|
Ruebenwurz
|
Copyright (C) 2004-2009, Ryan Djurovich
|
9 |
552
|
thorn
|
|
10 |
|
|
Website Baker is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
(at your option) any later version.
|
14 |
|
|
|
15 |
|
|
Website Baker is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with Website Baker; if not, write to the Free Software
|
22 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
|
24 |
|
|
*/
|
25 |
|
|
|
26 |
|
|
/*
|
27 |
|
|
import jscalendar css and scripts
|
28 |
|
|
*/
|
29 |
|
|
|
30 |
|
|
if(!defined('WB_URL')) {
|
31 |
|
|
header('Location: ../index.php');
|
32 |
|
|
exit(0);
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
?>
|
36 |
1009
|
Ruebenwurz
|
<!--<style type="text/css">-->
|
37 |
552
|
thorn
|
<?php
|
38 |
1009
|
Ruebenwurz
|
// require_once(WB_PATH.'/include/jscalendar/calendar-system.css');
|
39 |
552
|
thorn
|
?>
|
40 |
1009
|
Ruebenwurz
|
<!--</style> -->
|
41 |
552
|
thorn
|
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar.js"></script>
|
42 |
|
|
<?php // some stuff for jscalendar
|
43 |
|
|
// language
|
44 |
571
|
thorn
|
$jscal_lang = defined('LANGUAGE')?strtolower(LANGUAGE):'en';
|
45 |
|
|
$jscal_lang = $jscal_lang!=''?$jscal_lang:'en';
|
46 |
552
|
thorn
|
if(!file_exists(WB_PATH."/include/jscalendar/lang/calendar-$jscal_lang.js")) {
|
47 |
571
|
thorn
|
$jscal_lang = 'en';
|
48 |
552
|
thorn
|
}
|
49 |
|
|
// today
|
50 |
1369
|
Luisehahne
|
$jscal_today = gmdate('Y/m/d H:i');
|
51 |
552
|
thorn
|
// first-day-of-week
|
52 |
571
|
thorn
|
$jscal_firstday = '1'; // monday
|
53 |
|
|
if(LANGUAGE=='EN')
|
54 |
|
|
$jscal_firstday = '0'; // sunday
|
55 |
552
|
thorn
|
// date and time format for the text-field and for jscal's "ifFormat". We offer dd.mm.yyyy or yyyy-mm-dd or mm/dd/yyyy
|
56 |
643
|
thorn
|
// ATTN: strtotime() fails with "dd.mm.yyyy" and PHP4. So the string has to be converted to e.g. "yyyy-mm-dd", which will work.
|
57 |
552
|
thorn
|
switch(DATE_FORMAT) {
|
58 |
|
|
case 'd.m.Y':
|
59 |
|
|
case 'd M Y':
|
60 |
|
|
case 'l, jS F, Y':
|
61 |
|
|
case 'jS F, Y':
|
62 |
|
|
case 'D M d, Y':
|
63 |
|
|
case 'd-m-Y':
|
64 |
|
|
case 'd/m/Y':
|
65 |
571
|
thorn
|
$jscal_format = 'd.m.Y'; // dd.mm.yyyy hh:mm
|
66 |
|
|
$jscal_ifformat = '%d.%m.%Y';
|
67 |
552
|
thorn
|
break;
|
68 |
|
|
case 'm/d/Y':
|
69 |
|
|
case 'm-d-Y':
|
70 |
|
|
case 'M d Y':
|
71 |
|
|
case 'm.d.Y':
|
72 |
571
|
thorn
|
$jscal_format = 'm/d/Y'; // mm/dd/yyyy hh:mm
|
73 |
|
|
$jscal_ifformat = '%m/%d/%Y';
|
74 |
552
|
thorn
|
break;
|
75 |
|
|
default:
|
76 |
571
|
thorn
|
$jscal_format = 'Y-m-d'; // yyyy-mm-dd hh:mm
|
77 |
|
|
$jscal_ifformat = '%Y-%m-%d';
|
78 |
552
|
thorn
|
break;
|
79 |
|
|
}
|
80 |
571
|
thorn
|
if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
|
81 |
|
|
$jscal_format .= ' H:i';
|
82 |
|
|
$jscal_ifformat .= ' %H:%M';
|
83 |
|
|
}
|
84 |
1369
|
Luisehahne
|
|
85 |
552
|
thorn
|
// load scripts for jscalendar
|
86 |
|
|
?>
|
87 |
|
|
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js"></script>
|
88 |
|
|
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js"></script>
|