aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-07-18 16:52:52 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-07-18 16:52:52 +0200
commita71e60cdbd3e47c62a565dd777a28aec6832fb88 (patch)
tree5917a09f5a91dcbc2eb2cb80cb7e487c287e477d /phpBB/includes
parent515e1662a900526342b595692d73372f4fb7bbf9 (diff)
downloadforums-a71e60cdbd3e47c62a565dd777a28aec6832fb88.tar
forums-a71e60cdbd3e47c62a565dd777a28aec6832fb88.tar.gz
forums-a71e60cdbd3e47c62a565dd777a28aec6832fb88.tar.bz2
forums-a71e60cdbd3e47c62a565dd777a28aec6832fb88.tar.xz
forums-a71e60cdbd3e47c62a565dd777a28aec6832fb88.zip
[feature/new-tz-handling] Rename $user->tz back to $user->timezone
PHPBB3-9558
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_board.php6
-rw-r--r--phpBB/includes/datetime.php4
-rw-r--r--phpBB/includes/functions.php4
-rw-r--r--phpBB/includes/functions_user.php2
-rw-r--r--phpBB/includes/user.php10
5 files changed, 13 insertions, 13 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 47a08b0bab..4af9d52e44 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -915,8 +915,8 @@ class acp_board
global $user, $config;
// Let the format_date function operate with the acp values
- $old_tz = $user->tz;
- $user->tz = new DateTimeZone($config['board_timezone']);
+ $old_tz = $user->timezone;
+ $user->timezone = new DateTimeZone($config['board_timezone']);
$dateformat_options = '';
@@ -935,7 +935,7 @@ class acp_board
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
// Reset users date options
- $user->tz = $old_tz;
+ $user->timezone = $old_tz;
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php
index 0d80c77115..b3462ddf67 100644
--- a/phpBB/includes/datetime.php
+++ b/phpBB/includes/datetime.php
@@ -38,7 +38,7 @@ class phpbb_datetime extends DateTime
public function __construct($user, $time = 'now', DateTimeZone $timezone = null)
{
$this->user = $user;
- $timezone = $timezone ?: $this->user->tz;
+ $timezone = $timezone ?: $this->user->timezone;
parent::__construct($time, $timezone);
}
@@ -55,7 +55,7 @@ class phpbb_datetime extends DateTime
$format = $format ? $format : $this->user->date_format;
$format = self::format_cache($format, $this->user);
$relative = ($format['is_short'] && !$force_absolute);
- $now = new self($this->user, 'now', $this->user->tz);
+ $now = new self($this->user, 'now', $this->user->timezone);
$timestamp = $this->getTimestamp();
$now_ts = $now->getTimeStamp();
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 22e456c7de..b5d164f7a3 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4821,9 +4821,9 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
}
}
- $dt = new phpbb_datetime($user, 'now', $user->tz);
+ $dt = new phpbb_datetime($user, 'now', $user->timezone);
$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());
- $timezone_name = $user->tz->getName();
+ $timezone_name = $user->timezone->getName();
if (isset($user->lang['timezones'][$timezone_name]))
{
$timezone_name = $user->lang['timezones'][$timezone_name];
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 27f4b60189..9bc72cbaa6 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -679,7 +679,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
$ban_end = max($current_time, $user->create_datetime()
->setDate((int) $ban_other[0], (int) $ban_other[1], (int) $ban_other[2])
->setTime(0, 0, 0)
- ->getTimestamp() + $user->tz->getOffset(new DateTime('UTC')));
+ ->getTimestamp() + $user->timezone->getOffset(new DateTime('UTC')));
}
else
{
diff --git a/phpBB/includes/user.php b/phpBB/includes/user.php
index c3bdc71774..48c328214d 100644
--- a/phpBB/includes/user.php
+++ b/phpBB/includes/user.php
@@ -33,7 +33,7 @@ class phpbb_user extends phpbb_session
/**
* DateTimeZone object holding the timezone of the user
*/
- public $tz;
+ public $timezone;
var $lang_name = false;
var $lang_id = false;
@@ -127,7 +127,7 @@ class phpbb_user extends phpbb_session
*/
}
- $this->tz = new DateTimeZone($user_timezone);
+ $this->timezone = new DateTimeZone($user_timezone);
// We include common language file here to not load it every time a custom language file is included
$lang = &$this->lang;
@@ -623,7 +623,7 @@ class phpbb_user extends phpbb_session
}
$time = new phpbb_datetime($this, "@$gmepoch", $utc);
- $time->setTimezone($this->tz);
+ $time->setTimezone($this->timezone);
return $time->format($format, $forcedate);
}
@@ -638,7 +638,7 @@ class phpbb_user extends phpbb_session
*/
public function create_datetime($time = 'now', DateTimeZone $timezone = null)
{
- $timezone = $timezone ?: $this->tz;
+ $timezone = $timezone ?: $this->timezone;
return new phpbb_datetime($this, $time, $timezone);
}
@@ -652,7 +652,7 @@ class phpbb_user extends phpbb_session
*/
public function get_timestamp_from_format($format, $time, DateTimeZone $timezone = null)
{
- $timezone = $timezone ?: $this->tz;
+ $timezone = $timezone ?: $this->timezone;
$date = DateTime::createFromFormat($format, $time, $timezone);
return ($date !== false) ? $date->format('U') : false;
}