mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00

It's a very simple first version. TODO for 1.9: - Store rawname of each tag as well as normalised version and treat accordingly - Add blocks to the tag interest pages
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
require_once('../config.php');
|
|
require_once('lib.php');
|
|
require_once($CFG->dirroot.'/lib/weblib.php');
|
|
|
|
global $CFG;
|
|
require_login();
|
|
|
|
if( empty($CFG->usetags)) {
|
|
error(get_string('tagsaredisabled', 'tag'));
|
|
}
|
|
|
|
$query = optional_param('query', '', PARAM_TEXT);
|
|
$page = optional_param('page', 0, PARAM_INT); // which page to show
|
|
$perpage = optional_param('perpage', 18, PARAM_INT);
|
|
|
|
$navlinks = array();
|
|
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
|
|
$navigation = build_navigation($navlinks);
|
|
|
|
|
|
print_header_simple(get_string('tags', 'tag'), '', $navigation);
|
|
|
|
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
|
if ( has_capability('moodle/tag:manage',$systemcontext) ) {
|
|
$manage_link = "<a href=\"{$CFG->wwwroot}/tag/manage.php\">" . get_string('managetags', 'tag') . "</a>" ;
|
|
print_box($manage_link, '', 'tags-management-links');
|
|
}
|
|
|
|
print_heading(get_string('searchtags', 'tag'), '', 2);
|
|
|
|
print_tag_search_box();
|
|
|
|
if(!empty($query)) {
|
|
print_tag_search_results($query, $page, $perpage);
|
|
}
|
|
|
|
echo '<br/><br/>';
|
|
|
|
print_box_start('generalbox', 'big-tag-cloud-box');
|
|
print_tag_cloud(rand_tags_count(60), true, 170,70);
|
|
print_box_end();
|
|
|
|
print_footer();
|
|
|
|
?>
|