Disable Printing Not Hiding Print Icon

Disable Printing Not Hiding Print Icon

by Alan Cherwinski -
Number of replies: 2
When "Disable Printing" is selected in the Book Setting Students are still able to see the Print Icons. They get an error when attempting to print.

Build Moodle 1.9.7+ (Build: 20100210)

Book code from latest version as of Feb 10th.

Average of ratings: -
In reply to Alan Cherwinski

Re: Disable Printing Not Hiding Print Icon

by Fred Weiss -
I have noticed this as well. It is annoying as the students keep asking why they cannot print as they think there is an error rather than what the teacher wants.
In reply to Fred Weiss

Re: Disable Printing Not Hiding Print Icon

by Fred Weiss -
I have changed some code and now seems to be working. Have tested briefly and seems to be fine but probably some more thorough testing is required.


If printing is disabled the Print Icons are still being displayed modifying the following code fixes this issue.

File:

/moodle/mod/book/view.php

Replace !allowprint below;
/// prepare print icons
if (!$allowprint) {
$printbook = '';
$printchapter = '';

With

/// prepare print icons
if ($book->disableprinting) {
$printbook = '';
$printchapter = '';


One caveat on this it does remove print icons for all levels of privilege from student to admin.