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.

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: