Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Output the action menu for this activity.

Copyright: 2021 Adrian Greeve <adrian@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 153 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

main_action_menu:: (5 methods):
  __construct()
  get_next_chapter()
  get_previous_chapter()
  get_chapter()
  export_for_template()


Class: main_action_menu  - X-Ref

Output the action menu for the book activity.

__construct(int $cmid, array $chapters, stdClass $chapter)   X-Ref
Constructor for this class.

param: int      $cmid     The course module ID.
param: array    $chapters Chapters of this book.
param: stdClass $chapter  The current chapter.

get_next_chapter()   X-Ref
Get the next chapter in the book.

return: ?stdClass The next chapter of the book.

get_previous_chapter()   X-Ref
Get the previous chapter in the book.

return: ?stdClass The previous chapter of the book.

get_chapter(int $id)   X-Ref
Get the specific chapter of the book.

param: int $id The chapter id to retrieve.
return: ?stdClass The requested chapter.

export_for_template(\renderer_base $output)   X-Ref
Exports the navigation buttons around the book.

param: \renderer_base $output renderer base output.
return: array Data to render.