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.

Differences Between: [Versions 400 and 401] [Versions 401 and 403]

(no description)

File Size: 218 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

activity_header:: (3 methods):
  __construct()
  is_title_allowed()
  set_attrs()

member:: (8 methods):
  set_hidecompletion()
  set_additionalnavitems()
  set_hideoverflow()
  set_title()
  set_description()
  disable()
  export_for_template()
  get_heading_level()


Class: activity_header  - X-Ref

Data structure representing standard components displayed on the activity header.

Consists of title, header, description. In addition, additional_items can be provided which is a url_select

__construct(moodle_page $page, \stdClass $user)   X-Ref
Constructor for activity_header

param: moodle_page $page
param: \stdClass $user

is_title_allowed()   X-Ref
Checks if the theme has specified titles to be displayed.

return: bool

set_attrs(array $config)   X-Ref
Bulk set class member variables. Only updates variables which have corresponding setters

param: mixed[] $config Array of variables to set, with keys being their name. Valid names/types as follows:

Class: member  - X-Ref

set_hidecompletion(bool $value)   X-Ref
Sets the hidecompletion class member variable

param: bool $value

set_additionalnavitems(url_select $value)   X-Ref
Sets the additionalnavitems class member variable

param: url_select $value

set_hideoverflow(bool $value)   X-Ref
Sets the hideoverflow class member variable

param: bool $value

set_title(string $value)   X-Ref
Sets the title class member variable.

param: string $value

set_description(string $value)   X-Ref
Sets the description class member variable

param: string $value

disable()   X-Ref
Disable the activity header completely. Use this if the page has some custom content, headings to be displayed.


export_for_template(renderer_base $output)   X-Ref
Export items to be rendered with a template.

param: renderer_base $output
return: array

get_heading_level(int $defaultlevel = 2)   X-Ref
Get the heading level for a given heading depending on whether the theme's activity header displays a heading
(usually the activity name).

param: int $defaultlevel The default heading level when the activity header does not display a heading.
return: int