mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-37085 Properly deprecated functions print_xxx() from course/lib.php
- get_print_section_cm_text() - print_section_add_menus() - print_section() - make_editing_buttons()
This commit is contained in:
parent
c58a25d6eb
commit
9a36be7361
10 changed files with 178 additions and 115 deletions
|
@ -38,6 +38,20 @@ defined('MOODLE_INTERNAL') || die();
|
|||
*/
|
||||
abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
|
||||
/** @var contains instance of core course renderer */
|
||||
protected $courserenderer;
|
||||
|
||||
/**
|
||||
* Constructor method, calls the parent constructor
|
||||
*
|
||||
* @param moodle_page $page
|
||||
* @param string $target one of rendering target constants
|
||||
*/
|
||||
public function __construct(moodle_page $page, $target) {
|
||||
parent::__construct($page, $target);
|
||||
$this->courserenderer = $this->page->get_renderer('core', 'course');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the starting container html for a list of sections
|
||||
* @return string HTML to output.
|
||||
|
@ -544,7 +558,6 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$course = course_get_format($course)->get_course();
|
||||
$courserenderer = $this->page->get_renderer('core', 'course');
|
||||
|
||||
// Can we view the section in question?
|
||||
if (!($sectioninfo = $modinfo->get_section_info($displaysection))) {
|
||||
|
@ -569,8 +582,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
|
||||
echo $this->start_section_list();
|
||||
echo $this->section_header($thissection, $course, true, $displaysection);
|
||||
print_section($course, $thissection, null, null, true, "100%", false, $displaysection);
|
||||
echo $courserenderer->course_section_add_cm_control($course, 0, $displaysection);
|
||||
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
|
||||
echo $this->courserenderer->course_section_add_cm_control($course, 0, $displaysection);
|
||||
echo $this->section_footer();
|
||||
echo $this->end_section_list();
|
||||
}
|
||||
|
@ -604,8 +617,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
$completioninfo = new completion_info($course);
|
||||
echo $completioninfo->display_help_icon();
|
||||
|
||||
print_section($course, $thissection, null, null, true, '100%', false, $displaysection);
|
||||
echo $courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
|
||||
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
|
||||
echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
|
||||
echo $this->section_footer();
|
||||
echo $this->end_section_list();
|
||||
|
||||
|
@ -639,7 +652,6 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
$course = course_get_format($course)->get_course();
|
||||
|
||||
$context = context_course::instance($course->id);
|
||||
$courserenderer = $this->page->get_renderer('core', 'course');
|
||||
// Title with completion help icon.
|
||||
$completioninfo = new completion_info($course);
|
||||
echo $completioninfo->display_help_icon();
|
||||
|
@ -656,8 +668,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
// 0-section is displayed a little different then the others
|
||||
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
|
||||
echo $this->section_header($thissection, $course, false, 0);
|
||||
print_section($course, $thissection, null, null, true, "100%", false, 0);
|
||||
echo $courserenderer->course_section_add_cm_control($course, 0);
|
||||
echo $this->courserenderer->course_section_cm_list($course, $thissection);
|
||||
echo $this->courserenderer->course_section_add_cm_control($course, 0);
|
||||
echo $this->section_footer();
|
||||
}
|
||||
continue;
|
||||
|
@ -686,8 +698,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
} else {
|
||||
echo $this->section_header($thissection, $course, false, 0);
|
||||
if ($thissection->uservisible) {
|
||||
print_section($course, $thissection, null, null, true, "100%", false, 0);
|
||||
echo $courserenderer->course_section_add_cm_control($course, $section);
|
||||
echo $this->courserenderer->course_section_cm_list($course, $thissection);
|
||||
echo $this->courserenderer->course_section_add_cm_control($course, $section);
|
||||
}
|
||||
echo $this->section_footer();
|
||||
}
|
||||
|
@ -701,7 +713,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
|||
continue;
|
||||
}
|
||||
echo $this->stealth_section_header($section);
|
||||
print_section($course, $thissection, null, null, true, "100%", false, 0);
|
||||
echo $this->courserenderer->course_section_cm_list($course, $thissection);
|
||||
echo $this->stealth_section_footer();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue