MDL-15310: removing unused variable, old commented code and adding a small adjustment...
[moodle.git] / tag / search.php
CommitLineData
c933a060 1<?php
2
3require_once('../config.php');
4require_once('lib.php');
5require_once($CFG->dirroot.'/lib/weblib.php');
6
7global $CFG;
8require_login();
9
10if( empty($CFG->usetags)) {
11 error(get_string('tagsaredisabled', 'tag'));
12}
13
0f039283 14$query = optional_param('query', '', PARAM_RAW);
c933a060 15$page = optional_param('page', 0, PARAM_INT); // which page to show
16$perpage = optional_param('perpage', 18, PARAM_INT);
17
18$navlinks = array();
19$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
20$navigation = build_navigation($navlinks);
21
c933a060 22$systemcontext = get_context_instance(CONTEXT_SYSTEM);
3d535996 23$manage_link = '&nbsp;';
c933a060 24
03ce38cd 25print_header_simple(get_string('tags', 'tag'), '', $navigation);
26
5fc1ea54 27if ( has_capability('moodle/tag:manage',$systemcontext) ) {
28 echo '<div class="managelink"><a href='. $CFG->wwwroot .'/tag/manage.php>' . get_string('managetags', 'tag') . '</a></div>' ;
29}
03ce38cd 30
c933a060 31print_heading(get_string('searchtags', 'tag'), '', 2);
32
3d535996 33tag_print_search_box();
c933a060 34
35if(!empty($query)) {
3d535996 36 tag_print_search_results($query, $page, $perpage);
c933a060 37}
38
39echo '<br/><br/>';
40
41print_box_start('generalbox', 'big-tag-cloud-box');
cf79f661 42tag_print_cloud(150);
c933a060 43print_box_end();
44
45print_footer();
46
47?>