MDL-23174 Private files editing page needs headings, navbar etc like a normal page
[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();
7c4efe3b 18if ($query !== '') {
d4a03c00 19 $params['query'] = $query;
20}
7c4efe3b 21if ($page !== 0) {
d4a03c00 22 $params['page'] = $page;
23}
7c4efe3b 24if ($perpage !== 18) {
d4a03c00 25 $params['perpage'] = $perpage;
26}
7c4efe3b 27$PAGE->set_url(new moodle_url('/tag/search.php', $params));
cfc3f57e 28$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
7c4efe3b 29$PAGE->set_pagelayout('standard');
d4a03c00 30
48d56528 31$systemcontext = get_context_instance(CONTEXT_SYSTEM);
3d535996 32$manage_link = '&nbsp;';
c933a060 33
968583af 34$PAGE->set_title(get_string('tags', 'tag'));
7c4efe3b 35$PAGE->set_heading($SITE->fullname.': '.$PAGE->title);
968583af 36echo $OUTPUT->header();
03ce38cd 37
5fc1ea54 38if ( has_capability('moodle/tag:manage',$systemcontext) ) {
565b14d2 39 echo '<div class="managelink"><a href="'. $CFG->wwwroot .'/tag/manage.php">' . get_string('managetags', 'tag') . '</a></div>' ;
5fc1ea54 40}
03ce38cd 41
73aec3a7 42echo $OUTPUT->heading(get_string('searchtags', 'tag'), 2);
c933a060 43
3d535996 44tag_print_search_box();
c933a060 45
46if(!empty($query)) {
3d535996 47 tag_print_search_results($query, $page, $perpage);
c933a060 48}
49
50echo '<br/><br/>';
51
456d32fd 52echo $OUTPUT->box_start('generalbox', 'big-tag-cloud-box');
cf79f661 53tag_print_cloud(150);
456d32fd 54echo $OUTPUT->box_end();
c933a060 55
1dd2ba54 56echo $OUTPUT->footer();