Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

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.

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

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

return: Google_Service_YouTube

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

return: string HTML
param: array $videosdata

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