The import_handler_registry class.
More...
|
| populate_handlers () |
| Build up a list of extension handlers by leveraging the dndupload_register callbacks.
|
|
| register_file_handler (string $extension, string $module, string $message) |
| Adds a file extension handler to the list.
|
|
| register_type_handler (string $identifier, string $module, string $message) |
| Adds a type handler to the list.
|
|
|
context_course | $context |
| the course context object.
|
|
stdClass | $course |
| a course object.
|
|
array | $filehandlers = [] |
| array containing the names and messages of all modules handling import of resources as a 'file' type.
|
|
array | $registry = [] |
| $registry the aggregate of all registrations made by plugins, indexed by 'file' and 'type'.
|
|
array | $typehandlers = [] |
| $typehandlers the array of modules registering as handlers of other, non-file types, indexed by typename.
|
|
stdClass | $user |
| a user object.
|
|
The import_handler_registry class.
The import_handler_registry objects represent a register of modules handling various file extensions for a given course and user. Only modules which are available to the user in the course are included in the register for that user.
- Copyright
- 2020 Jake Dallimore jrhda.nosp@m.llim.nosp@m.ore@g.nosp@m.mail.nosp@m..com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
tool_moodlenet\local\import_handler_registry::__construct |
( |
\stdClass | $course, |
|
|
stdClass | $user ) |
The import_handler_registry constructor.
- Parameters
-
stdClass | $course | the course, which impacts available handlers. |
stdClass | $user | the user, which impacts available handlers. |
◆ get_resource_handler_for_mod_and_strategy()
tool_moodlenet\local\import_handler_registry::get_resource_handler_for_mod_and_strategy |
( |
remote_resource | $resource, |
|
|
string | $modname, |
|
|
import_strategy | $strategy ) |
Get a specific handler for the resource, belonging to a specific module and for a specific strategy.
- Parameters
-
remote_resource | $resource | the remote resource. |
string | $modname | the name of the module, e.g. 'label'. |
import_strategy | $strategy | a string representing how to treat the resource. e.g. 'file', 'link'. |
- Return values
-
import_handler_info|null | the import_handler_info object, if found, otherwise null. |
◆ get_resource_handlers_for_strategy()
tool_moodlenet\local\import_handler_registry::get_resource_handlers_for_strategy |
( |
remote_resource | $resource, |
|
|
import_strategy | $strategy ) |
Get all handlers for the remote resource, depending on the strategy being used to import the resource.
- Parameters
-
remote_resource | $resource | the remote resource. |
import_strategy | $strategy | an import_strategy instance. |
- Return values
-
import_handler_info[] | the array of import_handler_info handlers. |
◆ register_file_handler()
tool_moodlenet\local\import_handler_registry::register_file_handler |
( |
string | $extension, |
|
|
string | $module, |
|
|
string | $message ) |
|
protected |
Adds a file extension handler to the list.
- Parameters
-
string | $extension | the extension, e.g. 'png'. |
string | $module | the name of the module handling this extension |
string | $message | the message describing how the module handles the extension. |
◆ register_type_handler()
tool_moodlenet\local\import_handler_registry::register_type_handler |
( |
string | $identifier, |
|
|
string | $module, |
|
|
string | $message ) |
|
protected |
Adds a type handler to the list.
- Parameters
-
string | $identifier | the name of the type. |
string | $module | the name of the module, e.g. 'label'. |
string | $message | the message describing how the module handles the type. |
The documentation for this class was generated from the following file:
- admin/tool/moodlenet/classes/local/import_handler_registry.php