From 0f6d934941b9ff21846ff8808b6d50be9df54eaf Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 6 Jan 2012 12:48:01 +1300 Subject: [PATCH] MDL-31043 allow themes to set custommenu instead of using global settings --- lib/outputrenderers.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 7288f57cfa8..847fdf150f5 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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); }