Commit 6ab16288 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1515484: Fix the institution index page so that pagination setlimit can work"

parents 30e340cd 25a7b701
......@@ -19,7 +19,7 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$query = param_variable('query', '');
$offset = param_integer('offset', 0);
$limit = 20;
$limit = param_integer('limit', 0);
// Get a list of institutions
require_once(get_config('libroot') . 'institution.php');
......
......@@ -26,8 +26,14 @@ $delete = param_boolean('delete');
$query = param_variable('query', '');
$offset = param_integer('offset', 0);
$limit = 20;
$limit = param_integer('limit', 0);
$userlimit = get_account_preference($USER->get('id'), 'viewsperpage');
if ($limit > 0 && $limit != $userlimit) {
$USER->set_account_preference('viewsperpage', $limit);
}
else {
$limit = $userlimit;
}
$customthemedefaults = array(
'background' => array('type' => 'color', 'value' => '#530E53'),
......
......@@ -972,6 +972,7 @@ function build_institutions_html($filter, $showdefault, $query, $limit, $offset,
'count' => $count,
'limit' => $limit,
'offset' => $offset,
'setlimit' => true,
'jumplinks' => 4,
'resultcounttextsingular' => get_string('institution', 'admin'),
'resultcounttextplural' => get_string('institutions', 'admin'),
......
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