Commit a5fb894c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fixes for myfriends pagination script (bug #772140)



Change-Id: I1681a260f5012597c86ff856ee9a0ef67dc5906e
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent c61e50c4
...@@ -32,13 +32,17 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php'); ...@@ -32,13 +32,17 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('blocktype', 'myfriends'); safe_require('blocktype', 'myfriends');
require_once('user.php'); require_once('user.php');
$userid = param_integer('user');
$offset = param_integer('offset'); $offset = param_integer('offset');
$limit = param_integer('limit', MAXFRIENDDISPLAY); $limit = param_integer('limit', MAXFRIENDDISPLAY);
$bi = new BlockInstance(param_integer('block')); $bi = new BlockInstance(param_integer('block'));
if (!can_view_view($bi->get('view'))) {
json_reply(true, get_string('accessdenied', 'error'));
}
$userid = $bi->get_view()->get('owner');
$friends = get_friends($userid, $limit, $offset); $friends = get_friends($userid, $limit, $offset);
PluginBlocktypeMyfriends::build_myfriends_html($friends, $userid, $bi); PluginBlocktypeMyfriends::build_myfriends_html($friends, $userid, $bi);
unset($friends['data']);
json_reply(false, array('data' => $friends)); json_reply(false, array('data' => $friends));
?> ?>
Supports Markdown
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