MDL-45172 block_completionstatus: added a check for an empty string before appending

This commit is contained in:
Andrew Davis
2014-04-23 11:42:37 +08:00
parent 689f9aa1f5
commit e8ae121fd7
@@ -235,7 +235,6 @@ class block_completionstatus extends block_base {
// Display link to detailed view.
$details = new moodle_url('/blocks/completionstatus/details.php', array('course' => $course->id));
$this->content->footer = html_writer::empty_tag('br');
$this->content->footer = html_writer::link($details, get_string('moredetails', 'completion'));
} else {
// If user is not enrolled, show error.
@@ -244,6 +243,9 @@ class block_completionstatus extends block_base {
if (has_capability('report/completion:view', $context)) {
$report = new moodle_url('/report/completion/index.php', array('course' => $course->id));
if (empty($this->content->footer)) {
$this->content->footer = '';
}
$this->content->footer .= html_writer::empty_tag('br');
$this->content->footer .= html_writer::link($report, get_string('viewcoursereport', 'completion'));
}