Commit 865d3ba0 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Pass page param through to json script from paginator


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent ddff9107
......@@ -35,9 +35,17 @@ $query = param_variable('query', '');
$offset = param_integer('offset', 0);
$limit = param_integer('limit', 10);
$page = 'myfriends';
if ($extradata = param_variable('extradata', null)) {
$extradata = json_decode($extradata);
if ($extradata->page) {
$page = $extradata->page;
}
}
$data = search_user($query, $limit, $offset, array('exclude' => $USER->get('id')));
$data['query'] = $query;
build_userlist_html($data, 'find');
build_userlist_html($data, $page);
json_reply(false, array('data' => $data));
?>
......@@ -1139,6 +1139,7 @@ function build_userlist_html(&$data, $page) {
'offset' => $data['offset'],
'resultcounttextsingular' => get_string('user', 'group'),
'resultcounttextplural' => get_string('users', 'group'),
'extradata' => array('page' => $page),
));
$data['pagination'] = $pagination['html'];
$data['pagination_js'] = $pagination['javascript'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment