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 authored and stronk7 committed Feb 5, 2013
1 parent dc5957d commit 4b74b9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Original file line 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]+)/"; $search="/(".$base."\/mod\/glossary\/view.php\?id\=)([0-9]+)/";
$content= preg_replace($search, '$@GLOSSARYVIEWBYID*$2@$', $content); $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; return $content;
} }
} }
Original file line number Original file line 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('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('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; return $rules;


Expand Down

0 comments on commit 4b74b9d

Please sign in to comment.