aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-07-17 16:09:05 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-07-17 16:09:05 +0200
commit3637cd395e39c1fa5b7279222abe1da5d2abcd00 (patch)
tree1e0d9f54950fb16f83dbcdde1001be5323778be1 /phpBB
parent48d3c68290b96c7d2a0e875ec3338f067a529b22 (diff)
downloadforums-3637cd395e39c1fa5b7279222abe1da5d2abcd00.tar
forums-3637cd395e39c1fa5b7279222abe1da5d2abcd00.tar.gz
forums-3637cd395e39c1fa5b7279222abe1da5d2abcd00.tar.bz2
forums-3637cd395e39c1fa5b7279222abe1da5d2abcd00.tar.xz
forums-3637cd395e39c1fa5b7279222abe1da5d2abcd00.zip
[feature/new-tz-handling] Properly name new timezone selection function
Marked the old one as deprecated and made it using the new function. PHPBB3-9558
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/acp_board.php12
-rw-r--r--phpBB/includes/acp/acp_users.php6
-rw-r--r--phpBB/includes/functions.php28
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php6
-rw-r--r--phpBB/includes/ucp/ucp_register.php6
5 files changed, 38 insertions, 20 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 59f7bf707f..159435c64c 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -57,7 +57,7 @@ class acp_board
'board_disable_msg' => false,
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
- 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),
+ 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -896,6 +896,16 @@ class acp_board
'<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
}
+ /**
+ * Select guest timezone
+ */
+ function timezone_select($value, $key)
+ {
+ $timezone_select = phpbb_timezone_select($value, true);
+ $timezone_select['tz_select'];
+
+ return '<select name="config[' . $key . ']" id="' . $key . '">' . $timezone_select['tz_select'] . '</select>';
+ }
/**
* Select default dateformat
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 949109abaf..a228e07c22 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1639,7 +1639,7 @@ class acp_users
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
}
- $tz_select = tz_select($data['tz'], true, false);
+ $timezone_selects = phpbb_timezone_select($data['tz'], true, false);
$template->assign_vars(array(
'S_PREFS' => true,
'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true,
@@ -1679,8 +1679,8 @@ class acp_users
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => style_select($data['style']),
- 'S_TZ_OPTIONS' => $tz_select['tz_select'],
- 'S_TZ_DATE_OPTIONS' => $tz_select['tz_dates'],
+ 'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
+ 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
)
);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4fc2739f33..3533a4ca00 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1143,13 +1143,26 @@ function phpbb_tz_select_compare($a, $b)
*
* @param string $default A timezone to select
* @param boolean $truncate Shall we truncate the options text
-* @param boolean $return_tzs_only Shall we just return the options for the timezone selector,
-* or also return the options for the time selector.
*
-* @return string/array Returns either the options for timezone selector
-* or an array, also containing the options for the time selector.
+* @return string Returns the options for timezone selector only
+*
+* @deprecated
+*/
+function tz_select($default = '', $truncate = false)
+{
+ $timezone_select = phpbb_timezone_select($default, $truncate);
+ return $timezone_select['tz_select'];
+}
+
+/**
+* Options to pick a timezone and date/time
+*
+* @param string $default A timezone to select
+* @param boolean $truncate Shall we truncate the options text
+*
+* @return array Returns an array, also containing the options for the time selector.
*/
-function tz_select($default = '', $truncate = false, $return_tzs_only = true)
+function phpbb_timezone_select($default = '', $truncate = false)
{
global $user;
@@ -1220,11 +1233,6 @@ function tz_select($default = '', $truncate = false, $return_tzs_only = true)
}
$tz_select .= '</optgroup>';
- if ($return_tzs_only)
- {
- return $tz_select;
- }
-
return array(
'tz_select' => $tz_select,
'tz_dates' => $tz_dates,
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 4239afc96e..f63758c52d 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -131,7 +131,7 @@ class ucp_prefs
}
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
- $tz_select = tz_select($data['tz'], true, false);
+ $timezone_selects = phpbb_timezone_select($data['tz'], true, false);
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
@@ -154,8 +154,8 @@ class ucp_prefs
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
- 'S_TZ_OPTIONS' => $tz_select['tz_select'],
- 'S_TZ_DATE_OPTIONS' => $tz_select['tz_dates'],
+ 'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
+ 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false,
'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
);
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 804bd2e0e2..705000d7a8 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -442,7 +442,7 @@ class ucp_register
break;
}
- $tz_select = tz_select($data['tz'], true, false);
+ $timezone_selects = phpbb_timezone_select($data['tz'], true, false);
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'USERNAME' => $data['username'],
@@ -455,8 +455,8 @@ class ucp_register
'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
'S_LANG_OPTIONS' => language_select($data['lang']),
- 'S_TZ_OPTIONS' => $tz_select['tz_select'],
- 'S_TZ_DATE_OPTIONS' => $tz_select['tz_dates'],
+ 'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
+ 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
'S_REGISTRATION' => true,
'S_COPPA' => $coppa,