mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
tags: part of MDL-19823 - make sure tag pages are in the right context, and set $PAGE->url
This commit is contained in:
parent
4aa31a61f0
commit
0edd65352f
3 changed files with 25 additions and 11 deletions
|
@ -19,9 +19,17 @@ if (empty($CFG->usetags)) {
|
|||
print_error('tagsaredisabled', 'tag');
|
||||
}
|
||||
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/tag:manage', $systemcontext);
|
||||
|
||||
$params = array();
|
||||
if ($perpage != DEFAULT_PAGE_SIZE) {
|
||||
$params['perpage'] = $perpage;
|
||||
}
|
||||
$PAGE->set_url('tag/manage.php', $params);
|
||||
$PAGE->set_context($systemcontext);
|
||||
$PAGE->set_blocks_editing_capability('moodle/tag:editblocks');
|
||||
|
||||
$navlinks = array();
|
||||
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
|
||||
$navlinks[] = array('name' => get_string('managetags', 'tag'), 'link' => '', 'type' => '');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue