Commit d8ec36bb authored by Nigel McNie's avatar Nigel McNie
Browse files

Copy out and rewrite URLs to theme images.

parent d205d91e
......@@ -515,6 +515,13 @@ class HtmlExportOutputFilter {
$html
);
// Images out of the theme directory
$html = preg_replace_callback(
'#(' . preg_quote(get_config('wwwroot')) . ')?/?theme/' . get_config('theme') . '/static/images/([a-z0-9_.-]+)#',
array($this, 'replace_theme_image_link'),
$html
);
return $html;
}
......@@ -624,6 +631,18 @@ class HtmlExportOutputFilter {
return '';
}
/**
* Callback
*/
private function replace_theme_image_link($matches) {
$file = '/theme/' . get_config('theme') . '/static/images/' . $matches[2];
$this->htmlexportcopyproxy->add(
get_config('docroot') . $file,
'/static/' . $file
);
return $this->basepath . '/static/' . $file;
}
/**
* Given a file, returns the folder path for it in the Mahara files area
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment