Project

General

Profile

1
<?php
2

    
3
// $Id: wb-setup.php 2 2017-07-02 15:14:29Z Manuela $
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
    $timezones = (time()+TIMEZONE);
51
    $jscal_today = gmdate('Y/m/d H:i', $timezones);
52
    // first-day-of-week
53
    $jscal_firstday = '1'; // monday
54
    if(LANGUAGE=='EN')
55
        $jscal_firstday = '0'; // sunday
56
    // 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
57
    // 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.
58
    switch(DATE_FORMAT) {
59
        case 'd.m.Y':
60
        case 'd M Y':
61
        case 'l, jS F, Y':
62
        case 'jS F, Y':
63
        case 'D M d, Y':
64
        case 'd-m-Y':
65
        case 'd/m/Y':
66
            $jscal_format = 'd.m.Y'; // dd.mm.yyyy hh:mm
67
            $jscal_ifformat = '%d.%m.%Y';
68
            break;
69
        case 'm/d/Y':
70
        case 'm-d-Y':
71
        case 'M d Y':
72
        case 'm.d.Y':
73
            $jscal_format = 'm/d/Y'; // mm/dd/yyyy hh:mm
74
            $jscal_ifformat = '%m/%d/%Y';
75
            break;
76
        default:
77
            $jscal_format = 'Y-m-d'; // yyyy-mm-dd hh:mm
78
            $jscal_ifformat = '%Y-%m-%d';
79
            break;
80
    }
81
    if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
82
        $jscal_format .= ' H:i';
83
        $jscal_ifformat .= ' %H:%M';
84
    }
85

    
86
    // load scripts for jscalendar
87
?>
88
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js"></script>
89
<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js"></script>
(10-10/10)