1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category admin
|
5
|
* @package interface
|
6
|
* @author Ryan Djurovich (2004-2009),WebsiteBaker Project
|
7
|
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: time_formats.php 1807 2012-11-07 10:22:51Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/interface/time_formats.php $
|
14
|
* @lastmodified $Date: 2012-11-07 11:22:51 +0100 (Wed, 07 Nov 2012) $
|
15
|
*
|
16
|
* Time format list file
|
17
|
* This file is used to generate a list of time formats for the user to select
|
18
|
*
|
19
|
*/
|
20
|
|
21
|
/* -------------------------------------------------------- */
|
22
|
// Must include code to stop this file being accessed directly
|
23
|
if(!defined('WB_PATH')) {
|
24
|
require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
|
25
|
throw new IllegalFileException();
|
26
|
}
|
27
|
/* -------------------------------------------------------- */
|
28
|
|
29
|
// Define that this file is loaded
|
30
|
if(!defined('TIME_FORMATS_LOADED')) {
|
31
|
define('TIME_FORMATS_LOADED', true);
|
32
|
}
|
33
|
|
34
|
// Create array
|
35
|
$TIME_FORMATS = array();
|
36
|
|
37
|
// Get the current time (in the users timezone if required)
|
38
|
$actual_time = time()+ ((isset($user_time) AND $user_time == true) ? TIMEZONE : DEFAULT_TIMEZONE);
|
39
|
|
40
|
// Add values to list
|
41
|
$TIME_FORMATS['h:i|A'] = gmdate('h:i A', $actual_time);
|
42
|
$TIME_FORMATS['h:i|a'] = gmdate('h:i a', $actual_time);
|
43
|
$TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $actual_time);
|
44
|
$TIME_FORMATS['H:i'] = gmdate('H:i', $actual_time);
|
45
|
|
46
|
// Add "System Default" to list (if we need to)
|
47
|
if(isset($user_time) AND $user_time == true) {
|
48
|
if(isset($TEXT['SYSTEM_DEFAULT'])) {
|
49
|
$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $actual_time).' ('.$TEXT['SYSTEM_DEFAULT'].')';
|
50
|
} else {
|
51
|
$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $actual_time).' (System Default)';
|
52
|
}
|
53
|
}
|
54
|
|
55
|
// Reverse array so "System Default" is at the top
|
56
|
$TIME_FORMATS = array_reverse($TIME_FORMATS, true);
|
57
|
|