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 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Typical crappy helper class with tiny functions.

Copyright: 2017 David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 154 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

helper:: (5 methods):
  class_to_option()
  option_to_class()
  set_navbar()
  reset_page()
  prediction_context_selector()


Class: helper  - X-Ref

Helper class with general purpose tiny functions.

class_to_option($class)   X-Ref
Converts a class full name to a select option key

param: string $class
return: string

option_to_class($option)   X-Ref
option_to_class

param: string $option
return: string

set_navbar(string $title, \moodle_url $url, ?\context $context = null)   X-Ref
Sets an analytics > analytics models > $title breadcrumb.

param: string $title
param: \moodle_url $url
param: \context|null $context Defaults to context_system
return: null

reset_page()   X-Ref
Resets the current page.

Note that this function can only be used by analytics pages that work at the system context.

return: null

prediction_context_selector(array $contexts, \moodle_url $url, \renderer_base $output,?int $selected = null, ?bool $includeall = false, ?bool $shortentext = true)   X-Ref
Convert a list of contexts to an associative array where the value is the context name.

param: array            $contexts
param: \moodle_url      $url
param: \renderer_base   $output
param: int|null         $selected
param: bool             $includeall
param: bool             $shortentext
return: \stdClass