forked from oohoo/moodle-format_tabtopics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrenderer.php
76 lines (66 loc) · 2.81 KB
/
renderer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* *************************************************************************
* * OOHOO Tab topics Course format **
* *************************************************************************
* @package format **
* @subpackage tabtopics **
* @name tabtopics **
* @copyright oohoo.biz **
* @link http://oohoo.biz **
* @author Nicolas Bretin **
* @author Braedan Jongerius **
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later **
* *************************************************************************
* ************************************************************************ */
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/course/format/renderer.php');
class format_tabtopics_renderer extends format_section_renderer_base {
/**
* Generate the starting container html for a list of sections
* @return string HTML to output.
*/
protected function start_section_list() {
return html_writer::start_tag('ul', array('class' => 'tabtopics'));
}
/**
* Generate the closing container html for a list of sections
* @return string HTML to output.
*/
protected function end_section_list() {
return html_writer::end_tag('ul');
}
/**
* Generate the title for this section page
* @return string the page title
*/
protected function page_title() {
return get_string('topicoutline');
}
/**
* Displays the avaliability message if not visible
*/
public function section_availability_message($section, $canViewHidden) {
echo parent::section_availability_message($section, $canViewHidden);
}
/**
* Display a hidden section message
*
* @param type $section
*/
public function section_hidden($sectionno, $courseorid = NULL) {
echo parent::section_hidden($sectionno, $courseorid);
}
/**
* Generate the edit control items of a section
*
* @param stdClass $course The course entry from DB
* @param stdClass $section The course_section entry from DB
* @param bool $onsectionpage true if being printed on a section page
* @return array of edit control items
*/
protected function section_edit_control_items($course, $section, $onsectionpage = false) {
$renderer = $this->page->get_renderer('format_topics');
return $renderer->section_edit_control_items($course, $section, $onsectionpage);
}
}