Permalink
Browse files

MDL-38055 block_courseoverview: fixed formatting of course fullname

  • Loading branch information...
1 parent 4e83302 commit a9ff59979fbda8d26214013eb8da7440614d2bd5 Sam Hemelryk committed Mar 3, 2013
Showing with 8 additions and 5 deletions.
  1. +8 −5 blocks/course_overview/renderer.php
@@ -87,25 +87,28 @@ public function course_overview($courses, $overviews) {
if ($ismovingcourse && ($course->id == $movingcourseid)) {
continue;
}
+
+ $context = context_course::instance($course->id);
+ $fullname = format_string($course->fullname, true, array('context' => $context));
+
$html .= $this->output->box_start('coursebox', "course-{$course->id}");
$html .= html_writer::start_tag('div', array('class' => 'course_title'));
// If user is editing, then add move icons.
if ($userediting && !$ismovingcourse) {
$moveicon = html_writer::empty_tag('img',
array('src' => $this->pix_url('t/move')->out(false),
- 'alt' => get_string('movecourse', 'block_course_overview', $course->fullname),
+ 'alt' => get_string('movecourse', 'block_course_overview', $fullname),
'title' => get_string('move')));
$moveurl = new moodle_url($this->page->url, array('sesskey' => sesskey(), 'movecourse' => 1, 'courseid' => $course->id));
$moveurl = html_writer::link($moveurl, $moveicon);
$html .= html_writer::tag('div', $moveurl, array('class' => 'move'));
}
- $attributes = array('title' => s($course->fullname));
+ $attributes = array('title' => str_replace('&', '&', $fullname));
if ($course->id > 0) {
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
- $coursefullname = format_string($course->fullname, true, $course->id);
- $link = html_writer::link($courseurl, $coursefullname, $attributes);
+ $link = html_writer::link($courseurl, $fullname, $attributes);
$html .= $this->output->heading($link, 2, 'title');
} else {
$html .= $this->output->heading(html_writer::link(
@@ -135,7 +138,7 @@ public function course_overview($courses, $overviews) {
array('sesskey' => sesskey(), 'moveto' => $courseordernumber, 'courseid' => $movingcourseid));
$a = new stdClass();
$a->movingcoursename = $courses[$movingcourseid]->fullname;
- $a->currentcoursename = $course->fullname;
+ $a->currentcoursename = $fullname;
$movehereicon = html_writer::empty_tag('img',
array('src' => $this->output->pix_url('movehere'),
'alt' => get_string('moveafterhere', 'block_course_overview', $a),

0 comments on commit a9ff599

Please sign in to comment.