MDL-39815 glossary mod: code improvement.
Use html_writer to print out divs.
This commit is contained in:
+12
-6
@@ -175,10 +175,17 @@ $printlinkatt = array('onclick' => 'window.print();return false;', 'class' => 'g
|
||||
$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 />';
|
||||
echo get_string("modulename","glossary") . ': <strong>' . format_string($glossary->name, true) . '</strong>';
|
||||
echo html_writer::tag('div', userdate(time()), array('class' => 'displaydate'));
|
||||
|
||||
$sitename = get_string("site") . ': <span class="strong">' . format_string($site->fullname) . '</span>';
|
||||
echo html_writer::tag('div', $sitename, array('class' => 'sitename'));
|
||||
|
||||
$coursename = get_string("course") . ': <span class="strong">' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')</span>';
|
||||
echo html_writer::tag('div', $coursename, array('class' => 'coursename'));
|
||||
|
||||
$modname = get_string("modulename","glossary") . ': <span class="strong">' . format_string($glossary->name, true) . '</span>';
|
||||
echo html_writer::tag('div', $modname, array('class' => 'modname'));
|
||||
|
||||
if ( $allentries ) {
|
||||
foreach ($allentries as $entry) {
|
||||
|
||||
@@ -204,8 +211,7 @@ if ( $allentries ) {
|
||||
$user = $DB->get_record("user", array("id"=>$entry->userid));
|
||||
$pivottoshow = fullname($user);
|
||||
}
|
||||
|
||||
echo "<p class='mdl-align'><strong>".clean_text($pivottoshow)."</strong></p>" ;
|
||||
echo html_writer::tag('div', '<span class="strong">' . clean_text($pivottoshow). '</span>', array('class' => 'mdl-align'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,3 +35,6 @@
|
||||
#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;}
|
||||
|
||||
#page-mod-glossary-print .displaydate {text-align: right; font-size: 0.75em;}
|
||||
#page-mod-glossary-print .strong {font-weight: bold;}
|
||||
Reference in New Issue
Block a user