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.

Utility class for browsing of content bank files.

Copyright: 2020 Mihail Geshoski <mihail@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 167 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

contentbank_browser:: (6 methods):
  get_content()
  get_navigation()
  get_child_contexts()
  get_parent()
  get_context_folders()
  get_contentbank_content()


Class: contentbank_browser  - X-Ref

Base class for the content bank browsers.

get_content()   X-Ref
Get all content nodes in the current context which can be viewed/accessed by the user.

return: array[] The array containing all nodes which can be viewed/accessed by the user in the current context

get_navigation()   X-Ref
Generate the full navigation to the current node.

return: array[] The array containing the path to each node in the navigation.

get_child_contexts()   X-Ref
Get the relevant child contexts.

return: \context[] The array containing the relevant, next-level children contexts

get_parent()   X-Ref
Get the content bank browser class of the parent context. Currently used to generate the navigation path.

return: contentbank_browser|null The content bank browser of the parent context

get_context_folders()   X-Ref
Generate folder nodes for the relevant child contexts which can be accessed/viewed by the user.

return: array[] The array containing the context folder nodes where each folder node is an array with keys:

get_contentbank_content()   X-Ref
Generate nodes for the content bank content in the current context which can be accessed/viewed by the user.

return: array[] The array containing the content nodes where each content node is an array with keys: