Project

General

Profile

1
<?php
2

    
3
// $Id: wb-setup.php 1061 2009-07-14 12:15:53Z aldus $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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 = gmdate('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
	// 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
	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
			$jscal_format = 'd.m.Y'; // dd.mm.yyyy hh:mm
66
			$jscal_ifformat = '%d.%m.%Y';
67
			break;
68
		case 'm/d/Y':
69
		case 'm-d-Y':
70
		case 'M d Y':
71
		case 'm.d.Y':
72
			$jscal_format = 'm/d/Y'; // mm/dd/yyyy hh:mm
73
			$jscal_ifformat = '%m/%d/%Y';
74
			break;
75
		default:
76
			$jscal_format = 'Y-m-d'; // yyyy-mm-dd hh:mm
77
			$jscal_ifformat = '%Y-%m-%d';
78
			break;
79
	}
80
	if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
81
		$jscal_format .= ' H:i';
82
		$jscal_ifformat .= ' %H:%M';
83
	}
84
	// load scripts for jscalendar
85
?>
86
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js"></script>
87
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js"></script>
(10-10/10)