1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 08:17:47 +02:00

[ticket/10954] Change behavior of marking topics/forums

It will now display a popup message for 3 seconds which will confirm the
taken action. The amount of DOM traversals have been significantly reduced
and jQuery.each is now used instead of for loops. Additionally, it is now
possible to click on the mark topics/forums read links without triggering
an AJAX error.

PHPBB3-10954
This commit is contained in:
Marc Alexander
2012-12-14 15:46:45 +01:00
parent 5919407a1d
commit 16c021e986
3 changed files with 79 additions and 40 deletions

View File

@@ -63,10 +63,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($request->is_ajax())
{
// Tell the ajax script what language vars need to be replaced
// 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']
'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);
@@ -326,10 +329,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($request->is_ajax())
{
// Tell the ajax script what language vars need to be replaced
// 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']
'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);