mirror of
https://github.com/moodle/moodle.git
synced 2025-02-06 08:10:11 +01:00
3eb2f7ecf8
Please, verify (and close) it. Patch submitted by Petr Skoda. Thanks! I've modified some lines in formats to avoid some Notices and make everything display more consistent. Please, test it!!
61 lines
2.1 KiB
PHP
61 lines
2.1 KiB
PHP
<?PHP // $Id$
|
|
|
|
function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="",$hook="",$printicons=1,$ratings=NULL) {
|
|
global $THEME, $CFG, $USER;
|
|
|
|
$colour = $THEME->cellheading2;
|
|
|
|
$user = get_record("user", "id", $entry->userid);
|
|
$strby = get_string("writtenby", "glossary");
|
|
|
|
echo "\n<br /><table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
|
|
|
|
echo "\n<tr>";
|
|
echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostpicture\">";
|
|
$return = false;
|
|
if ($entry) {
|
|
print_user_picture($user->id, $course->id, $user->picture);
|
|
echo "</td>";
|
|
echo "<td align=\"top\" width=100% bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\">";
|
|
glossary_print_entry_approval($cm, $entry, $mode);
|
|
echo "<b>";
|
|
glossary_print_entry_concept($entry);
|
|
echo "</b><br />";
|
|
echo "<font size=\"2\">$strby " . fullname($user, isteacher($course->id)) . "</font>";
|
|
echo " <font size=1>(".get_string("lastedited").": ".
|
|
userdate($entry->timemodified).")</font>";
|
|
echo "</tr>";
|
|
|
|
echo "\n<tr>";
|
|
echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostside\"> </td>";
|
|
echo "\n<td width=100% align=\"top\" bgcolor=\"$THEME->cellcontent\" class=\"forumpostmessage\">";
|
|
|
|
if ($entry->attachment) {
|
|
$entry->course = $course->id;
|
|
if (strlen($entry->definition)%2) {
|
|
$align = "right";
|
|
} else {
|
|
$align = "left";
|
|
}
|
|
glossary_print_entry_attachment($entry,"",$align);
|
|
}
|
|
glossary_print_entry_definition($entry);
|
|
|
|
glossary_print_entry_lower_section($course, $cm, $glossary, $entry,$mode,$hook,$printicons);
|
|
echo ' ';
|
|
$return = glossary_print_entry_ratings($course, $entry, $ratings);
|
|
|
|
} else {
|
|
echo "<center>";
|
|
print_string("noentry", "glossary");
|
|
echo "</center>";
|
|
}
|
|
echo "</td></tr>";
|
|
|
|
echo "</table>\n";
|
|
|
|
return $return;
|
|
}
|
|
|
|
?>
|