-
Improvement
-
Resolution: Fixed
-
Minor
-
2.3, 2.4
-
MOODLE_23_STABLE, MOODLE_24_STABLE
-
MOODLE_25_STABLE
-
MDL-33206-master -
From https://github.com/skodak/moodle-mod_book/issues/22
Users get confused when printing book/chapter – the window shows content to be printed, but there's no "print" button.
Yes, Ctrl+P helps, but a lot of users don't know that.
I suggest adding javascript print dialog opening in the end of HTML output of print page:
diff --git a/tool/print/index.php b/tool/print/index.php
|
index b1949dd..d616eca 100644
|
--- a/tool/print/index.php
|
+++ b/tool/print/index.php
|
@@ -111,6 +111,8 @@ if ($chapter) {
|
$chaptertext = file_rewrite_pluginfile_urls($chapter->content, 'pluginfile.php', $context->id, 'mod_book', 'chapter', $chapter->id);
|
echo format_text($chaptertext, $chapter->contentformat, array('noclean'=>true, 'context'=>$context));
|
echo '</div>';
|
+
|
+ echo '<script type="text/javascript">window.print();</script>';
|
echo '</body> </html>';
|
|
} else {
|
@@ -172,6 +174,8 @@ if ($chapter) {
|
echo '</div>';
|
//echo '<a href="#toc">'.$strtop.'</a>';
|
}
|
+
|
+ echo '<script type="text/javascript">window.print();</script>';
|
echo '</body> </html>';
|
}
|
- has been marked as being related by
-
MDL-32709 Feature request: move the Book module from contrib to the Moodle core
- Closed