Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

Tag youtube block

Copyright: 1999 onwards Martin Dougiamas (http://dougiamas.com)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 428 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: block_tag_youtube  - X-Ref

init()   X-Ref


applicable_formats()   X-Ref
No description

has_config()   X-Ref
It can be configured.

return: bool

specialization()   X-Ref
No description

instance_allow_multiple()   X-Ref
No description

get_content()   X-Ref
No description

get_videos_by_playlist()   X-Ref
No description

get_videos_by_tag()   X-Ref
No description

get_videos_by_tag_and_category()   X-Ref
No description

fetch_request($request)   X-Ref
Sends a request to fetch data.

param: string $request

render_video_list(SimpleXMLElement $xml)   X-Ref
Renders the video list.

param: SimpleXMLElement $xml

get_error_message($message = null)   X-Ref
Returns an error message.

Useful when the block is not properly set or something goes wrong.

param: string $message The message to display.
return: string HTML

get_service()   X-Ref
Gets the youtube service object.

return: Google_Service_YouTube

render_items($videosdata)   X-Ref
Renders the list of items.

param: stdClass $videosdata
return: string HTML

get_categories()   X-Ref
Method that returns an array containing all relevant video categories obtained through an API call, where the
array index represents the category ID and the array value represents the category name.

return: array The array containing the relevant video categories

category_map_translation()   X-Ref
Method that provides mapping between the video category names and their translations.

return: array The array that maps the video category names with their translations

get_config_for_external()   X-Ref
Return the plugin config settings for external functions.

return: stdClass the configs for both the block instance and plugin