Skip to content
Snippets Groups Projects
Commit 3e0b8d50 authored by Frode Petterson's avatar Frode Petterson Committed by GitHub
Browse files

Merge pull request #84 from nadavkav/patch-4

Fix missing encode_content_links on backup_hvp_activity_task.class
parents 3cfa1456 e5a6f150
No related branches found
No related tags found
No related merge requests found
......@@ -45,4 +45,26 @@ class backup_hvp_activity_task extends backup_activity_task {
protected function define_my_steps() {
// $this->add_step(new backup_hvp_activity_structure_step('hvp_structure', 'hvp.xml'));
}
/**
* Encodes URLs to the index.php and view.php scripts
*
* @param string $content some HTML text that eventually contains URLs to the activity instance scripts
* @return string the content with the URLs encoded
*/
static public function encode_content_links($content) {
global $CFG;
$base = preg_quote($CFG->wwwroot,"/");
// Link to the list of glossaries
$search="/(".$base."\/mod\/hvp\/index.php\?id\=)([0-9]+)/";
$content= preg_replace($search, '$@HVPINDEX*$2@$', $content);
// Link to hvp view by moduleid
$search="/(".$base."\/mod\/hvp\/view.php\?id\=)([0-9]+)/";
$content= preg_replace($search, '$@HVPVIEWBYID*$2@$', $content);
return $content;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment