Skip to content
Browse files

MDL-37801 mod_glossary - encode / decode links to 'showentry' pages d…

…uring backup & restore
  • Loading branch information...
1 parent dc5957d commit 4b74b9d617f121d6861cd23598efc766fc1a7171 @davosmith davosmith committed with stronk7
View
4 mod/glossary/backup/moodle2/backup_glossary_activity_task.class.php
@@ -65,6 +65,10 @@ static public function encode_content_links($content) {
$search="/(".$base."\/mod\/glossary\/view.php\?id\=)([0-9]+)/";
$content= preg_replace($search, '$@GLOSSARYVIEWBYID*$2@$', $content);
+ // Link to glossary entry
+ $search="/(".$base."\/mod\/glossary\/showentry.php\?courseid=)([0-9]+)(&|&)eid=([0-9]+)/";
+ $content = preg_replace($search, '$@GLOSSARYSHOWENTRY*$2*$4@$', $content);
+
return $content;
}
}
View
2 mod/glossary/backup/moodle2/restore_glossary_activity_task.class.php
@@ -69,6 +69,8 @@ static public function define_decode_rules() {
$rules[] = new restore_decode_rule('GLOSSARYVIEWBYID', '/mod/glossary/view.php?id=$1', 'course_module');
$rules[] = new restore_decode_rule('GLOSSARYINDEX', '/mod/glossary/index.php?id=$1', 'course');
+ $rules[] = new restore_decode_rule('GLOSSARYSHOWENTRY', '/mod/glossary/showentry.php?courseid=$1&eid=$2',
+ array('course', 'glossary_entry'));
return $rules;

0 comments on commit 4b74b9d

Please sign in to comment.
Something went wrong with that request. Please try again.