From 0324045e4f8a5f05d550ec6b7c4f07fbe9340af7 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Tue, 27 Nov 2012 12:54:23 +0000 Subject: [PATCH] MDL-36808 Completion: Incorrect escaping for activity name in completion tickbox --- course/lib.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/course/lib.php b/course/lib.php index 72ddb30f0e6..1e81de9d079 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1656,14 +1656,25 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, } else { $extraclass = ''; } - echo " -
- - - - - -
"; + echo html_writer::start_tag('form', array( + 'class' => 'togglecompletion' . $extraclass, + 'method' => 'post', + 'action' => $CFG->wwwroot . '/course/togglecompletion.php')); + echo html_writer::start_tag('div'); + echo html_writer::empty_tag('input', array( + 'type' => 'hidden', 'name' => 'id', 'value' => $mod->id)); + echo html_writer::empty_tag('input', array( + 'type' => 'hidden', 'name' => 'modulename', + 'value' => $mod->name)); + echo html_writer::empty_tag('input', array( + 'type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())); + echo html_writer::empty_tag('input', array( + 'type' => 'hidden', 'name' => 'completionstate', + 'value' => $newstate)); + echo html_writer::empty_tag('input', array( + 'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle)); + echo html_writer::end_tag('div'); + echo html_writer::end_tag('form'); } else { // In auto mode, or when editing, the icon is just an image echo "";