Merge branch 'master_MDL-31043' of git://github.com/danmarsden/moodle
authorSam Hemelryk <sam@moodle.com>
Sun, 8 Jan 2012 23:23:11 +0000 (12:23 +1300)
committerSam Hemelryk <sam@moodle.com>
Sun, 8 Jan 2012 23:23:11 +0000 (12:23 +1300)
lib/outputrenderers.php

index 7288f57..847fdf1 100644 (file)
@@ -2433,14 +2433,18 @@ EOD;
      *    Settings: Administration > Appearance > Themes > Theme settings
      * and then configuring the custommenu config setting as described.
      *
+     * @param string $custommenuitems - custom menuitems set by theme instead of global theme settings
      * @return string
      */
-    public function custom_menu() {
+    public function custom_menu($custommenuitems = '') {
         global $CFG;
-        if (empty($CFG->custommenuitems)) {
+        if (empty($custommenuitems) && !empty($CFG->custommenuitems)) {
+            $custommenuitems = $CFG->custommenuitems;
+        }
+        if (empty($custommenuitems)) {
             return '';
         }
-        $custommenu = new custom_menu($CFG->custommenuitems, current_language());
+        $custommenu = new custom_menu($custommenuitems, current_language());
         return $this->render_custom_menu($custommenu);
     }