Skip to content
Snippets Groups Projects
Commit e27807bc authored by Frode Petterson's avatar Frode Petterson
Browse files

Merge branch 'master' of github.com:h5p/h5p-moodle-plugin

parents 82888d4b 3e0b8d50
Branches
Tags
No related merge requests found
...@@ -45,4 +45,26 @@ class backup_hvp_activity_task extends backup_activity_task { ...@@ -45,4 +45,26 @@ class backup_hvp_activity_task extends backup_activity_task {
protected function define_my_steps() { protected function define_my_steps() {
// $this->add_step(new backup_hvp_activity_structure_step('hvp_structure', 'hvp.xml')); // $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