MDL-10829 Help page for the calculation field and interface
[moodle-pu.git] / tag / manage.php
bloba744f581a8612c1c1cb013d7556d56019665dc82
1 <?php // $Id$
3 require_once('../config.php');
4 require_once('lib.php');
5 require_once($CFG->dirroot.'/lib/weblib.php');
7 require_login();
9 if( empty($CFG->usetags)) {
10 error(get_string('tagsaredisabled', 'tag'));
13 //managing tags requires moodle/tag:manage capability
14 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
15 require_capability('moodle/tag:manage', $systemcontext);
17 $tagschecked = optional_param('tagschecked', array());
18 $action = optional_param('action', '', PARAM_ALPHA);
20 $navlinks = array();
21 $navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
22 $navlinks[] = array('name' => get_string('managetags', 'tag'), 'link' => '', 'type' => '');
24 $navigation = build_navigation($navlinks);
25 print_header_simple(get_string('managetags', 'tag'), '', $navigation);
27 switch($action) {
29 case 'delete':
31 $notice = tag_name_from_string(implode($tagschecked, ', '));
32 $notice = str_replace(',', ', ', $notice);
33 $notice .= ' -- ' . get_string('deleted','tag');
34 notify($notice , 'green');
36 tag_delete(implode($tagschecked, ','));
37 break;
38 case 'reset':
40 $notice = tag_name_from_string(implode($tagschecked, ', '));
41 $notice = str_replace(',', ', ', $notice);
42 $notice .= ' -- ' . get_string('reset','tag');
43 notify($notice , 'green');
45 tag_flag_reset(implode($tagschecked, ','));
46 break;
49 echo '<br/>';
51 print_tag_management_list();
54 echo '<br/>';
56 print_footer();