Skip to content
Browse files

MDL-29004 Wiki: display images in printer-friendly view

  • Loading branch information...
1 parent ea3f5b5 commit 07b248886d94c1c6016534c5dd6737a36349be0f @brki brki committed Aug 13, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/wiki/pagelib.php
View
8 mod/wiki/pagelib.php
@@ -2206,8 +2206,14 @@ private function print_pretty_view() {
$content = wiki_parse_content($version->contentformat, $version->content, array('printable' => true, 'swid' => $this->subwiki->id, 'pageid' => $this->page->id, 'pretty_print' => true));
+ $html = $content['parsed_text'];
+ $id = $this->subwiki->wikiid;
+ if ($cm = get_coursemodule_from_instance("wiki", $id)) {
+ $context = context_module::instance($cm->id);
+ $html = file_rewrite_pluginfile_urls($html, 'pluginfile.php', $context->id, 'mod_wiki', 'attachments', $this->subwiki->id);
+ }
echo '<div id="wiki_printable_content">';
- echo format_text($content['parsed_text'], FORMAT_HTML);
+ echo format_text($html, FORMAT_HTML);
echo '</div>';
}
}

0 comments on commit 07b2488

Please sign in to comment.
Something went wrong with that request. Please try again.