Browse files

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

…uring backup & restore
  • Loading branch information...
1 parent 52c8653 commit 747e16f7b0f017452528dadf19c2101f28915777 @davosmith davosmith committed with stronk7 Jan 31, 2013
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 747e16f

Please sign in to comment.