[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/glossary/formats/fullwithauthor/ -> fullwithauthor_format.php (source)

   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          echo '</td></tr>';
  46          echo '<tr valign="top">';
  47          echo '<td class="left">&nbsp;</td>';
  48          echo '<td colspan="2" class="entrylowersection">';
  49  
  50          glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
  51          echo ' ';
  52          echo '</td></tr>';
  53          echo "</table>\n";
  54      } else {
  55          echo '<div style="text-align:center">';
  56          print_string('noentry', 'glossary');
  57          echo '</div>';
  58      }
  59  }
  60  
  61  function glossary_print_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1) {
  62  
  63      //The print view for this format is exactly the normal view, so we use it
  64  
  65      //Take out autolinking in definitions un print view
  66      $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
  67  
  68      //Call to view function (without icons, ratings and aliases) and return its result
  69      return glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
  70  
  71  }
  72  
  73  


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1