Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-32325 Glossary: Entrylist print version is XHTML compliant

  • Loading branch information...
commit 50d24a3c856c607039840db31e6af07cc79d19a5 1 parent 4631e39
Frédéric Massart FMCorz authored
26 mod/glossary/formats/entrylist/entrylist_format.php
@@ -42,25 +42,25 @@ function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode=''
42 42 }
43 43
44 44 function glossary_print_entry_entrylist($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1) {
45   -
46   - //The print view for this format is different from the normal view, so we implement it here completely
47   - global $CFG, $USER;
48   -
49   -
50 45 //Take out autolinking in definitions un print view
  46 + // TODO use <nolink> tags MDL-15555.
51 47 $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
52 48
53   - echo '<table class="glossarypost entrylist">';
54   - echo '<tr valign="top">';
55   - echo '<td class="entry">';
56   - echo '<b>';
  49 + echo html_writer::start_tag('table', array('class' => 'glossarypost entrylist mod-glossary-entrylist'));
  50 + echo html_writer::start_tag('tr');
  51 + echo html_writer::start_tag('td', array('class' => 'entry mod-glossary-entry'));
  52 + echo html_writer::start_tag('div', array('class' => 'mod-glossary-concept'));
57 53 glossary_print_entry_concept($entry);
58   - echo ':</b> ';
  54 + echo html_writer::end_tag('div');
  55 + echo html_writer::start_tag('div', array('class' => 'mod-glossary-definition'));
59 56 glossary_print_entry_definition($entry, $glossary, $cm);
  57 + echo html_writer::end_tag('div');
  58 + echo html_writer::start_tag('div', array('class' => 'mod-glossary-lower-section'));
60 59 glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, false, false);
61   - echo '</td>';
62   - echo '</tr>';
63   - echo "</table>\n";
  60 + echo html_writer::end_tag('div');
  61 + echo html_writer::end_tag('td');
  62 + echo html_writer::end_tag('tr');
  63 + echo html_writer::end_tag('table');
64 64 }
65 65
66 66
6 mod/glossary/lib.php
@@ -1108,9 +1108,8 @@ function glossary_print_entry_default ($entry, $glossary, $cm) {
1108 1108 */
1109 1109 function glossary_print_entry_concept($entry, $return=false) {
1110 1110 global $OUTPUT;
1111   - $options = new stdClass();
1112   - $options->para = false;
1113   - $text = format_text($OUTPUT->heading('<span class="nolink">' . $entry->concept . '</span>', 3, 'nolink'), FORMAT_MOODLE, $options);
  1111 +
  1112 + $text = html_writer::tag('h3', format_string($entry->concept));
1114 1113 if (!empty($entry->highlight)) {
1115 1114 $text = highlight($entry->highlight, $text);
1116 1115 }
@@ -1152,6 +1151,7 @@ function glossary_print_entry_definition($entry, $glossary, $cm) {
1152 1151 $options->trusted = $entry->definitiontrust;
1153 1152 $options->context = $context;
1154 1153 $options->overflowdiv = true;
  1154 +
1155 1155 $text = format_text($definition, $entry->definitionformat, $options);
1156 1156
1157 1157 // Stop excluding concepts from autolinking
2  mod/glossary/styles.css
@@ -30,3 +30,5 @@
30 30 #page-mod-glossary-view table.glossarycategoryheader th {padding:0px;}
31 31
32 32 #page-mod-glossary-showentry #page-content {min-width:600px;}
  33 +
  34 +#page-mod-glossary-print .mod-glossary-entrylist .mod-glossary-entry { vertical-align: top; }

0 comments on commit 50d24a3

Please sign in to comment.
Something went wrong with that request. Please try again.