MDL-9628 When a timestamp is selected for locktime or hiddenuntil, the grader report...
[moodle-pu.git] / user / tag.php
bloba3bf0ce7dbb4e9ddf137c00093c346d7b4840c65
1 <?php // $Id$
3 require_once('../config.php');
4 require_once('../tag/lib.php');
6 $action = optional_param('action', '', PARAM_ALPHA);
8 require_login();
10 if (empty($CFG->usetags)) {
11 error('Tags are disabled!');
14 switch ($action) {
15 case 'addinterest':
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);
30 break;
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'));
39 break;