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

New role XML processing.

Copyright: 2013 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 315 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_role_preset:: (8 methods):
  send_export_xml()
  get_export_xml()
  is_valid_preset()
  parse_preset()
  get_node()
  get_node_value()
  get_node_children()
  get_node_children_values()


Class: core_role_preset  - X-Ref

XML role file manipulation class.

send_export_xml($roleid)   X-Ref
Send role export xml file to browser.

param: int $roleid
return: void does not return, send the file to output

get_export_xml($roleid)   X-Ref
Generate role export xml file.

param: $roleid
return: string

is_valid_preset($xml)   X-Ref
Is this XML valid role preset?

param: string $xml
return: bool

parse_preset($xml)   X-Ref
Parse role preset xml file.

param: string $xml
return: array role info, null on error

get_node(DOMDocument $dom, $path)   X-Ref
No description

get_node_value(DOMDocument $dom, $path)   X-Ref
No description

get_node_children(DOMDocument $dom, $path, $tagname)   X-Ref
No description

get_node_children_values(DOMDocument $dom, $path, $tagname)   X-Ref
No description