Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/tag/search.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00025 require_once('../config.php');
00026 require_once('lib.php');
00027 require_once('locallib.php');
00028 
00029 require_login();
00030 
00031 if (empty($CFG->usetags)) {
00032     print_error('tagsaredisabled', 'tag');
00033 }
00034 
00035 $query   = optional_param('query', '', PARAM_RAW);
00036 $page    = optional_param('page', 0, PARAM_INT); // which page to show
00037 $perpage = optional_param('perpage', 18, PARAM_INT);
00038 
00039 $params = array();
00040 if ($query !== '') {
00041     $params['query'] = $query;
00042 }
00043 if ($page !== 0) {
00044     $params['page'] = $page;
00045 }
00046 if ($perpage !== 18) {
00047     $params['perpage'] = $perpage;
00048 }
00049 $PAGE->set_url(new moodle_url('/tag/search.php', $params));
00050 $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
00051 $PAGE->set_pagelayout('standard');
00052 
00053 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
00054 $manage_link = '&nbsp;';
00055 
00056 $PAGE->set_title(get_string('tags', 'tag'));
00057 $PAGE->set_heading($SITE->fullname.': '.$PAGE->title);
00058 echo $OUTPUT->header();
00059 
00060 if ( has_capability('moodle/tag:manage',$systemcontext) ) {
00061     echo '<div class="managelink"><a href="'. $CFG->wwwroot .'/tag/manage.php">' . get_string('managetags', 'tag') . '</a></div>' ;
00062 }
00063 
00064 echo $OUTPUT->heading(get_string('searchtags', 'tag'), 2);
00065 
00066 tag_print_search_box();
00067 
00068 if(!empty($query)) {
00069      tag_print_search_results($query, $page, $perpage);
00070 }
00071 
00072 echo '<br/><br/>';
00073 
00074 echo $OUTPUT->box_start('generalbox', 'big-tag-cloud-box');
00075 tag_print_cloud(150);
00076 echo $OUTPUT->box_end();
00077 
00078 echo $OUTPUT->footer();
 All Data Structures Namespaces Files Functions Variables Enumerations