1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 18:26:32 +02:00

[feature/pagination-as-list] Various fixes and improvements

Extracted common template code for prosilver as per subsilver2.
Various other fixups and oversight corrections, changed name
of the "new" template function and re-introduced existing
version. Altered on_page to compensate for removal of some
templating vars from pagination routine.

PHPBB3-10968
This commit is contained in:
Drae
2012-07-05 18:56:14 +01:00
parent 922147f05a
commit dc71c0629e
53 changed files with 303 additions and 569 deletions

View File

@@ -170,10 +170,11 @@ class ucp_attachments
}
$db->sql_freeresult($result);
generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start);
$base_url = $this->u_action . "&sk=$sort_key&sd=$sort_dir";
generate_template_pagination($base_url, 'pagination', $num_attachments, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($num_attachments, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($base_url, $num_attachments, $config['topics_per_page'], $start),
'TOTAL_ATTACHMENTS' => $num_attachments,
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],

View File

@@ -844,12 +844,13 @@ class ucp_groups
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start);
$base_url = $this->u_action . "&amp;action=$action&amp;g=$group_id";
generate_template_pagination($base_url, 'pagination', $total_members, $config['topics_per_page'], $start);
$template->assign_vars(array(
'S_LIST' => true,
'S_ACTION_OPTIONS' => $s_action_options,
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
'S_ON_PAGE' => on_page($base_url, $total_members, $config['topics_per_page'], $start),
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'S_UCP_ACTION' => $this->u_action . "&amp;g=$group_id",

View File

@@ -670,10 +670,10 @@ class ucp_main
if ($topics_count)
{
generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start);
generate_template_pagination($this->u_action, 'pagination', $topics_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($this->u_action, $topics_count, $config['topics_per_page'], $start),
'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
));
}
@@ -838,7 +838,7 @@ class ucp_main
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
));
generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&amp;t=$topic_id"), $replies + 1, $config['posts_per_page'], 1, '', true, true, 'topicrow');
generate_template_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&amp;t=$topic_id"), 'topicrow.pagination', $replies + 1, $config['posts_per_page'], 1, true, true);
}
}
}

View File

@@ -451,10 +451,11 @@ function get_pm_from($folder_id, $folder, $user_id)
$sql_limit_time = '';
}
generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start);
$base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param");
generate_template_pagination($base_url, 'pagination', $pm_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($base_url, $pm_count, $config['topics_per_page'], $start),
'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),
'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),