Project

General

Profile

1
<?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: time_formats.php 2 2017-07-02 15:14:29Z Manuela $
14
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/branches/main/admin/interface/time_formats.php $
15
 * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
16
 *
17
 * Time format list file
18
 * This file is used to generate a list of time 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('TIME_FORMATS_LOADED')) {
29
    define('TIME_FORMATS_LOADED', true);
30
}
31

    
32
// Create array
33
$TIME_FORMATS = array();
34

    
35
// Get the current time (in the users timezone if required)
36
$actual_time = time()+ ((isset($user_time) AND $user_time == true) ? TIMEZONE : DEFAULT_TIMEZONE);
37

    
38
// Add values to list
39
$TIME_FORMATS['g:i|A'] = gmdate('g:i A', $actual_time);
40
$TIME_FORMATS['g:i|a'] = gmdate('g:i a', $actual_time);
41
$TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $actual_time);
42
$TIME_FORMATS['H:i'] = gmdate('H:i', $actual_time);
43

    
44
// Add "System Default" to list (if we need to)
45
if(isset($user_time) AND $user_time == true) {
46
    if(isset($TEXT['SYSTEM_DEFAULT'])) {
47
        $TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $actual_time).' ('.$TEXT['SYSTEM_DEFAULT'].')';
48
    } else {
49
        $TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $actual_time).' (System Default)';
50
    }
51
}
52

    
53
// Reverse array so "System Default" is at the top
54
$TIME_FORMATS = array_reverse($TIME_FORMATS, true);
55

    
56
?>
(4-4/6)