3 require_once('../config.php');
4 require_once('../tag/lib.php');
6 $action = optional_param('action', '', PARAM_ALPHA
);
10 if (empty($CFG->usetags
)) {
11 error('Tags are disabled!');
16 $id = optional_param('id', 0, PARAM_INT
);
17 $name = optional_param('name', '', PARAM_TEXT
);
19 if (empty($name) && $id) {
20 $name = tag_name($id);
23 tag_an_item('user',$USER->id
, $name);
25 if (!empty($name) && !$id) {
26 $id = tag_id(tag_normalize($name));
29 redirect($CFG->wwwroot
.'/tag/index.php?id='.$id);
32 case 'flaginappropriate':
34 $id = required_param('id', PARAM_INT
);
36 tag_flag_inappropriate($id);
38 redirect($CFG->wwwroot
.'/tag/index.php?id='.$id, get_string('responsiblewillbenotified','tag'));