Commit dcc794ec authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1732810: Pass file's title to pdfjs download button



So saves as file name rather than 'document.pdf'
Also make en-GB the default english as 'en' is not an lang file for
the pdfjs

behatnotneeded

Change-Id: I320a141ce6c0a0734b9c0e21d6b933f5d99c238f
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent d29d2fdf
......@@ -70,6 +70,9 @@ class PluginBlocktypePdf extends MaharaCoreBlocktype {
}
}
}
else if ($language == 'en') {
$language = 'en-GB';
}
$result = '<iframe src="' . $urlbase . 'artefact/file/blocktype/pdf/viewer.php?editing=' . $editing . '&ingroup=' . !empty($group) . '&file=' . $artefactid . '&lang=' . $language . '&view=' . $instance->get('view')
. '" width="100%" height="500" frameborder="0"></iframe>';
......
......@@ -48,6 +48,6 @@ if (get_config('cleanurls') && get_config('cleanurlusersubdomains') && !$editing
}
$smarty = smarty();
$smarty->assign('url', $urlbase . 'artefact/file/download.php?file='.$fileid.'&view='.$viewid);
$smarty->assign('url', $urlbase . 'artefact/file/download.php?file='.$fileid.'&view='.$viewid.'&title='.urlencode($file->get('title')));
$smarty->assign('title', $file->get('title'));
$smarty->display('blocktype:pdf:pdf.tpl');
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