. /** * 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)); } }