Adding to moodle1 abstract structured step

This commit is contained in:
Mark Nielsen
2011-05-10 17:57:56 +02:00
committed by David Mudrak
parent d2c32ec8a1
commit 7125544864
+15
View File
@@ -74,6 +74,18 @@ abstract class moodle1_structure_step extends convert_structure_step {
return array();
}
/**
* Return new fields and their values
*
* The key is the new field name and the value
* is the value to write to the XML file.
*
* @return array
*/
public function get_new() {
return array();
}
/**
* Last chance to modify the datum before
* it is written to the XML file.
@@ -115,6 +127,9 @@ abstract class moodle1_structure_step extends convert_structure_step {
}
$this->xmlwriter->full_tag($name, $this->mutate_datum($name, $datum));
}
foreach ($this->get_new() as $name => $datum) {
$this->xmlwriter->full_tag($name, $datum);
}
}
}