Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…uring backup & restore
  • Loading branch information...
commit 56c0465bd4fa8fe906f581bd401926f1e618ec1c 1 parent b3778a0
@davosmith davosmith authored
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;
Please sign in to comment.
Something went wrong with that request. Please try again.