MDL-62974 lesson: Suppress HTML font tags

This commit is contained in:
Jean-Michel Vedrine 2018-08-09 18:31:36 +02:00
parent dafcc3cf7b
commit d1e24c1275
2 changed files with 10 additions and 14 deletions

View File

@ -88,23 +88,19 @@ if ($usesections) {
// Get all deadlines.
$deadlines = lesson_get_user_deadline($course->id);
foreach ($lessons as $lesson) {
if (!$lesson->visible) {
//Show dimmed if the mod is hidden
$link = "<a class=\"dimmed\" href=\"view.php?id=$lesson->coursemodule\">".format_string($lesson->name,true)."</a>";
} else {
//Show normal if the mod is visible
$link = "<a href=\"view.php?id=$lesson->coursemodule\">".format_string($lesson->name,true)."</a>";
}
$cm = get_coursemodule_from_instance('lesson', $lesson->id);
$context = context_module::instance($cm->id);
$class = $lesson->visible ? null : array('class' => 'dimmed'); // Hidden modules are dimmed.
$link = html_writer::link(new moodle_url('view.php', array('id' => $cm->id)), format_string($lesson->name, true), $class);
$deadline = $deadlines[$lesson->id]->userdeadline;
if ($deadline == 0) {
$due = $strnodeadline;
} else if ($deadline > $timenow) {
$due = userdate($deadline);
} else {
$due = "<font color=\"red\">" . userdate($deadline) . "</font>";
$due = html_writer::tag('span', userdate($deadline), array('class' => '.text-danger'));
}
if ($usesections) {

View File

@ -310,15 +310,15 @@ if ($action === 'delete') {
$table->attributes['class'] = 'generaltable';
unset($table->data);
if ($page->grayout) { // set the color of text
$fontstart = "<span class=\"dimmed\">";
$fontend = "</font>";
$fontstart = html_writer::start_tag('span', array('class' => 'dimmed_text'));
$fontend = html_writer::end_tag('span');
$fontstart2 = $fontstart;
$fontend2 = $fontend;
} else {
$fontstart = "";
$fontend = "";
$fontstart2 = "";
$fontend2 = "";
$fontstart = '';
$fontend = '';
$fontstart2 = '';
$fontend2 = '';
}
$table->head = array($fontstart2.$page->qtype.": ".format_string($page->title).$fontend2, $fontstart2.get_string("classstats", "lesson").$fontend2);