Merge branch 'wip-MDL-37085-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
+23
-17
@@ -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.
|
||||
@@ -587,10 +601,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);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, 0, null, false, false, $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();
|
||||
}
|
||||
@@ -624,10 +636,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);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, $displaysection, null, false, false, $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();
|
||||
|
||||
@@ -677,10 +687,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);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, 0, null, false, false, 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;
|
||||
@@ -710,10 +718,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);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, $section, null, false, false, 0);
|
||||
}
|
||||
echo $this->courserenderer->course_section_cm_list($course, $thissection);
|
||||
echo $this->courserenderer->course_section_add_cm_control($course, $section);
|
||||
}
|
||||
echo $this->section_footer();
|
||||
}
|
||||
@@ -727,7 +733,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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user