MDL-13638 Merged from stable
[moodle.git] / tag / user.php
similarity index 69%
rename from user/tag.php
rename to tag/user.php
index 2382477..ec8273d 100644 (file)
@@ -1,7 +1,7 @@
 <?php  // $Id$
 
 require_once('../config.php');
-require_once('../tag/lib.php');
+require_once('lib.php');
 
 $action = optional_param('action', '', PARAM_ALPHA);
 $id = optional_param('id', 0, PARAM_INT);
@@ -33,12 +33,26 @@ switch ($action) {
         redirect($CFG->wwwroot.'/tag/index.php?tag='. rawurlencode($tag));
         break;
 
+    case 'removeinterest':
+        if (empty($tag) && $id) { // for backward-compatibility (people saving bookmarks, mostly..)
+            $tag = tag_get_name($id);
+        } 
+        
+        tag_set_delete('user', $USER->id, $tag);
+
+        redirect($CFG->wwwroot.'/tag/index.php?tag='. rawurlencode($tag));
+        break;
+
     case 'flaginappropriate':
         
         tag_set_flag(tag_get_id($tag));
         
         redirect($CFG->wwwroot.'/tag/index.php?tag='. rawurlencode($tag), get_string('responsiblewillbenotified', 'tag'));
         break;
+
+    default:
+        error('No action was specified');
+        break;
 }
 
 ?>