Project

General

Profile

1
<?php
2

    
3
// $Id$
4

    
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
require_once(WB_PATH.'/include/jscalendar/calendar-system.css');
39
?>
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
	$jscal_lang = defined('LANGUAGE')?strtolower(LANGUAGE):'en';
45
	$jscal_lang = $jscal_lang!=''?$jscal_lang:'en';
46
	if(!file_exists(WB_PATH."/include/jscalendar/lang/calendar-$jscal_lang.js")) {
47
		$jscal_lang = 'en';
48
	}
49
	// today
50
	$jscal_today = date('Y/m/d');
51
	// first-day-of-week
52
	$jscal_firstday = '1'; // monday
53
	if(LANGUAGE=='EN')
54
		$jscal_firstday = '0'; // sunday
55
	// 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
			$jscal_format = 'd.m.Y'; // dd.mm.yyyy hh:mm
65
			$jscal_ifformat = '%d.%m.%Y';
66
			break;
67
		case 'm/d/Y':
68
		case 'm-d-Y':
69
		case 'M d Y':
70
		case 'm.d.Y':
71
			$jscal_format = 'm/d/Y'; // mm/dd/yyyy hh:mm
72
			$jscal_ifformat = '%m/%d/%Y';
73
			break;
74
		default:
75
			$jscal_format = 'Y-m-d'; // yyyy-mm-dd hh:mm
76
			$jscal_ifformat = '%Y-%m-%d';
77
			break;
78
	}
79
	if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
80
		$jscal_format .= ' H:i';
81
		$jscal_ifformat .= ' %H:%M';
82
	}
83
	// 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>
(8-8/8)