[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/glossary/formats/encyclopedia/ -> encyclopedia_format.php (source)

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


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