~ubuntu-branches/ubuntu/hoary/moodle/hoary

« back to all changes in this revision

Viewing changes to mod/glossary/formats/TEMPLATE/TEMPLATE_format.php

  • Committer: Bazaar Package Importer
  • Author(s): Isaac Clerencia
  • Date: 2004-12-29 00:49:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229004952-gliyqzpj2w3e7clx
Tags: 1.4.3-1
* Urgency high as upstream release fixes several security bugs
* New upstream release
* Write database creation errors and warn the user about it, 
closes: #285842, #285842

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?PHP  // $Id: TEMPLATE_format.php,v 1.1.2.1 2004/11/09 18:36:59 stronk7 Exp $
 
2
 
 
3
function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
 
4
 
 
5
    global $THEME, $CFG, $USER;
 
6
 
 
7
    $colour = $THEME->cellheading2;
 
8
 
 
9
    $user = get_record("user", "id", $entry->userid);
 
10
    $strby = get_string("writtenby", "glossary");
 
11
 
 
12
    echo "<table border=\"0\" width=\"95%\" cellspacing=\"0\" cellpadding=\"3\" class=\"forumpost\" align=\"center\"r>\n";
 
13
    echo "<tr>\n";
 
14
    echo "<td width=\"100%\" valign=\"top\" bgcolor=\"#FFFFFF\">\n";
 
15
 
 
16
    if ($entry) {
 
17
        //Use this function to show author's image
 
18
        //Comments: Configuration not supported
 
19
        print_user_picture($user->id, $course->id, $user->picture);
 
20
 
 
21
        //Line separator to show this template fine. :-)
 
22
        echo "<br />\n";
 
23
 
 
24
        //Use this code to show author's name
 
25
        //Comments: Configuration not supported
 
26
        echo "$strby " . fullname($user, isteacher($course->id)) . "<br />\n";
 
27
 
 
28
        //Use this code to show modification date
 
29
        //Comments: Configuration not supported
 
30
        echo get_string("lastedited").": ". userdate($entry->timemodified) . "<br />\n";
 
31
 
 
32
        //Use this function to show the approval button. It'll be showed if necessary       
 
33
        //Comments: You can configure this parameters:
 
34
        //----Define where to show the approval button
 
35
        $approvalalign = 'right'; //Values: left, center and right (default right)
 
36
        //----Define if the approval button must be showed into a 100% width table
 
37
        $approvalinsidetable = true; //Values: true, false (default true)
 
38
        //Call the function
 
39
        glossary_print_entry_approval($cm, $entry, $mode, $approvalalign, $approvalinsidetable);
 
40
 
 
41
        //Line separator to show this template fine. :-)
 
42
        echo "<br />\n";
 
43
 
 
44
        //Use this function to show the attachment. It'll be showed if necessary
 
45
        //Comments: You can configure this parameters:
 
46
        //----Define how to show the attachment 
 
47
        $attachmentformat = 'html'; //Values: html (link) and NULL (inline image if possible) (default NULL)
 
48
        //----Define where to show the attachment
 
49
        $attachmentalign = 'right'; //Values: left, center and right (default right)
 
50
        //----Define if the attachment must be showed into a 100% width table
 
51
        $attachmentinsidetable = true; //Values: true, false (default true)
 
52
        //Call the function
 
53
        glossary_print_entry_attachment($entry,$attachmentformat,$attachmentalign,$attachmentinsidetable);
 
54
 
 
55
        //Line separator to show this template fine. :-)
 
56
        echo "<br />\n";
 
57
 
 
58
        //Use this function to print the concept
 
59
        //Comments: Configuration not supported
 
60
        glossary_print_entry_concept($entry);
 
61
 
 
62
        //Line separator to show this template fine. :-)
 
63
        echo "<br />\n";
 
64
 
 
65
        //Use this function to show the definition 
 
66
        //Comments: Configuration not supported
 
67
        glossary_print_entry_definition($entry);
 
68
 
 
69
        //Line separator to show this template fine. :-)
 
70
        echo "<br />\n";
 
71
 
 
72
        //Use this function to show aliases, editing icons and ratings (all know as the 'lower section')
 
73
        //Comments: You can configure this parameters:
 
74
        //----Define when to show the aliases popup
 
75
        //    use it only if you are really sure!
 
76
        //$aliases = true; //Values: true, false (Default: true)
 
77
        //----Uncoment this line to avoid ratings being showed
 
78
        //    use it only if you are really sure! You can define this in the glossary conf. page.
 
79
        //$ratings = NULL;
 
80
        //----Uncoment this line to avoid editing icons being showed
 
81
        //    use it only if you are really sure!
 
82
        //$printicons = false;
 
83
        $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
 
84
    } else {    
 
85
        echo "<center>";
 
86
        print_string("noentry", "glossary");
 
87
        echo "</center>";
 
88
    }
 
89
    echo "</td>\n";
 
90
    echo "</tr>\n";
 
91
    echo "</table>\n";
 
92
 
 
93
    return $return;
 
94
}
 
95
 
 
96
function glossary_print_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL) {
 
97
 
 
98
    //The print view for this format is exactly the normal view, so we use it
 
99
    //Anyway, you can modify this to use your own print format!!
 
100
 
 
101
    //Take out autolinking in definitions in print view
 
102
    $entry->definition = '<nolink>'.$entry->definition.'</nolink>';
 
103
 
 
104
    //Call to view function (without icons, ratings and aliases) and return its result
 
105
    return glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
 
106
 
 
107
}
 
108
 
 
109
?>