Skip to content

Commit cb0f8d9

Browse files
HDonathFriederike-cil
authored andcommitted
implement userinfo backup functionality
1 parent f7ea85a commit cb0f8d9

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

backup/moodle2/restore_pdfannotator_stepslib.php

+13-12
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,25 @@ protected function define_structure() {
4343

4444
$paths = array();
4545

46-
$userinfo = $this->get_setting_value('userinfo'); // Is 0 //TODO is not used.
46+
$userinfo = $this->get_setting_value('userinfo');
4747

4848
$paths[] = new restore_path_element('pdfannotator',
4949
'/activity/pdfannotator');
5050

51-
$paths[] = new restore_path_element('pdfannotator_annotation',
52-
'/activity/pdfannotator/annotations/annotation');
51+
if($userinfo) {
52+
$paths[] = new restore_path_element('pdfannotator_annotation',
53+
'/activity/pdfannotator/annotations/annotation');
5354

54-
$paths[] = new restore_path_element('pdfannotator_subscription',
55-
'/activity/pdfannotator/annotations/annotation/subscriptions/subscription');
56-
$paths[] = new restore_path_element('pdfannotator_comment',
57-
'/activity/pdfannotator/annotations/annotation/comments/comment');
58-
59-
$paths[] = new restore_path_element('pdfannotator_vote',
60-
'/activity/pdfannotator/annotations/annotation/comments/comment/votes/vote');
61-
$paths[] = new restore_path_element('pdfannotator_report',
62-
'/activity/pdfannotator/annotations/annotation/comments/comment/reports/report');
55+
$paths[] = new restore_path_element('pdfannotator_subscription',
56+
'/activity/pdfannotator/annotations/annotation/subscriptions/subscription');
57+
$paths[] = new restore_path_element('pdfannotator_comment',
58+
'/activity/pdfannotator/annotations/annotation/comments/comment');
6359

60+
$paths[] = new restore_path_element('pdfannotator_vote',
61+
'/activity/pdfannotator/annotations/annotation/comments/comment/votes/vote');
62+
$paths[] = new restore_path_element('pdfannotator_report',
63+
'/activity/pdfannotator/annotations/annotation/comments/comment/reports/report');
64+
}
6465
// Return the paths wrapped into standard activity structure.
6566
return $this->prepare_activity_structure($paths);
6667
}

version.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'mod_pdfannotator';
28-
$plugin->version = 2021082600;
29-
$plugin->release = 'PDF Annotator v1.4 release 8';
28+
$plugin->version = 2021113000;
29+
$plugin->release = 'PDF Annotator v1.4 release 11';
3030
$plugin->requires = 2016112900;
3131
$plugin->maturity = MATURITY_STABLE;

0 commit comments

Comments
 (0)