Permalink
Browse files

MDL-32880 - Adding generic block conversion handlers.

  • Loading branch information...
mchurchward committed Nov 5, 2012
1 parent 5036ed8 commit b346f7e63c9f105dc27fc47707349b90e172ad52
Showing with 24 additions and 84 deletions.
  1. +24 −3 backup/converter/moodle1/handlerlib.php
  2. +0 −81 blocks/participants/backup/moodle1/lib.php
@@ -88,10 +88,16 @@ protected static function get_plugin_handlers($type, moodle1_converter $converte
foreach ($plugins as $name => $dir) {
$handlerfile = $dir . '/backup/moodle1/lib.php';
$handlerclass = "moodle1_{$type}_{$name}_handler";
if (!file_exists($handlerfile)) {
continue;
if ($type != "block") {
if (!file_exists($handlerfile)) {
continue;
}
require_once($handlerfile);
} else {
if (!file_exists($handlerfile)) {
$handlerclass = "moodle1_block_generic_handler";
}
}
require_once($handlerfile);
if (!class_exists($handlerclass)) {
throw new moodle1_convert_exception('missing_handler_class', $handlerclass);
@@ -1988,6 +1994,14 @@ public function on_legacy_resource_end(array $data) {
* Base class for block handlers
*/
abstract class moodle1_block_handler extends moodle1_plugin_handler {
public function get_paths() {
$blockname = strtoupper($this->pluginname);
return array(
new convert_path('block', "/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/{$blockname}"),
);
}
public function process_block(array $data) {
$newdata = array();
$instanceid = $data['id'];
@@ -2047,6 +2061,13 @@ public function process_block(array $data) {
}
/**
* Base class for block generic handler
*/
class moodle1_block_generic_handler extends moodle1_block_handler {
}
/**
* Base class for the activity modules' subplugins
*/

This file was deleted.

Oops, something went wrong.

0 comments on commit b346f7e

Please sign in to comment.