From 4f59990d900b699cdd2cfe4b43e6972bf99d977b Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Fri, 9 Mar 2012 07:34:52 +0000 Subject: [ticket/10510] Added phpbb_add_quickmod_option and moved existing to it. PHPBB3-10510 --- phpBB/includes/functions_content.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 3a0124934e..b9ab2d8a7a 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1103,8 +1103,8 @@ function extension_allowed($forum_id, $extension, &$extensions) * @param string $string The text to truncate to the given length. String is specialchared. * @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char) * @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars). -* @param bool $allow_reply Allow Re: in front of string -* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated. +* @param bool $allow_reply Allow Re: in front of string +* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated. * @param string $append String to be appended */ function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '') @@ -1258,6 +1258,21 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']); } +/** + * Add an option to the quick-mod tools. + * + * @param string $option The value of the option. + * @param string $lang_string The language string to use. + */ +function phpbb_add_quickmod_option($option, $lang_string, $condition = true) +{ + global $template; + $template->assign_block_vars('quickmod', array( + 'VALUE' => $option, + 'TITLE' => $lang_string, + )); +} + /** * @package phpBB3 */ -- cgit v1.2.1 From 784c9725f3394ce866ab260485b32d501e07a628 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sun, 11 Mar 2012 19:20:13 +0000 Subject: [ticket/10510] Made a couple improvements to phpbb_add_quickmod_option. PHPBB3-10510 --- phpBB/includes/functions_content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index b9ab2d8a7a..872d071b91 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1264,7 +1264,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', * @param string $option The value of the option. * @param string $lang_string The language string to use. */ -function phpbb_add_quickmod_option($option, $lang_string, $condition = true) +function phpbb_add_quickmod_option($option, $lang_string) { global $template; $template->assign_block_vars('quickmod', array( -- cgit v1.2.1 From 79a987ffcb19832e1ddefe8be535b181f8acbd73 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Mon, 12 Mar 2012 07:43:01 +0000 Subject: [ticket/10510] Moved a $user->lang call into the function. PHPBB3-10510 --- phpBB/includes/functions_content.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 872d071b91..f2faf20f43 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1261,12 +1261,13 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', /** * Add an option to the quick-mod tools. * - * @param string $option The value of the option. + * @param string $option The language key for the value of the option. * @param string $lang_string The language string to use. */ function phpbb_add_quickmod_option($option, $lang_string) { - global $template; + global $template, $user; + $lang_string = $user->lang($lang_string); $template->assign_block_vars('quickmod', array( 'VALUE' => $option, 'TITLE' => $lang_string, -- cgit v1.2.1