1 |
552
|
thorn
|
<?php
|
2 |
|
|
|
3 |
571
|
thorn
|
// $Id$
|
4 |
552
|
thorn
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
|
|
Copyright (C) 2004-2008, Ryan Djurovich
|
9 |
|
|
|
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 |
|
|
<style type="text/css">
|
37 |
|
|
<?php
|
38 |
571
|
thorn
|
require_once(WB_PATH.'/include/jscalendar/calendar-system.css');
|
39 |
552
|
thorn
|
?>
|
40 |
|
|
</style>
|
41 |
|
|
<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 |
571
|
thorn
|
$jscal_today = date('Y/m/d');
|
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 |
|
|
switch(DATE_FORMAT) {
|
57 |
|
|
case 'd.m.Y':
|
58 |
|
|
case 'd M Y':
|
59 |
|
|
case 'l, jS F, Y':
|
60 |
|
|
case 'jS F, Y':
|
61 |
|
|
case 'D M d, Y':
|
62 |
|
|
case 'd-m-Y':
|
63 |
|
|
case 'd/m/Y':
|
64 |
571
|
thorn
|
$jscal_format = 'd.m.Y'; // dd.mm.yyyy hh:mm
|
65 |
|
|
$jscal_ifformat = '%d.%m.%Y';
|
66 |
552
|
thorn
|
break;
|
67 |
|
|
case 'm/d/Y':
|
68 |
|
|
case 'm-d-Y':
|
69 |
|
|
case 'M d Y':
|
70 |
|
|
case 'm.d.Y':
|
71 |
571
|
thorn
|
$jscal_format = 'm/d/Y'; // mm/dd/yyyy hh:mm
|
72 |
|
|
$jscal_ifformat = '%m/%d/%Y';
|
73 |
552
|
thorn
|
break;
|
74 |
|
|
default:
|
75 |
571
|
thorn
|
$jscal_format = 'Y-m-d'; // yyyy-mm-dd hh:mm
|
76 |
|
|
$jscal_ifformat = '%Y-%m-%d';
|
77 |
552
|
thorn
|
break;
|
78 |
|
|
}
|
79 |
571
|
thorn
|
if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
|
80 |
|
|
$jscal_format .= ' H:i';
|
81 |
|
|
$jscal_ifformat .= ' %H:%M';
|
82 |
|
|
}
|
83 |
552
|
thorn
|
// load scripts for jscalendar
|
84 |
|
|
?>
|
85 |
|
|
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js"></script>
|
86 |
|
|
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js"></script>
|