#134 Do not load templates in site templates

This commit is contained in:
Mark Nelson 2017-09-03 17:30:04 +08:00
parent 4232b1da86
commit 6afd9555c4

View file

@ -232,7 +232,7 @@ if ($data = $mform->get_data()) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('editcustomcert', 'customcert'));
$mform->display();
if ($tid) {
if ($tid && $context->contextlevel == CONTEXT_MODULE) {
$loadtemplateurl = new moodle_url('/mod/customcert/load_template.php', array('tid' => $tid));
$loadtemplateform = new \mod_customcert\load_template_form($loadtemplateurl, array('context' => $context), 'post',
'', array('id' => 'loadtemplateform'));