mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-39815: wiki and glossary mods: update print icon and system print popup
This commit is contained in:
parent
ac9cd092d6
commit
be27bd59d9
@ -66,7 +66,6 @@ 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
|
||||
@ -170,10 +169,9 @@ $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'));
|
||||
$printlinkatt = array('onclick' => 'window.print();return false;', 'class' => 'glossary_no_print printicon');
|
||||
$printiconlink = html_writer::link('#', $printtext, $printlinkatt);
|
||||
echo html_writer::tag('div', $printiconlink, array('class' => 'displayprinticon'));
|
||||
|
||||
echo html_writer::tag('div', userdate(time()), array('class' => 'displaydate'));
|
||||
|
||||
@ -211,7 +209,7 @@ if ( $allentries ) {
|
||||
$user = $DB->get_record("user", array("id"=>$entry->userid));
|
||||
$pivottoshow = fullname($user);
|
||||
}
|
||||
echo html_writer::tag('div', '<span class="strong">' . clean_text($pivottoshow). '</span>', array('class' => 'mdl-align'));
|
||||
echo html_writer::tag('div', clean_text($pivottoshow), array('class' => 'mdl-align strong'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,10 @@
|
||||
#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,
|
||||
#page-mod-glossary-print .displayprinticon,
|
||||
.path-mod-glossary.dir-rtl .glossarypost {text-align: right;}
|
||||
|
||||
#page-mod-glossary-print .displaydate {text-align: right; font-size: 0.75em;}
|
||||
#page-mod-glossary-print .strong {font-weight: bold;}
|
||||
#page-mod-glossary-print .strong {font-weight: bold;}
|
||||
|
||||
.path-mod-glossary .printicon {background: url([[pix:t/print]]) no-repeat scroll 2px center transparent; padding-left: 20px; }
|
||||
|
@ -314,11 +314,7 @@ if ($showcommonelements) {
|
||||
/// The print icon
|
||||
if ( $showcommonelements and $mode != 'search') {
|
||||
if (has_capability('mod/glossary:manageentries', $context) or $glossary->allowprintview) {
|
||||
// print_box_start('printicon');
|
||||
echo '<span class="wrap printicon">';
|
||||
echo " <a title =\"". get_string("printerfriendly","glossary") ."\" href=\"print.php?id=$cm->id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\"><img class=\"icon\" src=\"".$OUTPUT->pix_url('print', 'glossary')."\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
|
||||
echo '</span>';
|
||||
// print_box_end();
|
||||
echo " <a class='printicon' title =\"". get_string("printerfriendly","glossary") ."\" href=\"print.php?id=$cm->id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\">" . get_string("printerfriendly","glossary")."</a>";
|
||||
}
|
||||
}
|
||||
/// End glossary controls
|
||||
|
@ -178,6 +178,7 @@ $string['peerreview'] = 'Peer review';
|
||||
$string['pluginadministration'] = 'Wiki administration';
|
||||
$string['pluginname'] = 'Wiki';
|
||||
$string['prettyprint'] = 'Printer-friendly version';
|
||||
$string['print'] = 'Print';
|
||||
$string['previewwarning'] = 'This is a preview. Changes have not been saved yet.';
|
||||
$string['rated']='You rated this page as a {$a}';
|
||||
$string['rating']='Rating';
|
||||
|
@ -2169,7 +2169,11 @@ class page_wiki_prettyview extends page_wiki {
|
||||
global $CFG, $PAGE, $OUTPUT;
|
||||
$PAGE->set_pagelayout('embedded');
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Print dialog link.
|
||||
$printtext = get_string('print', 'wiki');
|
||||
$printlinkatt = array('onclick' => 'window.print();return false;', 'class' => 'printicon');
|
||||
$printiconlink = html_writer::link('#', $printtext, $printlinkatt);
|
||||
echo html_writer::tag('div', $printiconlink, array('class' => 'displayprinticon'));
|
||||
echo '<h1 id="wiki_printable_title">' . format_string($this->title) . '</h1>';
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,6 @@ 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();
|
||||
|
@ -294,7 +294,7 @@ class mod_wiki_renderer extends plugin_renderer_base {
|
||||
$html = '';
|
||||
$link = new moodle_url('/mod/wiki/prettyview.php', array('pageid' => $page->id));
|
||||
$html .= $this->output->container_start('wiki_right');
|
||||
$html .= $this->output->action_link($link, get_string('prettyprint', 'wiki'), new popup_action('click', $link));
|
||||
$html .= $this->output->action_link($link, get_string('prettyprint', 'wiki'), new popup_action('click', $link), array('class' => 'printicon'));
|
||||
$html .= $this->output->container_end();
|
||||
return $html;
|
||||
}
|
||||
|
@ -363,3 +363,8 @@ a.wiki_edit_section {
|
||||
height: 22px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.path-mod-wiki .printicon {
|
||||
background: url([[pix:t/print]]) no-repeat scroll 2px center transparent; padding-left: 20px;
|
||||
}
|
||||
#page-mod-wiki-prettyview .displayprinticon {text-align: right;}
|
Loading…
x
Reference in New Issue
Block a user