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

Fix broken group member search

parent 7d120034
......@@ -51,14 +51,13 @@ $offset = param_integer('offset', 0);
$limit = param_integer('limit', 10);
list($html, $pagination, $count, $offset, $membershiptype) = group_get_membersearch_data($id, $query, $offset, $limit, $membershiptype);
$smarty = smarty(array('paginator', 'groupmembersearch'), array(), array(), array('sideblocks' => array(interaction_sideblock($id, $role))));
$smarty = smarty(array('groupmembersearch'), array(), array(), array('sideblocks' => array(interaction_sideblock($id, $role))));
$smarty->assign('group', $group);
$smarty->assign('groupid', $id);
$smarty->assign('grouptabs', group_get_menu_tabs($group));
$smarty->assign('query', $query);
$smarty->assign('results', $html);
$smarty->assign('pagination', $pagination['html']);
$smarty->assign('pagination_js', $pagination['javascript']);
$smarty->assign('membershiptype', $membershiptype);
$smarty->display('group/members.tpl');
......
......@@ -44,13 +44,12 @@ if (!empty($membershiptype)) {
}
list($html, $pagination, $count, $offset, $membershiptype) = group_get_membersearch_data($id, $query, $offset, $limit, $membershiptype);
log_debug($USER);
json_reply(false, array(
'message' => null,
'data' => array(
'tablerows' => $html,
'pagination' => $pagination['html'],
'pagination_js' => $pagination['javascript'],
'count' => $count,
'results' => $count . ' ' . ($count == 1 ? get_string('result') : get_string('results')),
'offset' => $offset,
......
......@@ -30,7 +30,7 @@ function UserSearch() {
}
this.rewritePaging = function() {
forEach(getElementsByTagAndClassName('span', 'pagination', 'membersearchresults'), function(i) {
forEach(getElementsByTagAndClassName('span', 'pagination', 'pagination'), function(i) {
connect(i, 'onclick', self.changePage);
});
}
......@@ -50,8 +50,9 @@ function UserSearch() {
this.doSearch = function() {
self.params.action = 'search';
sendjsonrequest('membersearchresults.php', self.params, 'POST', function(data) {
$('results').innerHTML = data.data;
if ($('searchresults')) {
getElementsByTagAndClassName('tbody', null,'results')[0].innerHTML = data.data.tablerows;
$('pagination').innerHTML = data.data.pagination;
if (data.data.count) {
self.rewritePaging();
}
});
......
......@@ -24,7 +24,7 @@
</tbody>
</table>
</div>
{$pagination}
<div id="pagination">{$pagination}</div>
<script type="text/javascript">{$pagination_js}</script>
......
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