Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / mod / glossary / formats / TEMPLATE / TEMPLATE_format.php
blob96886b5bc5713ff32e592a986e8cfe9de1fbac7d
1 <?php // $Id$
3 function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL, $aliases=true) {
5 global $CFG, $USER;
8 $user = get_record('user', 'id', $entry->userid);
9 $strby = get_string('writtenby', 'glossary');
11 if ($entry) {
13 echo '<table class="glossarypost TEMPLATE">';
14 echo '<tr>';
15 echo '<td class="entryheader">';
17 //Use this function to show author's image
18 //Comments: Configuration not supported
19 print_user_picture($user->id, $course->id, $user->picture);
21 //Line separator to show this template fine. :-)
22 echo '<br />';
24 //Use this code to show author's name
25 //Comments: Configuration not supported
26 $fullname = fullname($user);
27 $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
28 $by->date = userdate($entry->timemodified);
29 echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>' . '<br />';
31 //Use this code to show modification date
32 //Comments: Configuration not supported
33 echo get_string('lastedited').': '. userdate($entry->timemodified) . '<br /></span>';
35 //Use this function to show the approval button. It'll be shown if necessary
36 //Comments: You can configure this parameters:
37 //----Define where to show the approval button
38 $approvalalign = 'right'; //Values: left, center and right (default right)
39 //----Define if the approval button must be showed into a 100% width table
40 $approvalinsidetable = true; //Values: true, false (default true)
41 //Call the function
42 glossary_print_entry_approval($cm, $entry, $mode, $approvalalign, $approvalinsidetable);
44 //Line separator to show this template fine. :-)
45 echo '<br />';
47 echo '</td>';
49 echo '<td class="entryattachment">';
51 //Use this function to show the attachment. It'll be showed if necessary
52 //Comments: You can configure this parameters:
53 //----Define how to show the attachment
54 $attachmentformat = 'html'; //Values: html (link) and NULL (inline image if possible) (default NULL)
55 //----Define where to show the attachment
56 $attachmentalign = 'right'; //Values: left, center and right (default right)
57 //----Define if the attachment must be showed into a 100% width table
58 $attachmentinsidetable = true; //Values: true, false (default true)
59 //Call the function
60 glossary_print_entry_attachment($entry,$attachmentformat,$attachmentalign,$attachmentinsidetable);
62 //Line separator to show this template fine. :-)
63 echo "<br />\n";
65 echo '</td></tr>';
67 echo '<tr valign="top">';
68 echo '<td class="entry">';
70 //Use this function to print the concept
71 //Comments: Configuration not supported
72 glossary_print_entry_concept($entry);
74 //Line separator to show this template fine. :-)
75 echo "<br />\n";
77 //Use this function to show the definition
78 //Comments: Configuration not supported
79 glossary_print_entry_definition($entry);
81 //Line separator to show this template fine. :-)
82 echo "<br />\n";
84 //Use this function to show aliases, editing icons and ratings (all know as the 'lower section')
85 //Comments: You can configure this parameters:
86 //----Define when to show the aliases popup
87 // use it only if you are really sure!
88 //$aliases = true; //Values: true, false (Default: true)
89 //----Uncoment this line to avoid ratings being showed
90 // use it only if you are really sure! You can define this in the glossary conf. page.
91 //$ratings = NULL;
92 //----Uncoment this line to avoid editing icons being showed
93 // use it only if you are really sure!
94 //$printicons = false;
95 $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
97 echo '</td>';
98 echo '</tr>';
99 echo "</table>\n";
100 } else {
101 echo '<div style="text-align:center">';
102 print_string('noentry', 'glossary');
103 echo '</div>';
106 return $return;
109 function glossary_print_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL) {
111 //The print view for this format is exactly the normal view, so we use it
112 //Anyway, you can modify this to use your own print format!!
114 //Take out autolinking in definitions in print view
115 $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
117 //Call to view function (without icons, ratings and aliases) and return its result
118 return glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);