Permalink
Browse files

Cleanup from last commit, just wanted prototype code to be saved to VCS

  • Loading branch information...
1 parent 72c089f commit 7c9d2927b8874d5e6e396b08ce39243b35003d85 @mrmark mrmark committed with mudrd8mz Mar 21, 2011
@@ -374,28 +374,4 @@ public function execute_after_convert() {
$this->write_section_xml();
}
}
-}
-
-// @todo DELETE, NOT USED ANYMORE - OLD PROTOTYPE CODE
-class moodle1_mod_structure_step extends convert_structure_step {
- /**
- * Function that will return the structure to be processed by this convert_step.
- * Must return one array of @convert_path_element elements
- */
- protected function define_structure() {
- $paths = array();
- $paths[] = new convert_path_element('mod', '/MOODLE_BACKUP/COURSE/MODULES/MOD');
-
- return $paths;
- }
-
- public function convert_mod($data) {
- // What this will do...
- $task = convert_factory::activity_task($this->get_converter(), $data['MODTYPE'], $data);
- $this->get_converter()->get_plan()->add_task($task);
-
- // Build and execute now
- $task->build();
- $task->execute();
- }
}
@@ -45,15 +45,9 @@ public function build() {
// @todo finnish this class...
abstract class moodle1_activity_task extends convert_task {
- /**
- * @var array
- */
-// protected $instancedata;
-/*
- public function __construct($name, array $data, convert_plan $plan = null) {
- $this->instancedata = $data;
- print_object($data);
- parent::__construct($name, $plan);
- }
- */
+ // @todo Implement methods that will for example write out the activities/type_cmid/module.xml
}
+
+// @todo finnish this class...
+abstract class moodle1_block_task extends convert_task {
+}
@@ -43,39 +43,6 @@ public static function converters($tempdir) {
return $converters;
}
- // @todo DELETE part of prototype code
- public static function activity_task(base_converter $converter, $name, array $data) {
- global $CFG;
-
- static $classmap = array();
-
- $convertname = $converter->get_name();
-
- if (!array_key_exists($convertname, $classmap)) {
- $classmap[$convertname] = array();
- }
- if (!array_key_exists($name, $classmap[$convertname])) {
- // @TODO include the class file and make sure class exists
- $classfile = "$CFG->dirroot/mod/$name/backup/$convertname/convert_{$name}_activity_task.class.php";
- $classname = "{$convertname}_{$name}_activity_task";
-
- if (!class_exists($classname)) {
- if (!file_exists($classfile)) {
- throw new coding_exception("Conversion for $name for format $convertname not supported: class file not found $classfile");
- }
- require_once($classfile);
-
- if (!class_exists($classname)) {
- throw new coding_exception("Conversion for $name for format $convertname not supported: class not found $classname");
- }
- }
- $classmap[$convertname][$name] = $classname;
- }
- $classname = $classmap[$convertname][$name];
-
- return new $classname($name, $data);
- }
-
/**
* Runs through all plugins of a specific type and instantiates
* their task class.

0 comments on commit 7c9d292

Please sign in to comment.