MDL-81766 courseformat: Fix hide addsection in delegated sections

Delegated sections should not render the add new section button at
the bottom of them.
This commit is contained in:
Mikel Martín
2024-07-22 13:34:45 +02:00
parent c51989d649
commit 2a01a188a1
@@ -45,7 +45,7 @@ class section extends section_base {
$data = parent::export_for_template($output);
if (!$this->format->get_sectionnum()) {
if (!$this->format->get_sectionnum() && !$this->section->is_delegated()) {
$addsectionclass = $format->get_output_classname('content\\addsection');
$addsection = new $addsectionclass($format);
$data->numsections = $addsection->export_for_template($output);