Skip to content
Browse files

MDL-31043 allow themes to set custommenu instead of using global sett…

…ings
  • Loading branch information...
1 parent 0e84b16 commit 0f6d934941b9ff21846ff8808b6d50be9df54eaf @danmarsden danmarsden committed Jan 6, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/outputrenderers.php
View
10 lib/outputrenderers.php
@@ -2433,14 +2433,18 @@ public function larrow() {
* 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);
}

0 comments on commit 0f6d934

Please sign in to comment.
Something went wrong with that request. Please try again.