See Release Notes
Long Term Support Release
Contains the import_handler_registry class.
Copyright: | 2020 Jake Dallimore <jrhdallimore@gmail.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 188 lines (8 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
import_handler_registry:: (6 methods):
__construct()
get_resource_handlers_for_strategy()
get_resource_handler_for_mod_and_strategy()
populate_handlers()
register_type_handler()
register_file_handler()
Class: import_handler_registry - X-Ref
The import_handler_registry class.__construct(\stdClass $course, \stdClass $user) X-Ref |
The import_handler_registry constructor. param: \stdClass $course the course, which impacts available handlers. param: \stdClass $user the user, which impacts available handlers. |
get_resource_handlers_for_strategy(remote_resource $resource, import_strategy $strategy) X-Ref |
Get all handlers for the remote resource, depending on the strategy being used to import the resource. param: remote_resource $resource the remote resource. param: import_strategy $strategy an import_strategy instance. return: import_handler_info[] the array of import_handler_info handlers. |
get_resource_handler_for_mod_and_strategy(remote_resource $resource, string $modname,import_strategy $strategy) X-Ref |
Get a specific handler for the resource, belonging to a specific module and for a specific strategy. param: remote_resource $resource the remote resource. param: string $modname the name of the module, e.g. 'label'. param: import_strategy $strategy a string representing how to treat the resource. e.g. 'file', 'link'. return: import_handler_info|null the import_handler_info object, if found, otherwise null. |
populate_handlers() X-Ref |
Build up a list of extension handlers by leveraging the dndupload_register callbacks. |
register_type_handler(string $identifier, string $module, string $message) X-Ref |
Adds a type handler to the list. param: string $identifier the name of the type. param: string $module the name of the module, e.g. 'label'. param: string $message the message describing how the module handles the type. |
register_file_handler(string $extension, string $module, string $message) X-Ref |
Adds a file extension handler to the list. param: string $extension the extension, e.g. 'png'. param: string $module the name of the module handling this extension param: string $message the message describing how the module handles the extension. |