Merge branch 'MDL-60174-master' of https://github.com/sammarshallou/moodle

This commit is contained in:
Damyon Wiese 2017-11-28 11:38:40 +08:00
commit bdb157653b
30 changed files with 653 additions and 44 deletions

View file

@ -3799,7 +3799,7 @@ function glossary_get_search_terms_sql(array $terms, $fullsearch = true, $glossa
* @param array $options Accepts:
* - (bool) includenotapproved. When false, includes the non-approved entries created by
* the current user. When true, also includes the ones that the user has the permission to approve.
* @return array The first element being the recordset, the second the number of entries.
* @return array The first element being the array of results, the second the number of entries.
* @since Moodle 3.1
*/
function glossary_get_entries_by_search($glossary, $context, $query, $fullsearch, $order, $sort, $from, $limit,

View file

@ -216,6 +216,10 @@ if ( $allentries ) {
glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook, 1, $displayformat, true);
}
// The all entries value may be a recordset or an array.
if ($allentries instanceof moodle_recordset) {
$allentries->close();
}
}
echo $OUTPUT->footer();

View file

@ -521,6 +521,10 @@ if ($allentries) {
glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat);
$entriesshown++;
}
// The all entries value may be a recordset or an array.
if ($allentries instanceof moodle_recordset) {
$allentries->close();
}
}
if ( !$entriesshown ) {
echo $OUTPUT->box(get_string("noentries","glossary"), "generalbox boxaligncenter boxwidthwide");