From ef4202d8590cdf3d88049329fe02864881369906 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sat, 9 Nov 2013 23:18:10 -0800 Subject: [ticket/11508] Build the jumpbox hidden fields using the _form action_ PHPBB3-11508 --- phpBB/includes/functions_content.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index b1f69c5756..387695a9e8 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -195,11 +195,13 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list } $db->sql_freeresult($result); unset($padding_store); + $url_parts = phpbb_get_url_parts($action); $template->assign_vars(array( - 'S_DISPLAY_JUMPBOX' => $display_jumpbox, - 'S_JUMPBOX_ACTION' => $action) - ); + 'S_DISPLAY_JUMPBOX' => $display_jumpbox, + 'S_JUMPBOX_ACTION' => $action, + 'HIDDEN_FIELDS_FOR_JUMPBOX' => build_hidden_fields($url_parts['params']), + )); return; } -- cgit v1.2.1 From 3163388f63a6d0bac77ada86e2f1561f1d7f9714 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 6 Dec 2013 13:38:54 -0800 Subject: [ticket/11508] Move helper functions to path_helper class. PHPBB3-11508 --- phpBB/includes/functions_content.php | 6 ++++-- 1 file changed, 4 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 387695a9e8..ff75a5b05d 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -110,7 +110,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, */ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false) { - global $config, $auth, $template, $user, $db; + global $config, $auth, $template, $user, $db, $phpbb_container; // We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality) if (!$config['load_jumpbox'] && $force_display === false) @@ -195,7 +195,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list } $db->sql_freeresult($result); unset($padding_store); - $url_parts = phpbb_get_url_parts($action); + + $path_helper = $phpbb_container->get('path_helper'); + $url_parts = $path_helper->get_url_parts($action); $template->assign_vars(array( 'S_DISPLAY_JUMPBOX' => $display_jumpbox, -- cgit v1.2.1 From c2ac76e8b11c0cfb5917febe90f56216d74bc10a Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 22 Apr 2014 12:40:28 -0700 Subject: [ticket/11508] Use $phpbb_path_helper. PHPBB3-11508 --- phpBB/includes/functions_content.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index ff75a5b05d..b8314c076c 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -110,7 +110,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, */ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false) { - global $config, $auth, $template, $user, $db, $phpbb_container; + global $config, $auth, $template, $user, $db, $phpbb_path_helper; // We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality) if (!$config['load_jumpbox'] && $force_display === false) @@ -196,8 +196,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list $db->sql_freeresult($result); unset($padding_store); - $path_helper = $phpbb_container->get('path_helper'); - $url_parts = $path_helper->get_url_parts($action); + $url_parts = $phpbb_path_helper->get_url_parts($action); $template->assign_vars(array( 'S_DISPLAY_JUMPBOX' => $display_jumpbox, -- cgit v1.2.1 From c2dace762ec295c7a2d67758006b1fff56f1f573 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 20 Apr 2014 15:13:13 +0200 Subject: [ticket/12273] Fix long $vars lines for existing events PHPBB3-12273 --- phpBB/includes/functions_content.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index b1f69c5756..bd711541c2 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1410,7 +1410,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', * @var array _profile_cache Array of original return templates * @since 3.1-A1 */ - $vars = array('mode', 'user_id', 'username', 'username_colour', 'guest_username', 'custom_profile_url', 'username_string', '_profile_cache'); + $vars = array('mode', 'user_id', 'username', 'username_colour', 'guest_username'); + $vars = array_merge($vars, array('custom_profile_url', 'username_string', '_profile_cache')); extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars))); return $username_string; -- cgit v1.2.1 From 87899b0e140400e23341ea1286d50e330132be90 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 25 Apr 2014 11:46:44 +0200 Subject: [ticket/12273] Update existing events PHPBB3-12273 --- phpBB/includes/functions_content.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index bd711541c2..89a0c2823e 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -527,7 +527,15 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb * @var bool allow_smilies Whether or not to parse Smilies * @since 3.1-A1 */ - $vars = array('text', 'uid', 'bitfield', 'flags', 'allow_bbcode', 'allow_urls', 'allow_smilies'); + $vars = array( + 'text', + 'uid', + 'bitfield', + 'flags', + 'allow_bbcode', + 'allow_urls', + 'allow_smilies', + ); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars))); $uid = $bitfield = ''; @@ -1410,8 +1418,16 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', * @var array _profile_cache Array of original return templates * @since 3.1-A1 */ - $vars = array('mode', 'user_id', 'username', 'username_colour', 'guest_username'); - $vars = array_merge($vars, array('custom_profile_url', 'username_string', '_profile_cache')); + $vars = array( + 'mode', + 'user_id', + 'username', + 'username_colour', + 'guest_username', + 'custom_profile_url', + 'username_string', + '_profile_cache', + ); extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars))); return $username_string; -- cgit v1.2.1 From b32895308d13d5d9b0cd954fd8ce871a1fa073da Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 25 Apr 2014 12:15:44 +0200 Subject: [ticket/12273] Update since version to 3.1.0-a* style PHPBB3-12273 --- phpBB/includes/functions_content.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 89a0c2823e..6ea1b378e8 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -445,7 +445,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text * @var string bitfield The BBCode Bitfield * @var int flags The BBCode Flags * @var bool censor_text Whether or not to apply word censors - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars))); @@ -487,7 +487,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text * @var string uid The BBCode UID * @var string bitfield The BBCode Bitfield * @var int flags The BBCode Flags - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('text', 'uid', 'bitfield', 'flags'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_after', compact($vars))); @@ -525,7 +525,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb * @var bool allow_bbcode Whether or not to parse BBCode * @var bool allow_urls Whether or not to parse URLs * @var bool allow_smilies Whether or not to parse Smilies - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array( 'text', @@ -573,7 +573,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb * @var string uid The BBCode UID * @var string bitfield The BBCode Bitfield * @var int flags The BBCode Flags - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('text', 'uid', 'bitfield', 'flags'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars))); @@ -596,7 +596,7 @@ function generate_text_for_edit($text, $uid, $flags) * @var string text The text to parse * @var string uid The BBCode UID * @var int flags The BBCode Flags - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('text', 'uid', 'flags'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_before', compact($vars))); @@ -609,7 +609,7 @@ function generate_text_for_edit($text, $uid, $flags) * @event core.modify_text_for_edit_after * @var string text The text to parse * @var int flags The BBCode Flags - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('text', 'flags'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_after', compact($vars))); @@ -1416,7 +1416,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', * profile url. * @var string username_string The string that has been generated * @var array _profile_cache Array of original return templates - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array( 'mode', -- cgit v1.2.1 From 89391dec089e8085f486b768ad7654f62166f4a2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Apr 2014 17:51:21 +0200 Subject: [ticket/12458] Apply Squiz.WhiteSpace.SuperfluousWhitespace.* to legacy code. * There MUST NOT be trailing whitespace at the end of lines. * There MUST NOT be whitespace before the first content of a file. * There MUST NOT be whitespace after the last content of a file. * Functions MUST NOT contain multiple empty lines in a row. PHPBB3-12458 --- phpBB/includes/functions_content.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index b1f69c5756..d9a9004368 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -451,7 +451,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars))); if ($censor_text) - { + { $text = censor_text($text); } @@ -499,7 +499,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text * For parsing custom parsed text to be stored within the database. * This function additionally returns the uid and bitfield that needs to be stored. * Expects $text to be the value directly from request_var() and in it's non-parsed form -* +* * @param string $text The text to be replaced with the parsed one * @param string $uid The BBCode uid for this parse * @param string $bitfield The BBCode bitfield for this parse @@ -1392,7 +1392,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', { $username_string = 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']); } - + /** * Use this event to change the output of get_username_string() * -- cgit v1.2.1