I have created a module and have used the <modulename>_extend_settings_navigation() function to add links to a few pages that will allow me to customize the module. The pseudocode follows:
function <module>_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $<module>subnode=null) {
global $PAGE;
if(!has_capability('mod/<module>:edit', context_course::instance($PAGE->course->id))) {
return;
}
$first_url = new moodle_url('/mod/<module>/first_page.php', array('id'=>$PAGE->cm->id));
$node = $<module>node->add('First Page', $first_url, navigation_node::TYPE_SETTING);
$second_url = new moodle_url('/mod/<module>/second_page.php', array('id'=>$PAGE->cm->id));
$node = $<module>node->add('Second Page', $second_url, navigation_node::TYPE_SETTING);
$third_url = new moodle_url('/mod/<module>/third_page.php', array('id'=>$PAGE->cm->id));
$node = $<module>node->add('Third Page', $third_url, navigation_node::TYPE_SETTING);
}
When I click on the first node, it displays the page correctly, and the entry in the navigation node gets highlighted correctly (text is bold), however, if I click on the second node, the page displays correctly, but it highlights the first node. Always. It will never highlight any node below the first node.
This isn't a terrible situation, however, it does look confusing to someone who is editing the module settings. Any idea how to get the correct node to highlight in the navigation menu?