Skip to content
Snippets Groups Projects
Commit e5a6f150 authored by Nadav Kavalerchik's avatar Nadav Kavalerchik Committed by GitHub
Browse files

Fix missing encode_content_links on backup_hvp_activity_task.class

Was unable to backup activity and was also breaking full course back,
if user was using hvp activity in course.

Patch, fixes above issue.
parent 69b71753
Branches
Tags
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