Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php
Go to the documentation of this file.
00001 <?php
00002 
00003 function glossary_show_entry_fullwithauthor($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 fullwithauthor" cellspacing="0">';
00012         echo '<tr valign="top">';
00013 
00014         echo '<td class="picture">';
00015         echo $OUTPUT->user_picture($user, array('courseid'=>$course->id));
00016         echo '</td>';
00017 
00018         echo '<th class="entryheader">';
00019 
00020         echo '<div class="concept">';
00021         glossary_print_entry_concept($entry);
00022         echo '</div>';
00023 
00024         $fullname = fullname($user);
00025         $by = new stdClass();
00026         $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
00027         $by->date = userdate($entry->timemodified);
00028         echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
00029 
00030         echo '</th>';
00031         echo '<td class="entryattachment">';
00032 
00033         glossary_print_entry_approval($cm, $entry, $mode);
00034         glossary_print_entry_attachment($entry, $cm, 'html', 'right');
00035         echo '</td>';
00036 
00037         echo '</tr>';
00038 
00039         echo '<tr valign="top">';
00040         echo '<td class="left">&nbsp;</td>';
00041         echo '<td colspan="2" class="entry">';
00042 
00043         glossary_print_entry_definition($entry, $glossary, $cm);
00044 
00045         echo '</td></tr>';
00046         echo '<tr valign="top">';
00047         echo '<td class="left">&nbsp;</td>';
00048         echo '<td colspan="2" class="entrylowersection">';
00049 
00050         glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
00051         echo ' ';
00052         echo '</td></tr>';
00053         echo "</table>\n";
00054     } else {
00055         echo '<div style="text-align:center">';
00056         print_string('noentry', 'glossary');
00057         echo '</div>';
00058     }
00059 }
00060 
00061 function glossary_print_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1) {
00062 
00063     //The print view for this format is exactly the normal view, so we use it
00064 
00065     //Take out autolinking in definitions un print view
00066     $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
00067 
00068     //Call to view function (without icons, ratings and aliases) and return its result
00069     return glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
00070 
00071 }
00072 
00073 
 All Data Structures Namespaces Files Functions Variables Enumerations