MDL-11517 reserved word MOD used in table alias in questions backup code
[moodle-pu.git] / mod / glossary / formats / fullwithauthor / fullwithauthor_format.php
blob545069257e69c31be7fea41ee824c2087924bfe4
1 <?php // $Id$
3 function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
4 global $CFG, $USER;
7 $user = get_record('user', 'id', $entry->userid);
8 $strby = get_string('writtenby', 'glossary');
10 $return = false;
11 if ($entry) {
12 echo '<table class="glossarypost fullwithauthor" cellspacing="0">';
13 echo '<tr valign="top">';
15 echo '<td class="picture">';
16 print_user_picture($user->id, $course->id, $user->picture);
17 echo '</td>';
19 echo '<td class="entryheader">';
21 echo '<span class="concept">';
22 glossary_print_entry_concept($entry);
23 echo '</span><br />';
25 $fullname = fullname($user);
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>';
30 echo '</td>';
31 echo '<td class="entryattachment">';
33 glossary_print_entry_approval($cm, $entry, $mode);
34 glossary_print_entry_attachment($entry,'html','right');
35 echo '</td>';
37 echo '</tr>';
39 echo '<tr valign="top">';
40 echo '<td class="left">&nbsp;</td>';
41 echo '<td colspan="2" class="entry">';
43 glossary_print_entry_definition($entry);
45 echo '</td></tr>';
46 echo '<tr valign="top">';
47 echo '<td class="left">&nbsp;</td>';
48 echo '<td colspan="2" class="entrylowersection">';
50 $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $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>';
59 return $return;
62 function glossary_print_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL) {
64 //The print view for this format is exactly the normal view, so we use it
66 //Take out autolinking in definitions un print view
67 $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
69 //Call to view function (without icons, ratings and aliases) and return its result
70 return glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);