You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.1 KiB
60 lines
2.1 KiB
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
//
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
/**
|
|
* Renderer for use with the course section and all the goodness that falls
|
|
* within it.
|
|
*
|
|
* This renderer should contain methods useful to courses, and categories.
|
|
*
|
|
* @package theme_ilb2014
|
|
* @copyright 2014 ILB / Interlegis / Senado Federal
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2
|
|
*/
|
|
|
|
include_once("$CFG->dirroot/course/renderer.php");
|
|
|
|
/**
|
|
* The core course renderer
|
|
*
|
|
* Can be retrieved with the following:
|
|
* $renderer = $PAGE->get_renderer('core','course');
|
|
*/
|
|
|
|
class theme_ilb2014_core_course_renderer extends core_course_renderer {
|
|
|
|
/**
|
|
* Returns HTML to print tree of course categories (with number of courses) for the frontpage
|
|
*
|
|
* @return string
|
|
*/
|
|
public function frontpage_categories_list() {
|
|
global $CFG;
|
|
require_once($CFG->libdir. '/coursecatlib.php');
|
|
$chelper = new coursecat_helper();
|
|
$chelper->set_subcat_depth($CFG->maxcategorydepth)->
|
|
set_show_courses(self::COURSECAT_SHOW_COURSES_AUTO)->
|
|
set_categories_display_options(array(
|
|
'limit' => $CFG->coursesperpage,
|
|
'viewmoreurl' => new moodle_url('/course/index.php',
|
|
array('browse' => 'categories', 'page' => 1))
|
|
))->
|
|
set_attributes(array('class' => 'frontpage-category-names'));
|
|
return $this->coursecat_tree($chelper, coursecat::get(0));
|
|
}
|
|
|
|
}
|
|
|