Skip to content

Commit

Permalink
MDL-37801 mod_glossary - encode / decode links to 'showentry' pages d…
Browse files Browse the repository at this point in the history
…uring backup & restore
  • Loading branch information
davosmith committed Jan 31, 2013
1 parent b3778a0 commit 56c0465
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 56c0465

Please sign in to comment.