MDL-19315 Tidying up the publish page to remove the layout table
[moodle.git] / tag / search.php
CommitLineData
c933a060 1<?php
2
3require_once('../config.php');
4require_once('lib.php');
48d56528 5require_once('locallib.php');
c933a060 6
c933a060 7require_login();
8
e562ecdc 9if (empty($CFG->usetags)) {
48d56528 10 print_error('tagsaredisabled', 'tag');
c933a060 11}
12
48d56528 13$query = optional_param('query', '', PARAM_RAW);
14$page = optional_param('page', 0, PARAM_INT); // which page to show
15$perpage = optional_param('perpage', 18, PARAM_INT);
c933a060 16
d4a03c00 17$params = array();
18if ($query) {
19 $params['query'] = $query;
20}
21if ($page) {
22 $params['page'] = $page;
23}
24if ($perpage) {
25 $params['perpage'] = $perpage;
26}
a6855934 27$PAGE->set_url('/tag/search.php', $params);
cfc3f57e 28$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
d4a03c00 29
48d56528 30$systemcontext = get_context_instance(CONTEXT_SYSTEM);
3d535996 31$manage_link = '&nbsp;';
c933a060 32
a6855934 33$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url('/tag/search.php'));
968583af 34$PAGE->set_title(get_string('tags', 'tag'));
35echo $OUTPUT->header();
03ce38cd 36
5fc1ea54 37if ( has_capability('moodle/tag:manage',$systemcontext) ) {
565b14d2 38 echo '<div class="managelink"><a href="'. $CFG->wwwroot .'/tag/manage.php">' . get_string('managetags', 'tag') . '</a></div>' ;
5fc1ea54 39}
03ce38cd 40
73aec3a7 41echo $OUTPUT->heading(get_string('searchtags', 'tag'), 2);
c933a060 42
3d535996 43tag_print_search_box();
c933a060 44
45if(!empty($query)) {
3d535996 46 tag_print_search_results($query, $page, $perpage);
c933a060 47}
48
49echo '<br/><br/>';
50
456d32fd 51echo $OUTPUT->box_start('generalbox', 'big-tag-cloud-box');
cf79f661 52tag_print_cloud(150);
456d32fd 53echo $OUTPUT->box_end();
c933a060 54
1dd2ba54 55echo $OUTPUT->footer();