Permalink
Browse files

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

  • Loading branch information...
1 parent cda44a1 commit ee5a68022f56f41557586b3b1ac45ab399a7111b @brki brki committed Aug 13, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/wiki/pagelib.php
View
@@ -2202,8 +2202,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 ee5a680

Please sign in to comment.