Search moodle.org's
Developer Documentation

See Release Notes

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

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

This plugin is used to access youtube videos

Copyright: 2010 Dongsheng Cai {@link http://dongsheng.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 345 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: repository_youtube  - X-Ref

repository_youtube class

__construct($repositoryid, $context = SYSCONTEXTID, $options = array()   X-Ref
Youtube plugin constructor

param: int $repositoryid
param: object $context
param: array $options

init_youtube_service()   X-Ref
Init all the youtube client service stuff.

Instead of instantiating the service in the constructor, we delay
it until really neeed because it's really memory hungry (2MB). That
way the editor or any other artifact requiring repository instantiation
can do it in a cheap way. Sort of lazy loading the plugin.

set_option($options = array()   X-Ref
Save apikey in config table.

param: array $options
return: boolean

get_option($config = '')   X-Ref
Get apikey from config table.

param: string $config
return: mixed

check_login()   X-Ref
No description

search($search_text, $page = 0)   X-Ref
Return search results

param: string $search_text
return: array

_get_collection($keyword, $start, $max, $sort)   X-Ref
Private method to get youtube search results

param: string $keyword
param: int $start
param: int $max max results
param: string $sort
return: array

global_search()   X-Ref
Youtube plugin doesn't support global search


get_listing($path='', $page = '')   X-Ref
No description

print_login($ajax = true)   X-Ref
Generate search form


supported_filetypes()   X-Ref
file types supported by youtube plugin

return: array

supported_returntypes()   X-Ref
Youtube plugin only return external links

return: int

contains_private_data()   X-Ref
Is this repository accessing private data?

return: bool

type_config_form($mform, $classname = 'repository')   X-Ref
Add plugin settings input to Moodle form.

param: object $mform
param: string $classname

get_type_option_names()   X-Ref
Names of the plugin settings

return: array