forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding in activity support and adding base forum classes as proof of …
…concept
- Loading branch information
Showing
7 changed files
with
241 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
mod/forum/backup/moodle1/convert_forum_activity_task.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
require_once($CFG->dirroot.'/mod/forum/backup/moodle1/convert_forum_stepslib.php'); | ||
|
||
/** | ||
* Convert from Moodle 1 forum task | ||
*/ | ||
class moodle1_forum_activity_task extends moodle1_activity_task { | ||
/** | ||
* Function responsible for building the steps of any task | ||
* (must set the $built property to true) | ||
*/ | ||
public function build() { | ||
$this->add_step(new moodle1_forum_activity_structure_step('forum')); | ||
$this->built = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* Convert forum | ||
*/ | ||
class moodle1_forum_activity_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 | ||
* | ||
* NOTE: /MOD/ACTIVITYNAME XML path does not actually exist. The moodle1_converter | ||
* class automatically transforms the /MOD path to include the activity name. | ||
*/ | ||
protected function define_structure() { | ||
return array( | ||
new convert_path_element('forum', '/MOODLE_BACKUP/COURSE/MODULES/MOD/FORUM'), | ||
// new convert_path_element('foo', '/MOODLE_BACKUP/COURSE/MODULES/MOD/FORUM/FOO'), // Example of sub-path | ||
); | ||
} | ||
|
||
public function convert_forum($data) { | ||
print_object($data); | ||
} | ||
|
||
public function convert_foo($data) { | ||
print_object($data); | ||
} | ||
} |