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.

Differences Between: [Versions 311 and 402] [Versions 311 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.

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: array $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