I am trying to have a course show a different custom menu than the whole site. I'm trying to do this by modifying a theme to display a theme custom menu instead of the site custom menu. This time I have started with the aardvark theme. First I opened up the settings.php file and added this;
$name = 'theme_aardvark/custommenuitems'; $title = get_string('custommenuitems', 'admin'); $description = get_string('configcustommenuitems', 'admin'); $default = ''; $setting = new admin_setting_configtextarea($name, $title, $description, $default); $settings->add($setting);
I then opened up the header.php file and changed this;
$custommenu = $OUTPUT->custom_menu();
for this;
$custommenu = $OUTPUT->custom_menu($PAGE->theme->settings->custommenuitems);
It nearly worked. There is now an area where I can enter a custom menu in the theme settings for aardvark. When I load a course with that theme however, it first shows the menu items defined in the theme settings, but then keeps right on going and shows the menu items defined for the whole site. I'm so close. Can anyone tell me what modification I need to do to have ONLY the custom menu items from the theme settings display? Thanks.
I am using Moodle 2.6.x