diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-19 21:05:33 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-19 21:05:33 -0500 |
commit | 3701d83ecbd358c2ac78b74e314ddb74ce7d1812 (patch) | |
tree | c9cb0aa52991595e98c3942c82e8ea22db8d8d89 /phpBB/includes | |
parent | e444f5bf2a8b30aefb3700ce358d2a6be66c8cb5 (diff) | |
parent | daf9de689a41dddae97152a21cc9bc894b48666f (diff) | |
download | forums-3701d83ecbd358c2ac78b74e314ddb74ce7d1812.tar forums-3701d83ecbd358c2ac78b74e314ddb74ce7d1812.tar.gz forums-3701d83ecbd358c2ac78b74e314ddb74ce7d1812.tar.bz2 forums-3701d83ecbd358c2ac78b74e314ddb74ce7d1812.tar.xz forums-3701d83ecbd358c2ac78b74e314ddb74ce7d1812.zip |
Merge PR #1133 branch 'marc1706/ticket/10954' into develop
# By Marc Alexander
# Via Marc Alexander
* marc1706/ticket/10954:
[ticket/10954] Add missing semi-colon
[ticket/10954] Make sure to mark subforums unread and add small fixes
[ticket/10954] Miscellaneous coding fixes
[ticket/10954] Use quotes in attribute selectors and reduce use of each
[ticket/10954] Change currentObject to $this for consistency
[ticket/10954] Use function for closing alert popup
[ticket/10954] Simplify marking forums read and fix topic marking
[ticket/10954] Join array of class names instead of creating a string
[ticket/10954] Fix coding guidelines infractions
[ticket/10954] Change behavior of marking topics/forums
[ticket/10954] Fix scope of current_object
[ticket/10954] Only call $(this) once and reduce number of DOM traversals
[ticket/10954] Modify is_ajax check for consistency
[ticket/10954] Mark topics read without popup
[ticket/10954] Mark forums read without popup or page refresh
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_display.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 73129803ee..cd4c901b58 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -61,6 +61,20 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { markread('all', false, false, request_var('mark_time', 0)); + if ($request->is_ajax()) + { + // Tell the ajax script what language vars and URL need to be replaced + $data = array( + 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'], + 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'], + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '', + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED'] + ); + $json_response = new phpbb_json_response(); + $json_response->send($data); + } + trigger_error( $user->lang['FORUMS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>') @@ -313,6 +327,20 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); meta_refresh(3, $redirect); + if ($request->is_ajax()) + { + // Tell the ajax script what language vars and URL need to be replaced + $data = array( + 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'], + 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'], + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '', + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED'] + ); + $json_response = new phpbb_json_response(); + $json_response->send($data); + } + trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message); } else |