Commit b33e6932 authored by lpc921's avatar lpc921

Update PDFEmbed.hooks.php

parent d6bdff06
......@@ -64,9 +64,10 @@ class PDFEmbed {
$width = (array_key_exists('width', $args) ? intval($args['width']) : intval($pdfEmbed['width']));
$height = (array_key_exists('height', $args) ? intval($args['height']) : intval($pdfEmbed['height']));
$page = (array_key_exists('page', $args) ? intval($args['page']) : 1);
if ($file !== false) {
return self::embed($file, $width, $height);
return self::embed($file, $width, $height, $page);
} else {
return self::error('embed_pdf_invalid_file');
}
......@@ -81,8 +82,8 @@ class PDFEmbed {
* @param integer Height of the object.
* @return string HTML object.
*/
static private function embed(File $file, $width, $height) {
return "<object width='{$width}' height='{$height}' data='".$file->getFullUrl()."' type='application/pdf'>".wfMessage('pdf_not_supported', $file->getFullUrl(), $file->getName())->plain()."</object>";
static private function embed(File $file, $width, $height, $page) {
return "<object width='{$width}' height='{$height}' data='".$file->getFullUrl()."' type='application/pdf'>".wfMessage('pdf_not_supported', $file->getFullUrl(), $file->getName())->plain()."<param name='page' value='$page' />"."</object>";
}
/**
......@@ -96,4 +97,4 @@ class PDFEmbed {
return Xml::span(wfMessage($messageKey)->plain(), 'error');
}
}
?>
\ No newline at end of file
?>
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