Merge branch 'MDL-55032-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Dan Poltawski 2016-07-04 13:28:48 +01:00
commit 6e57e78652
3 changed files with 10 additions and 3 deletions

View File

@ -40,11 +40,11 @@ $url = new moodle_url('/admin/tool/lp/coursecompetencies.php', $urlparams);
list($title, $subtitle) = \tool_lp\page_helper::setup_for_course($url, $course);
$output = $PAGE->get_renderer('tool_lp');
$page = new \tool_lp\output\course_competencies_page($course->id);
echo $output->header();
echo $output->heading($title);
$page = new \tool_lp\output\course_competencies_page($course->id);
echo $output->render($page);
echo $output->footer();

View File

@ -36,6 +36,13 @@ function tool_lp_extend_navigation_course($navigation, $course, $coursecontext)
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));

View File

@ -88,7 +88,7 @@ class course_competency_settings extends persistent {
public static function can_read($courseid) {
$context = context_course::instance($courseid);
$capabilities = array('moodle/competency:coursecompetencyview');
$capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage');
return has_any_capability($capabilities, $context);
}