From b499db578cc836067ee28e3eb6753c2f39f2ad05 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 3 May 2010 07:11:17 +0000 Subject: [PATCH] navigation MDL-14632 Fixed a small bug with navigation node prepend --- lib/navigationlib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 721f5b09078..f04714cfa27 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2014,7 +2014,8 @@ class settings_navigation extends navigation_node { */ public function prepend($text, $url=null, $type=null, $shorttext=null, $key=null, pix_icon $icon=null) { $children = $this->children; - $this->children = new get_class($children); + $childrenclass = get_class($children); + $this->children = new $childrenclass; $node = $this->add($text, $url, $type, $shorttext, $key, $icon); foreach ($children as $child) { $this->children->add($child); @@ -2347,7 +2348,7 @@ class settings_navigation extends navigation_node { } if ($reportavailable) { $url = new moodle_url('/grade/report/index.php', array('id'=>$course->id)); - $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, null, new pix_icon('i/grades', '')); + $gradenode = $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, 'grades', new pix_icon('i/grades', '')); } // Add outcome if permitted