custommenu MDL-22398 Fixed notice during install/upgrade with $CFG->custommenuitems
This commit is contained in:
@@ -2099,7 +2099,9 @@ class custom_menu extends custom_menu_item {
|
||||
public function __construct($text='base') {
|
||||
global $CFG;
|
||||
parent::__construct($text);
|
||||
$this->override_children(self::convert_text_to_menu_nodes($CFG->custommenuitems));
|
||||
if (!empty($CFG->custommenuitems)) {
|
||||
$this->override_children(self::convert_text_to_menu_nodes($CFG->custommenuitems));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2191,6 +2191,10 @@ END;
|
||||
* @return string
|
||||
*/
|
||||
public function custom_menu() {
|
||||
global $CFG;
|
||||
if (empty($CFG->custommenuitems)) {
|
||||
return '';
|
||||
}
|
||||
$custommenu = new custom_menu();
|
||||
return $this->render_custom_menu($custommenu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user