mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-55032-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
6e57e78652
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user