Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-36808-m23' of git://github.com/sammarshallou/moodle…

… into MOODLE_23_STABLE
  • Loading branch information...
commit 1c570f909638b4e070df20d3adfca1d0f6719aa8 2 parents 1d2b58b + 8b6aeff
Dan Poltawski danpoltawski authored
Showing with 19 additions and 8 deletions.
  1. +19 −8 course/lib.php
27 course/lib.php
View
@@ -1710,14 +1710,25 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
} else {
$extraclass = '';
}
- echo "
-<form class='togglecompletion$extraclass' method='post' action='".$CFG->wwwroot."/course/togglecompletion.php'><div>
-<input type='hidden' name='id' value='{$mod->id}' />
-<input type='hidden' name='modulename' value='".s($mod->name)."' />
-<input type='hidden' name='sesskey' value='".sesskey()."' />
-<input type='hidden' name='completionstate' value='$newstate' />
-<input type='image' src='$imgsrc' alt='$imgalt' title='$imgtitle' />
-</div></form>";
+ 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 "<span class='autocompletion'>";
Please sign in to comment.
Something went wrong with that request. Please try again.