Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Base class for all modules that are successors of the 1.9 resource module. More...
Public Member Functions | |
get_component_name () | |
Returns the normalized name of the plugin, eg mod_workshop. More... | |
get_converter () | |
get_modname () | |
Returns the name of the module, eg. More... | |
get_paths () | |
Resource successors do not attach to paths themselves, they are called explicitely by moodle1_mod_resource_handler. More... | |
log ($message, $level, $a=null, $depth=null, $display=false) | |
This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed. More... | |
on_legacy_resource_end (array $data) | |
Called when the parses reaches the end </MOD> resource tag. More... | |
process_legacy_resource (array $data, array $raw=null) | |
Converts /MOODLE_BACKUP/COURSE/MODULES/MOD/RESOURCE data. More... | |
Protected Member Functions | |
close_xml_writer () | |
Close the XML writer. More... | |
get_cminfo ($instance, $modname=null) | |
Returns course module information for the given instance id. More... | |
has_xml_writer () | |
Checks if the XML writer has been opened by self::open_xml_writer(). More... | |
make_sure_xml_exists ($filename, $rootelement=false, $content=array()) | |
Makes sure that a new XML file exists, or creates it itself. More... | |
open_xml_writer ($filename) | |
Opens the XML writer - after calling, one is free to use $xmlwriter. More... | |
write_xml ($element, array $data, array $attribs=array(), $parent='/') | |
Writes the given XML tree data into the currently opened file. More... | |
Protected Attributes | |
moodle1_converter | $converter |
string | $pluginname |
string | $plugintype |
null string | $xmlfilename |
the name of file we are writing to | |
null xml_writer | $xmlwriter |
Base class for all modules that are successors of the 1.9 resource module.
|
protectedinherited |
Close the XML writer.
At the moment, the caller must close all tags before calling
void |
Reimplemented in moodle1_qtype_handler.
|
protectedinherited |
Returns course module information for the given instance id.
The information for this instance id has been stashed by moodle1_course_outline_handler::process_course_module()
int | $instance | the module instance id |
string | $modname | the module type, defaults to $this->pluginname |
int |
|
inherited |
Returns the normalized name of the plugin, eg mod_workshop.
string |
|
inherited |
moodle1_converter | the converter that required this handler |
|
inherited |
Returns the name of the module, eg.
'forum'
string |
|
final |
Resource successors do not attach to paths themselves, they are called explicitely by moodle1_mod_resource_handler.
array |
|
protectedinherited |
Checks if the XML writer has been opened by self::open_xml_writer().
bool |
|
inherited |
This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed.
Implements loggable.
|
protectedinherited |
Makes sure that a new XML file exists, or creates it itself.
This is here so we can check that all XML files that the restore process relies on have been created by an executed handler. If the file is not found, this method can create it using the given $rootelement as an empty root container in the file.
string | $filename | relative file name like 'course/course.xml' |
string | bool | $rootelement | root element to use, false to not create the file |
array | $content | content of the root element |
bool | true is the file existed, false if it did not |
moodle1_resource_successor_handler::on_legacy_resource_end | ( | array | $data | ) |
Called when the parses reaches the end </MOD> resource tag.
array | $data | the data returned by self::process_resource or just pre-cooked |
|
protectedinherited |
Opens the XML writer - after calling, one is free to use $xmlwriter.
string | $filename | XML file name to write into |
void |
Reimplemented in moodle1_qtype_handler.
moodle1_resource_successor_handler::process_legacy_resource | ( | array | $data, |
array | $raw = null |
||
) |
Converts /MOODLE_BACKUP/COURSE/MODULES/MOD/RESOURCE data.
Called by moodle1_mod_resource_handler::process_resource()
array | $data | pre-cooked legacy resource data |
array | $raw | raw legacy resource data |
Reimplemented in moodle1_mod_folder_handler, moodle1_mod_imscp_handler, moodle1_mod_page_handler, and moodle1_mod_url_handler.
|
protectedinherited |
Writes the given XML tree data into the currently opened file.
string | $element | the name of the root element of the tree |
array | $data | the associative array of data to write |
array | $attribs | list of additional fields written as attributes instead of nested elements |
string | $parent | used internally during the recursion, do not set yourself |