MDL-55074 navigation: Menu and nav changes

"Grades" belongs in the navigation block, not the settings block.
Course / Activity menus should not include a link to the full settings page list, if it is the same as the menu.
Competencies belongs in the navigation block not the settings block.
This commit is contained in:
Damyon Wiese 2016-10-14 11:58:14 +08:00
parent 70fda55e85
commit d430a7c336
4 changed files with 26 additions and 72 deletions

View file

@ -24,40 +24,6 @@
defined('MOODLE_INTERNAL') || die();
/**
* This function extends the course navigation
*
* @param navigation_node $navigation The navigation node to extend
* @param stdClass $course The course to object for the tool
* @param context $coursecontext The context of the course
*/
function tool_lp_extend_navigation_course($navigation, $course, $coursecontext) {
if (!get_config('core_competency', 'enabled')) {
return;
}
// Check access to the course and competencies page.
$capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage');
$context = context_course::instance($course->id);
if (!has_any_capability($capabilities, $context) || !can_access_course($course)) {
return;
}
// Just a link to course competency.
$title = get_string('competencies', 'core_competency');
$path = new moodle_url("/admin/tool/lp/coursecompetencies.php", array('courseid' => $course->id));
$settingsnode = navigation_node::create($title,
$path,
navigation_node::TYPE_SETTING,
null,
null,
new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
}
/**
* This function extends the user navigation.
*