diff --git a/mod/glossary/lang/en/glossary.php b/mod/glossary/lang/en/glossary.php index b7e4dba25ec..80676451403 100644 --- a/mod/glossary/lang/en/glossary.php +++ b/mod/glossary/lang/en/glossary.php @@ -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'; diff --git a/mod/glossary/print.php b/mod/glossary/print.php index 27a6f305f00..52f0ea3125c 100644 --- a/mod/glossary/print.php +++ b/mod/glossary/print.php @@ -166,10 +166,24 @@ $entriesshown = 0; $currentpivot = ''; $site = $DB->get_record("course", array("id"=>1)); -echo '

' . userdate(time()) . '

'; -echo get_string("site") . ': ' . format_string($site->fullname) . '
'; -echo get_string("course") . ': ' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')
'; -echo get_string("modulename","glossary") . ': ' . format_string($glossary->name, true) . ''; + +// Print dialog link. +$printtext = get_string('print', 'glossary'); +$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')); + +$sitename = get_string("site") . ': ' . format_string($site->fullname) . ''; +echo html_writer::tag('div', $sitename, array('class' => 'sitename')); + +$coursename = get_string("course") . ': ' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')'; +echo html_writer::tag('div', $coursename, array('class' => 'coursename')); + +$modname = get_string("modulename","glossary") . ': ' . format_string($glossary->name, true) . ''; +echo html_writer::tag('div', $modname, array('class' => 'modname')); + if ( $allentries ) { foreach ($allentries as $entry) { @@ -195,8 +209,7 @@ if ( $allentries ) { $user = $DB->get_record("user", array("id"=>$entry->userid)); $pivottoshow = fullname($user); } - - echo "

".clean_text($pivottoshow)."

" ; + echo html_writer::tag('div', clean_text($pivottoshow), array('class' => 'mdl-align strong')); } } diff --git a/mod/glossary/styles.css b/mod/glossary/styles.css index 21b14a1d876..2baf7d45318 100644 --- a/mod/glossary/styles.css +++ b/mod/glossary/styles.css @@ -33,4 +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 .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;} + +.path-mod-glossary .printicon {background: url([[pix:t/print]]) no-repeat scroll 2px center transparent; padding-left: 20px; } diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 2b0a40dd0e1..b276b8a20d0 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -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 ''; - echo " id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\">pix_url('print', 'glossary')."\" alt=\"". get_string("printerfriendly","glossary") . "\" />"; - echo ''; -// print_box_end(); + echo " id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\">" . get_string("printerfriendly","glossary").""; } } /// End glossary controls diff --git a/mod/wiki/lang/en/wiki.php b/mod/wiki/lang/en/wiki.php index 91b264affe9..27a4310fcbb 100644 --- a/mod/wiki/lang/en/wiki.php +++ b/mod/wiki/lang/en/wiki.php @@ -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'; diff --git a/mod/wiki/pagelib.php b/mod/wiki/pagelib.php index 334cf848af8..3d9dd475dd1 100644 --- a/mod/wiki/pagelib.php +++ b/mod/wiki/pagelib.php @@ -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 '

' . format_string($this->title) . '

'; } diff --git a/mod/wiki/renderer.php b/mod/wiki/renderer.php index a22add12efc..e5a98697ae2 100644 --- a/mod/wiki/renderer.php +++ b/mod/wiki/renderer.php @@ -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; } diff --git a/mod/wiki/styles.css b/mod/wiki/styles.css index 74536aa8fee..ec97ce800b2 100644 --- a/mod/wiki/styles.css +++ b/mod/wiki/styles.css @@ -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;} \ No newline at end of file