Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
   1  <?php
   2  
   3  function glossary_show_entry_fullwithauthor($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 fullwithauthor" cellspacing="0">';
  12          echo '<tr valign="top">';
  13  
  14          echo '<td class="picture">';
  15          echo $OUTPUT->user_picture($user, array('courseid'=>$course->id));
  16          echo '</td>';
  17  
  18          echo '<th class="entryheader">';
  19  
  20          echo '<div class="concept">';
  21          glossary_print_entry_concept($entry);
  22          echo '</div>';
  23  
  24          $fullname = fullname($user);
  25          $by = new stdClass();
  26          $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
  27          $by->date = userdate($entry->timemodified);
  28          echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
  29  
  30          echo '</th>';
  31          echo '<td class="entryattachment">';
  32  
  33          glossary_print_entry_approval($cm, $entry, $mode);
  34          echo '</td>';
  35  
  36          echo '</tr>';
  37  
  38          echo '<tr valign="top">';
  39          echo '<td class="left">&nbsp;</td>';
  40          echo '<td colspan="2" class="entry">';
  41  
  42          glossary_print_entry_definition($entry, $glossary, $cm);
  43          glossary_print_entry_attachment($entry, $cm, 'html');
  44  
  45          if (core_tag_tag::is_enabled('mod_glossary', 'glossary_entries')) {
  46              echo $OUTPUT->tag_list(
  47                  core_tag_tag::get_item_tags('mod_glossary', 'glossary_entries', $entry->id), null, 'glossary-tags');
  48          }
  49  
  50          echo '</td></tr>';
  51          echo '<tr valign="top">';
  52          echo '<td class="left">&nbsp;</td>';
  53          echo '<td colspan="2" class="entrylowersection">';
  54  
  55          glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
  56          echo ' ';
  57          echo '</td></tr>';
  58          echo "</table>\n";
  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_fullwithauthor($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      return glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
  75  
  76  }
  77  
  78