MDL-10092:
[moodle-linuxchix.git] / tag / search.php
blob30a5608733e5bd17125f62e090de4c028b12b585
1 <?php
3 require_once('../config.php');
4 require_once('lib.php');
5 require_once($CFG->dirroot.'/lib/weblib.php');
7 global $CFG;
8 require_login();
10 if( empty($CFG->usetags)) {
11 error(get_string('tagsaredisabled', 'tag'));
14 $query = optional_param('query', '', PARAM_TEXT);
15 $page = optional_param('page', 0, PARAM_INT); // which page to show
16 $perpage = optional_param('perpage', 18, PARAM_INT);
18 $navlinks = array();
19 $navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
20 $navigation = build_navigation($navlinks);
22 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
23 if ( has_capability('moodle/tag:manage',$systemcontext) ) {
24 $manage_link = "<a href=\"{$CFG->wwwroot}/tag/manage.php\">" . get_string('managetags', 'tag') . "</a>" ;
27 print_header_simple(get_string('tags', 'tag'), '', $navigation, '', '', '', $manage_link);
29 print_heading(get_string('searchtags', 'tag'), '', 2);
31 print_tag_search_box();
33 if(!empty($query)) {
34 print_tag_search_results($query, $page, $perpage);
37 echo '<br/><br/>';
39 print_box_start('generalbox', 'big-tag-cloud-box');
40 print_tag_cloud(popular_tags_count(150), false, 170,70);
41 print_box_end();
43 print_footer();