Merge branch 'wip-MDL-37644-m25' of git://github.com/samhemelryk/moodle
This commit is contained in:
@@ -2339,12 +2339,15 @@ class global_navigation extends navigation_node {
|
||||
|
||||
$issite = ($course->id == $SITE->id);
|
||||
$shortname = format_string($course->shortname, true, array('context' => $coursecontext));
|
||||
$fullname = format_string($course->fullname, true, array('context' => $coursecontext));
|
||||
// This is the name that will be shown for the course.
|
||||
$coursename = empty($CFG->navshowfullcoursenames) ? $shortname : $fullname;
|
||||
|
||||
if ($issite) {
|
||||
$parent = $this;
|
||||
$url = null;
|
||||
if (empty($CFG->usesitenameforsitepages)) {
|
||||
$shortname = get_string('sitepages');
|
||||
$coursename = get_string('sitepages');
|
||||
}
|
||||
} else if ($coursetype == self::COURSE_CURRENT) {
|
||||
$parent = $this->rootnodes['currentcourse'];
|
||||
@@ -2374,10 +2377,10 @@ class global_navigation extends navigation_node {
|
||||
}
|
||||
}
|
||||
|
||||
$coursenode = $parent->add($shortname, $url, self::TYPE_COURSE, $shortname, $course->id);
|
||||
$coursenode = $parent->add($coursename, $url, self::TYPE_COURSE, $shortname, $course->id);
|
||||
$coursenode->nodetype = self::NODETYPE_BRANCH;
|
||||
$coursenode->hidden = (!$course->visible);
|
||||
$coursenode->title(format_string($course->fullname, true, array('context' => context_course::instance($course->id))));
|
||||
$coursenode->title($fullname);
|
||||
if (!$forcegeneric) {
|
||||
$this->addedcourses[$course->id] = $coursenode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user