diff --git a/mod/lesson/index.php b/mod/lesson/index.php
index e2c3a639688..22a3b5ab734 100644
--- a/mod/lesson/index.php
+++ b/mod/lesson/index.php
@@ -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 = "coursemodule\">".format_string($lesson->name,true)."";
- } else {
- //Show normal if the mod is visible
- $link = "coursemodule\">".format_string($lesson->name,true)."";
- }
$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 = "" . userdate($deadline) . "";
+ $due = html_writer::tag('span', userdate($deadline), array('class' => '.text-danger'));
}
if ($usesections) {
diff --git a/mod/lesson/report.php b/mod/lesson/report.php
index 36047749aaf..4f289718a4e 100644
--- a/mod/lesson/report.php
+++ b/mod/lesson/report.php
@@ -310,15 +310,15 @@ if ($action === 'delete') {
$table->attributes['class'] = 'generaltable';
unset($table->data);
if ($page->grayout) { // set the color of text
- $fontstart = "";
- $fontend = "";
+ $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);