Minor changes and CHANGES.md note (#433)

This commit is contained in:
Mark Nelson 2021-08-03 16:28:39 +08:00
parent 25d398ce22
commit c6c4e6f6a7
2 changed files with 11 additions and 6 deletions

View file

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
Note - All hash comments refer to the issue number. Eg. #169 refers to https://github.com/mdjnelson/moodle-mod_customcert/issues/169. Note - All hash comments refer to the issue number. Eg. #169 refers to https://github.com/mdjnelson/moodle-mod_customcert/issues/169.
## [3.11.2] - 2021-??-??
### Fixed
- Fix places not using the multi-language filter (#433).
## [3.11.1] - 2021-06-13 ## [3.11.1] - 2021-06-13
### Fixed ### Fixed

View file

@ -47,21 +47,21 @@ class load_template_form extends \moodleform {
// Get the context. // Get the context.
$context = $this->_customdata['context']; $context = $this->_customdata['context'];
$syscontext = \context_system::instance();
$mform->addElement('header', 'loadtemplateheader', get_string('loadtemplate', 'customcert')); $mform->addElement('header', 'loadtemplateheader', get_string('loadtemplate', 'customcert'));
// Display a link to the manage templates page. // Display a link to the manage templates page.
if ($context->contextlevel != CONTEXT_SYSTEM && has_capability('mod/customcert:manage', \context_system::instance())) { if ($context->contextlevel != CONTEXT_SYSTEM && has_capability('mod/customcert:manage', $syscontext)) {
$link = \html_writer::link(new \moodle_url('/mod/customcert/manage_templates.php'), $link = \html_writer::link(new \moodle_url('/mod/customcert/manage_templates.php'),
get_string('managetemplates', 'customcert')); get_string('managetemplates', 'customcert'));
$mform->addElement('static', 'managetemplates', '', $link); $mform->addElement('static', 'managetemplates', '', $link);
} }
$templates = $DB->get_records_menu('customcert_templates', $arrtemplates = $DB->get_records_menu('customcert_templates', ['contextid' => $syscontext->id], 'name ASC', 'id, name');
array('contextid' => \context_system::instance()->id), 'name ASC', 'id, name'); if ($arrtemplates) {
if ($templates) { $templates = [];
$context = \context_system::instance()->id; foreach ($arrtemplates as $key => $template) {
foreach ($templates as $key => $template) {
$templates[$key] = format_string($template, true, ['context' => $context]); $templates[$key] = format_string($template, true, ['context' => $context]);
} }
$group = array(); $group = array();