|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='',$hook='',$printicons=1, $aliases=true) { 00004 global $CFG, $USER, $DB, $OUTPUT; 00005 00006 00007 $user = $DB->get_record('user', array('id'=>$entry->userid)); 00008 $strby = get_string('writtenby', 'glossary'); 00009 00010 if ($entry) { 00011 echo '<table class="glossarypost encyclopedia" cellspacing="0">'; 00012 echo '<tr valign="top">'; 00013 echo '<td class="left picture">'; 00014 00015 echo $OUTPUT->user_picture($user, array('courseid'=>$course->id)); 00016 00017 echo '</td>'; 00018 echo '<th class="entryheader">'; 00019 echo '<div class="concept">'; 00020 glossary_print_entry_concept($entry); 00021 echo '</div>'; 00022 00023 $fullname = fullname($user); 00024 $by = new stdClass(); 00025 $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id.'">'.$fullname.'</a>'; 00026 $by->date = userdate($entry->timemodified); 00027 echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>'; 00028 00029 echo '</th>'; 00030 00031 echo '<td class="entryapproval">'; 00032 glossary_print_entry_approval($cm, $entry, $mode); 00033 echo '</td>'; 00034 00035 echo '</tr>'; 00036 00037 echo '<tr valign="top">'; 00038 echo '<td class="left side" rowspan="2"> </td>'; 00039 echo '<td colspan="2" class="entry">'; 00040 00041 if ($entry->attachment) { 00042 $entry->course = $course->id; 00043 if (strlen($entry->definition)%2) { 00044 $align = 'right'; 00045 } else { 00046 $align = 'left'; 00047 } 00048 glossary_print_entry_attachment($entry, $cm, null,$align,false); 00049 } 00050 glossary_print_entry_definition($entry, $glossary, $cm); 00051 00052 if ($printicons or $aliases) { 00053 echo '</td></tr>'; 00054 echo '<tr>'; 00055 echo '<td colspan="2" class="entrylowersection">'; 00056 glossary_print_entry_lower_section($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$aliases); 00057 echo ' '; 00058 } 00059 00060 echo '</td></tr>'; 00061 echo "</table>\n"; 00062 00063 } else { 00064 echo '<div style="text-align:center">'; 00065 print_string('noentry', 'glossary'); 00066 echo '</div>'; 00067 } 00068 } 00069 00070 function glossary_print_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1) { 00071 00072 //The print view for this format is exactly the normal view, so we use it 00073 00074 //Take out autolinking in definitions un print view 00075 $entry->definition = '<span class="nolink">'.$entry->definition.'</span>'; 00076 00077 //Call to view function (without icons, ratings and aliases) and return its result 00078 00079 return glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode, $hook, false, false); 00080 00081 } 00082 00083