Project

General

Profile

1 2 Manuela
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         interface
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link            http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource      $HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 * Date format list file
18
 * This file is used to generate a list of date formats for the user to select
19
 *
20
 */
21
22
if(!defined('WB_URL')) {
23
    header('Location: ../../../index.php');
24
    exit(0);
25
}
26
27
// Define that this file is loaded
28
if(!defined('DATE_FORMATS_LOADED')) {
29
    define('DATE_FORMATS_LOADED', true);
30
}
31
32
// Create array
33
$DATE_FORMATS = array();
34
35
// Get the current time (in the users timezone if required)
36
$actual_time = time()+ ((isset($user_time) && $user_time == true) ? TIMEZONE : DEFAULT_TIMEZONE);
37
38
// Add values to list
39
$DATE_FORMATS['l,|jS|F,|Y'] = gmdate('l, jS F, Y', $actual_time);
40
$DATE_FORMATS['jS|F,|Y'] = gmdate('jS F, Y', $actual_time);
41
$DATE_FORMATS['d|M|Y'] = gmdate('d M Y', $actual_time);
42
$DATE_FORMATS['M|d|Y'] = gmdate('M d Y', $actual_time);
43
$DATE_FORMATS['D|M|d,|Y'] = gmdate('D M d, Y', $actual_time);
44
$DATE_FORMATS['d-m-Y'] = gmdate('d-m-Y', $actual_time).' (D-M-Y)';
45
$DATE_FORMATS['m-d-Y'] = gmdate('m-d-Y', $actual_time).' (M-D-Y)';
46
$DATE_FORMATS['d.m.Y'] = gmdate('d.m.Y', $actual_time).' (D.M.Y)';
47
$DATE_FORMATS['m.d.Y'] = gmdate('m.d.Y', $actual_time).' (M.D.Y)';
48
$DATE_FORMATS['d/m/Y'] = gmdate('d/m/Y', $actual_time).' (D/M/Y)';
49
$DATE_FORMATS['m/d/Y'] = gmdate('m/d/Y', $actual_time).' (M/D/Y)';
50
$DATE_FORMATS['j.n.Y'] = gmdate('j.n.Y', $actual_time).' (j.n.Y)';
51
52
// Add "System Default" to list (if we need to)
53
if(isset($user_time) && $user_time == true)
54
{
55
    if(isset($TEXT['SYSTEM_DEFAULT']))
56
    {
57
        $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $actual_time).' ('.$TEXT['SYSTEM_DEFAULT'].')';
58
    } else {
59
        $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $actual_time).' (System Default)';
60
    }
61
}
62
63
// Reverse array so "System Default" is at the top
64
$DATE_FORMATS = array_reverse($DATE_FORMATS, true);
65
66
?>