Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   1  <?php
   2  
   3  function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='',$hook='',$printicons=1, $aliases=true) {
   4      global $CFG, $USER, $DB, $OUTPUT;
   5  
   6  
   7      $user = $DB->get_record('user', array('id'=>$entry->userid));
   8      $strby = get_string('writtenby', 'glossary');
   9  
  10      if ($entry) {
  11          echo '<table class="glossarypost encyclopedia" cellspacing="0">';
  12          echo '<tr valign="top">';
  13          echo '<td class="left picture">';
  14  
  15          echo $OUTPUT->user_picture($user, array('courseid'=>$course->id));
  16  
  17          echo '</td>';
  18          echo '<th class="entryheader">';
  19          echo '<div class="concept">';
  20          glossary_print_entry_concept($entry);
  21          echo '</div>';
  22  
  23          $fullname = fullname($user);
  24          $by = new stdClass();
  25          $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
  26          $by->date = userdate($entry->timemodified);
  27          echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
  28  
  29          echo '</th>';
  30  
  31          echo '<td class="entryapproval">';
  32          glossary_print_entry_approval($cm, $entry, $mode);
  33          echo '</td>';
  34  
  35          echo '</tr>';
  36  
  37          echo '<tr valign="top">';
  38          echo '<td class="left side" rowspan="2">&nbsp;</td>';
  39          echo '<td colspan="2" class="entry">';
  40  
  41          glossary_print_entry_definition($entry, $glossary, $cm);
  42          glossary_print_entry_attachment($entry, $cm, null);
  43          if (core_tag_tag::is_enabled('mod_glossary', 'glossary_entries')) {
  44              echo $OUTPUT->tag_list(
  45                  core_tag_tag::get_item_tags('mod_glossary', 'glossary_entries', $entry->id), null, 'glossary-tags');
  46          }
  47  
  48          if ($printicons or $aliases) {
  49              echo '</td></tr>';
  50              echo '<tr>';
  51              echo '<td colspan="2" class="entrylowersection">';
  52              glossary_print_entry_lower_section($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$aliases);
  53              echo ' ';
  54          }
  55  
  56          echo '</td></tr>';
  57          echo "</table>\n";
  58  
  59      } else {
  60          echo '<div style="text-align:center">';
  61          print_string('noentry', 'glossary');
  62          echo '</div>';
  63      }
  64  }
  65  
  66  function glossary_print_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1) {
  67  
  68      //The print view for this format is exactly the normal view, so we use it
  69  
  70      //Take out autolinking in definitions un print view
  71      $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
  72  
  73      //Call to view function (without icons, ratings and aliases) and return its result
  74  
  75      return glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode, $hook, false, false);
  76  
  77  }
  78  
  79