mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-41811 Navigation: set admin navigation required in badges
This commit is contained in:
parent
e56c107da8
commit
0d206054f8
@ -45,13 +45,14 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url('/badges/action.php', array('id' => $badge->id));
|
||||
navigation_node::override_active_url($navurl);
|
||||
|
||||
if ($return !== 0) {
|
||||
$returnurl = new moodle_url($return);
|
||||
|
@ -51,8 +51,10 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
require_capability('moodle/badges:awardbadge', $context);
|
||||
@ -63,7 +65,6 @@ $PAGE->set_context($context);
|
||||
|
||||
// Set up navigation and breadcrumbs.
|
||||
$strrecipients = get_string('recipients', 'badges');
|
||||
navigation_node::override_active_url($navurl);
|
||||
$PAGE->navbar->add($badge->name, new moodle_url('overview.php', array('id' => $badge->id)))->add($strrecipients);
|
||||
$PAGE->set_title($strrecipients);
|
||||
$PAGE->set_heading($badge->name);
|
||||
|
@ -49,8 +49,10 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$currenturl = new moodle_url('/badges/criteria.php', array('id' => $badge->id));
|
||||
@ -59,9 +61,6 @@ $PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
|
||||
// Set up navigation and breadcrumbs.
|
||||
navigation_node::override_active_url($navurl);
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
@ -49,15 +49,16 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url('/badges/criteria_action.php');
|
||||
$PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
navigation_node::override_active_url($navurl);
|
||||
|
||||
if ($delete && has_capability('moodle/badges:configurecriteria', $context)) {
|
||||
if (!$confirm) {
|
||||
|
@ -59,15 +59,16 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url('/badges/criteria_settings.php');
|
||||
$PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
navigation_node::override_active_url($navurl);
|
||||
$PAGE->navbar->add($badge->name, new moodle_url('overview.php', array('id' => $badge->id)))->add(get_string('criteria_' . $type, 'badges'));
|
||||
|
||||
$cparams = array('criteriatype' => $type, 'badgeid' => $badge->id);
|
||||
|
@ -54,8 +54,10 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$currenturl = new moodle_url('/badges/edit.php', array('id' => $badge->id, 'action' => $action));
|
||||
@ -64,9 +66,6 @@ $PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
|
||||
// Set up navigation and breadcrumbs.
|
||||
navigation_node::override_active_url($navurl);
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
@ -79,7 +79,7 @@ if ($type == BADGE_TYPE_SITE) {
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading($title . ': ' . $hdr);
|
||||
navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE)));
|
||||
navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE), true));
|
||||
} else {
|
||||
require_login($course);
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
|
@ -47,8 +47,10 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$currenturl = new moodle_url('/badges/overview.php', array('id' => $badge->id));
|
||||
@ -57,9 +59,6 @@ $PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
|
||||
// Set up navigation and breadcrumbs.
|
||||
navigation_node::override_active_url($navurl);
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
@ -61,8 +61,10 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
} else {
|
||||
$PAGE->set_pagelayout('admin');
|
||||
navigation_node::override_active_url($navurl, true);
|
||||
}
|
||||
|
||||
$PAGE->set_context($context);
|
||||
@ -70,7 +72,6 @@ $PAGE->set_url('/badges/recipients.php', array('id' => $badgeid, 'sort' => $sort
|
||||
$PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->navbar->add($badge->name);
|
||||
navigation_node::override_active_url($navurl);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user