Permalink
Browse files

MDL-38633 folder: support show_expanded in backup.

  • Loading branch information...
1 parent d8201d4 commit 35601d77f977c2a4f917532222ac533c58b26300 @stronk7 stronk7 committed Mar 21, 2013
@@ -39,7 +39,7 @@ protected function define_structure() {
// Define each element separated
$folder = new backup_nested_element('folder', array('id'), array(
'name', 'intro', 'introformat', 'revision',
- 'timemodified', 'display'));
+ 'timemodified', 'display', 'show_expanded'));
// Build the tree
// (nice mono-tree, lol)
@@ -48,6 +48,11 @@ protected function process_folder($data) {
$data->course = $this->get_courseid();
$data->timemodified = $this->apply_date_offset($data->timemodified);
+ // If show_expanded is not set, apply site default.
+ if (!isset($data->show_expanded)) {
+ $data->show_expanded = get_config('folder', 'show_expanded');
+ }
+
// insert the folder record
$newitemid = $DB->insert_record('folder', $data);
// immediately after inserting "activity" record, call this

0 comments on commit 35601d7

Please sign in to comment.