Handles the conversion of course sections and course modules.
More...
|
| get_converter () |
|
| get_paths () |
| This handler is interested in course sections and course modules within them.
|
|
| 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.
|
|
| on_course_modules_end () |
| Writes the information collected by mod handlers.
|
|
| on_course_section_end () |
| Writes sections/section_xxx/section.xml file and stashes it, too.
|
|
| on_course_sections_end () |
| Stashes the course contents.
|
|
| process_course_module ($data, $raw) |
| Populates the section sequence field (order of course modules) and stashes the course module info so that is can be dumped to activities/xxxx_x/module.xml later.
|
|
| process_course_section ($data) |
|
|
| close_xml_writer () |
| Close the XML writer.
|
|
| has_xml_writer () |
| Checks if the XML writer has been opened by self::open_xml_writer().
|
|
| make_sure_xml_exists ($filename, $rootelement=false, $content=array()) |
| Makes sure that a new XML file exists, or creates it itself.
|
|
| open_xml_writer ($filename) |
| Opens the XML writer - after calling, one is free to use $xmlwriter.
|
|
| write_xml ($element, array $data, array $attribs=array(), $parent='/') |
| Writes the given XML tree data into the currently opened file.
|
|
|
moodle1_converter | $converter |
|
array | $coursecontents = array() |
| ordered list of the course contents
|
|
array | $currentsection |
| current section data
|
|
null string | $xmlfilename |
| the name of file we are writing to
|
|
null xml_writer | $xmlwriter |
|
Handles the conversion of course sections and course modules.
◆ close_xml_writer()
moodle1_xml_handler::close_xml_writer |
( |
| ) |
|
|
protectedinherited |
Close the XML writer.
At the moment, the caller must close all tags before calling
- Return values
-
Reimplemented in moodle1_qtype_handler.
◆ get_converter()
moodle1_handler::get_converter |
( |
| ) |
|
|
inherited |
◆ has_xml_writer()
moodle1_xml_handler::has_xml_writer |
( |
| ) |
|
|
protectedinherited |
◆ log()
moodle1_handler::log |
( |
| $message, |
|
|
| $level, |
|
|
| $a = null, |
|
|
| $depth = null, |
|
|
| $display = false ) |
|
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.
◆ make_sure_xml_exists()
moodle1_xml_handler::make_sure_xml_exists |
( |
| $filename, |
|
|
| $rootelement = false, |
|
|
| $content = array() ) |
|
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.
- Parameters
-
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 |
- Return values
-
bool | true is the file existed, false if it did not |
◆ open_xml_writer()
moodle1_xml_handler::open_xml_writer |
( |
| $filename | ) |
|
|
protectedinherited |
Opens the XML writer - after calling, one is free to use $xmlwriter.
- Parameters
-
string | $filename | XML file name to write into |
- Return values
-
Reimplemented in moodle1_qtype_handler.
◆ write_xml()
moodle1_xml_handler::write_xml |
( |
| $element, |
|
|
array | $data, |
|
|
array | $attribs = array(), |
|
|
| $parent = '/' ) |
|
protectedinherited |
Writes the given XML tree data into the currently opened file.
- Parameters
-
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 |
The documentation for this class was generated from the following file:
- backup/converter/moodle1/handlerlib.php