mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-73532 navigation: Modify methods that extend the setting nav
Introduces some changes to the exising _extend_settings_navigation() methods that utilize the global $PAGE object. In order to accomodate the changes done for the secondary navigation for single activity courses, the methods that extend the settings navigation can no longer rely on the $PAGE object, instead the more reliabe way to obtain this infomation is through the get_page() method from settings_navigation class.
This commit is contained in:
parent
bf27303955
commit
4a9c83ac9e
19 changed files with 132 additions and 145 deletions
|
@ -1628,17 +1628,13 @@ function workshop_extend_navigation(navigation_node $navref, stdclass $course, s
|
|||
* @param navigation_node $workshopnode {@link navigation_node}
|
||||
*/
|
||||
function workshop_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $workshopnode=null) {
|
||||
global $PAGE;
|
||||
|
||||
//$workshopobject = $DB->get_record("workshop", array("id" => $PAGE->cm->instance));
|
||||
|
||||
if (has_capability('mod/workshop:editdimensions', $PAGE->cm->context)) {
|
||||
$url = new moodle_url('/mod/workshop/editform.php', array('cmid' => $PAGE->cm->id));
|
||||
if (has_capability('mod/workshop:editdimensions', $settingsnav->get_page()->cm->context)) {
|
||||
$url = new moodle_url('/mod/workshop/editform.php', array('cmid' => $settingsnav->get_page()->cm->id));
|
||||
$workshopnode->add(get_string('assessmentform', 'workshop'), $url,
|
||||
settings_navigation::TYPE_SETTING, null, 'workshopassessement');
|
||||
}
|
||||
if (has_capability('mod/workshop:allocate', $PAGE->cm->context)) {
|
||||
$url = new moodle_url('/mod/workshop/allocation.php', array('cmid' => $PAGE->cm->id));
|
||||
if (has_capability('mod/workshop:allocate', $settingsnav->get_page()->cm->context)) {
|
||||
$url = new moodle_url('/mod/workshop/allocation.php', array('cmid' => $settingsnav->get_page()->cm->id));
|
||||
$workshopnode->add(get_string('submissionsallocation', 'workshop'), $url, settings_navigation::TYPE_SETTING);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue