MDL-29030 more css cleanup
[moodle.git] / report / outline / lib.php
CommitLineData
dfab77a2 1<?php
dfab77a2 2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * This file contains functions used by the outline report
19 *
275cbac7
PS
20 * @package report
21 * @subpackage outline
22 * @copyright 2009 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
dfab77a2 24 */
25
275cbac7
PS
26defined('MOODLE_INTERNAL') || die;
27
dfab77a2 28/**
275cbac7 29 * This function extends the course navigation with the report items
dfab77a2 30 *
31 * @param navigation_node $navigation The navigation node to extend
32 * @param stdClass $course The course to object for the report
33 * @param stdClass $context The context of the course
34 */
275cbac7 35function report_outline_extend_navigation_course($navigation, $course, $context) {
dfab77a2 36 global $CFG, $OUTPUT;
275cbac7
PS
37 if (has_capability('report/outline:view', $context)) {
38 $url = new moodle_url('/report/outline/index.php', array('id'=>$course->id));
39 $navigation->add(get_string('pluginname', 'report_outline'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
dfab77a2 40 }
b38e2e28
AD
41}
42
43/**
44 * Return a list of page types
45 * @param string $pagetype current page type
46 * @param stdClass $parentcontext Block's parent context
47 * @param stdClass $currentcontext Current context of block
275cbac7 48 * @return array
b38e2e28 49 */
275cbac7 50function report_outline_page_type_list($pagetype, $parentcontext, $currentcontext) {
b38e2e28
AD
51 $array = array(
52 '*' => get_string('page-x', 'pagetype'),
53 'course-report-*' => get_string('page-course-report-x', 'pagetype'),
275cbac7 54 'course-report-outline-index' => get_string('pluginpagetype', 'report_outline')
b38e2e28
AD
55 );
56 return $array;
dfab77a2 57}