I have created a new format and have the headers working, but a surprise.... the header is also displayed when the course Edit Settings page is open. I can't find anything on why this happens or how to prevent, both here and thru google search.
How does one determine when the setting page is being displayed?
I added the header by doing these things. Note that the format name is unit:
in renderer.php I added one function to class format_unit_renderer. This is the workhorse:
public function render_format_unit_toc($obj) { <-- snip irrelevant content that outputs html --> }
and in lib.php two things added:
to class format_unit: public function course_header() { return new format_unit_toc(); }
as a new class: class format_unit_toc implements renderable { <-- snip --> }