/** * Returns the display name of the given section that the course prefers. * * This function calls function callback_FORMATNAME_get_section_name() if it exists * * @param int|stdClass $section Section object from database or just field section.section * @return string Display name that the course format prefers, e.g. "Topic 2" */ public function get_section_name($section) { // Use course formatter callback if it exists $namingfunction = 'callback_' . $this->format . '_get_section_name'; if (function_exists($namingfunction) && ($course = $this->get_course())) { return $namingfunction($course, $this->get_section($section)); } // else, default behavior: return parent::get_section_name($section); }