Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 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