First checkin of tag system from GSOC student Luiz Cruz
[moodle.git] / tag / tag_autocomplete.php
CommitLineData
c933a060 1<?php // $Id$
2
3require_once('lib.php');
4
5if( empty($CFG->usetags)) {
6 error(get_string('tagsaredisabled', 'tag'));
7}
8
9$query = optional_param('query', 0, PARAM_TEXT);
10$query = tag_normalize($query);
11
12$similar_tags = similar_tags($query);
13
14$count = 0;
15foreach ($similar_tags as $tag){
16 echo $tag->name . "\t" . $tag->id . "\n";
17}
18
19?>