Project

General

Profile

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 1872 2013-02-25 11:48:24Z Luisehahne $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/interface/time_formats.php $
14
 * @lastmodified    $Date: 2013-02-25 12:48:24 +0100 (Mon, 25 Feb 2013) $
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
$iTimeZone = TIMEZONE!=0 ? TIMEZONE/3600 : 0;
39
$iTimeZone = ( ($iTimeZone >= -12 && $iTimeZone <= 13) ? TIMEZONE : $iTimeZone );
40
$actual_time = time()+ ((isset($user_time) AND $user_time == true) ? $iTimeZone : DEFAULT_TIMEZONE);
41
// Add values to list
42
$TIME_FORMATS['h:i|A'] = gmdate('h:i A', $actual_time);
43
$TIME_FORMATS['h:i|a'] = gmdate('h:i a', $actual_time);
44
$TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $actual_time);
45
$TIME_FORMATS['H:i']   = gmdate('H:i',   $actual_time);
46

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

    
56
// Reverse array so "System Default" is at the top
57
$TIME_FORMATS = array_reverse($TIME_FORMATS, true);
58

    
(5-5/7)