Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Base renderer for outputting course formats.

Copyright: 2012 Dan Poltawski
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1007 lines (44 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class


Class: format_section_renderer_base  - X-Ref

This is a convenience renderer which can be used by section based formats
to reduce code duplication. It is not necessary for all course formats to
use this and its likely to change in future releases.

__construct(moodle_page $page, $target)   X-Ref
Constructor method, calls the parent constructor

param: moodle_page $page
param: string $target one of rendering target constants

section_title($section, $course)   X-Ref
Generate the section title, wraps it in a link to the section page if page is to be displayed on a separate page

param: stdClass $section The course_section entry from DB
param: stdClass $course The course entry from DB
return: string HTML to output.

section_title_without_link($section, $course)   X-Ref
Generate the section title to be displayed on the section page, without a link

param: stdClass $section The course_section entry from DB
param: stdClass $course The course entry from DB
return: string HTML to output.

section_edit_control_menu($controls, $course, $section)   X-Ref
Generate the edit control action menu

param: array $controls The edit control items from section_edit_control_items
param: stdClass $course The course entry from DB
param: stdClass $section The course_section entry from DB
return: string HTML to output.

section_right_content($section, $course, $onsectionpage)   X-Ref
Generate the content to displayed on the right part of a section
before course modules are included

param: stdClass $section The course_section entry from DB
param: stdClass $course The course entry from DB
param: bool $onsectionpage true if being printed on a section page
return: string HTML to output.

section_left_content($section, $course, $onsectionpage)   X-Ref
Generate the content to displayed on the left part of a section
before course modules are included

param: stdClass $section The course_section entry from DB
param: stdClass $course The course entry from DB
param: bool $onsectionpage true if being printed on a section page
return: string HTML to output.

section_header($section, $course, $onsectionpage, $sectionreturn=null)   X-Ref
Generate the display of the header part of a section before
course modules are included

param: stdClass $section The course_section entry from DB
param: stdClass $course The course entry from DB
param: bool $onsectionpage true if being printed on a single-section page
param: int $sectionreturn The section to return to after an action
return: string HTML to output.

section_footer()   X-Ref
Generate the display of the footer part of a section

return: string HTML to output.

section_edit_controls()   X-Ref


section_edit_control_items($course, $section, $onsectionpage = false)   X-Ref
Generate the edit control items of a section

param: stdClass $course The course entry from DB
param: stdClass $section The course_section entry from DB
param: bool $onsectionpage true if being printed on a section page
return: array of edit control items

section_summary($section, $course, $mods)   X-Ref
Generate a summary of a section for display on the 'course index page'

param: stdClass $section The course_section entry from DB
param: stdClass $course The course entry from DB
param: array    $mods (argument not used)
return: string HTML to output.

section_activity_summary($section, $course, $mods)   X-Ref
Generate a summary of the activites in a section

param: stdClass $section The course_section entry from DB
param: stdClass $course the course record from DB
param: array    $mods (argument not used)
return: string HTML to output.

section_availability_message($section, $canviewhidden)   X-Ref
If section is not visible, display the message about that ('Not available
until...', that sort of thing). Otherwise, returns blank.

For users with the ability to view hidden sections, it shows the
information even though you can view the section and also may include
slightly fuller information (so that teachers can tell when sections
are going to be unavailable etc). This logic is the same as for
activities.

param: section_info $section The course_section entry from DB
param: bool $canviewhidden True if user can view hidden sections
return: string HTML to output

section_availability($section)   X-Ref
Displays availability information for the section (hidden, not available unles, etc.)

param: section_info $section
return: string

course_activity_clipboard($course, $sectionno = null)   X-Ref
Show if something is on on the course clipboard (moving around)

param: stdClass $course The course entry from DB
param: int $sectionno The section number in the course which is being displayed
return: string HTML to output.

get_nav_links($course, $sections, $sectionno)   X-Ref
Generate next/previous section links for naviation

param: stdClass $course The course entry from DB
param: array $sections The course_sections entries from the DB
param: int $sectionno The section number in the course which is being displayed
return: array associative array with previous and next section link

stealth_section_header($sectionno)   X-Ref
Generate the header html of a stealth section

param: int $sectionno The section number in the course which is being displayed
return: string HTML to output.

stealth_section_footer()   X-Ref
Generate footer html of a stealth section

return: string HTML to output.

section_hidden($sectionno, $courseorid = null)   X-Ref
Generate the html for a hidden section

param: int $sectionno The section number in the course which is being displayed
param: int|stdClass $courseorid The course to get the section name for (object or just course id)
return: string HTML to output.

section_nav_selection($course, $sections, $displaysection)   X-Ref
Generate the html for the 'Jump to' menu on a single section page.

param: stdClass $course The course entry from DB
param: array $sections The course_sections entries from the DB
param: $displaysection the current displayed section number.
return: string HTML to output.

print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection)   X-Ref
Output the html for a single section page .

param: stdClass $course The course entry from DB
param: array $sections (argument not used)
param: array $mods (argument not used)
param: array $modnames (argument not used)
param: array $modnamesused (argument not used)
param: int $displaysection The section number in the course which is being displayed

print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)   X-Ref
Output the html for a multiple section page

param: stdClass $course The course entry from DB
param: array $sections (argument not used)
param: array $mods (argument not used)
param: array $modnames (argument not used)
param: array $modnamesused (argument not used)

change_number_sections($course, $sectionreturn = null)   X-Ref
Returns controls in the bottom of the page to increase/decrease number of sections

param: stdClass $course
param: int|null $sectionreturn
return: string

format_summary_text($section)   X-Ref
Generate html for a section summary text

param: stdClass $section The course_section entry from DB
return: string HTML to output.