Navigation Menu

Skip to content

Commit

Permalink
MDL-31043 allow themes to set custommenu instead of using global sett…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
danmarsden committed Jan 5, 2012
1 parent 0e84b16 commit 0f6d934
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/outputrenderers.php
Expand Up @@ -2433,14 +2433,18 @@ public function larrow() {
* Settings: Administration > Appearance > Themes > Theme settings * Settings: Administration > Appearance > Themes > Theme settings
* and then configuring the custommenu config setting as described. * and then configuring the custommenu config setting as described.
* *
* @param string $custommenuitems - custom menuitems set by theme instead of global theme settings
* @return string * @return string
*/ */
public function custom_menu() { public function custom_menu($custommenuitems = '') {
global $CFG; global $CFG;
if (empty($CFG->custommenuitems)) { if (empty($custommenuitems) && !empty($CFG->custommenuitems)) {
$custommenuitems = $CFG->custommenuitems;
}
if (empty($custommenuitems)) {
return ''; return '';
} }
$custommenu = new custom_menu($CFG->custommenuitems, current_language()); $custommenu = new custom_menu($custommenuitems, current_language());
return $this->render_custom_menu($custommenu); return $this->render_custom_menu($custommenu);
} }


Expand Down

0 comments on commit 0f6d934

Please sign in to comment.