MDL-39815 Add action to display the print windows on page load
This commit is contained in:
@@ -248,6 +248,7 @@ $string['page-mod-glossary-view'] = 'View glossary edit page';
|
||||
$string['pluginadministration'] = 'Glossary administration';
|
||||
$string['pluginname'] = 'Glossary';
|
||||
$string['popupformat'] = 'Popup format';
|
||||
$string['print'] = 'Print';
|
||||
$string['printerfriendly'] = 'Printer-friendly version';
|
||||
$string['printviewnotallowed'] = 'Print view isn\'t allowed';
|
||||
$string['question'] = 'Question';
|
||||
|
||||
@@ -66,6 +66,7 @@ echo $OUTPUT->header();
|
||||
if (!has_capability('mod/glossary:manageentries', $context) and !$glossary->allowprintview) {
|
||||
notice(get_string('printviewnotallowed', 'glossary'));
|
||||
}
|
||||
$PAGE->requires->js_init_code("window.print();");
|
||||
|
||||
/// setting the default values for the display mode of the current glossary
|
||||
/// only if the glossary is viewed by the first time
|
||||
@@ -166,6 +167,14 @@ $entriesshown = 0;
|
||||
$currentpivot = '';
|
||||
|
||||
$site = $DB->get_record("course", array("id"=>1));
|
||||
|
||||
// Print dialog link.
|
||||
$printtext = get_string('print', 'glossary');
|
||||
$printicon = $OUTPUT->pix_icon('print', $printtext, 'glossary', array('class' => 'glossary_print_icon'));
|
||||
$printlinkatt = array('onclick' => 'window.print();return false;', 'class' => 'glossary_no_print');
|
||||
$printiconlink = html_writer::link('#', $printicon, $printlinkatt);
|
||||
echo html_writer::tag('div', $printiconlink, array('class' => 'printicon'));
|
||||
|
||||
echo '<p style="text-align:right"><span style="font-size:0.75em">' . userdate(time()) . '</span></p>';
|
||||
echo get_string("site") . ': <strong>' . format_string($site->fullname) . '</strong><br />';
|
||||
echo get_string("course") . ': <strong>' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')</strong><br />';
|
||||
|
||||
@@ -33,4 +33,5 @@
|
||||
#page-mod-glossary-showentry #page-content {min-width:600px;}
|
||||
|
||||
#page-mod-glossary-print .mod-glossary-entrylist .mod-glossary-entry { vertical-align: top; }
|
||||
#page-mod-glossary-print .printicon,
|
||||
.path-mod-glossary.dir-rtl .glossarypost {text-align: right;}
|
||||
|
||||
@@ -59,6 +59,7 @@ require_capability('mod/wiki:viewpage', $context);
|
||||
$wikipage = new page_wiki_prettyview($wiki, $subwiki, $cm);
|
||||
|
||||
$wikipage->set_page($page);
|
||||
$PAGE->requires->js_init_code("window.print();");
|
||||
add_to_log($course->id, "wiki", "view", "prettyview.php?pageid=".$pageid, $pageid, $cm->id);
|
||||
|
||||
$wikipage->print_header();
|
||||
|
||||
Reference in New Issue
Block a user