~ubuntu-branches/ubuntu/breezy/moodle/breezy

« back to all changes in this revision

Viewing changes to mod/glossary/formats/encyclopedia/encyclopedia_format.php

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2005-10-13 02:00:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051013020059-y2qcyo41t7nqppcg
Tags: 1.5.2-1ubuntu1
* Resync with debian (security update)
* changed dependencys to php5
* changed apache dependency to apache2 
* References
  CAN-2005-2247

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?PHP  // $Id: encyclopedia_format.php,v 1.2.2.2 2004/11/26 01:16:16 stronk7 Exp $
2
 
 
3
 
function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode="",$hook="",$printicons=1,$ratings=NULL, $aliases=true) {
4
 
    global $THEME, $CFG, $USER;
5
 
 
6
 
    $colour = $THEME->cellheading2;
7
 
 
8
 
    $user = get_record("user", "id", $entry->userid);
9
 
    $strby = get_string("writtenby", "glossary");
10
 
 
11
 
    echo "\n<br /><table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
12
 
 
13
 
    echo "\n<tr>";
14
 
    echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostpicture\">";
 
1
<?php  // $Id: encyclopedia_format.php,v 1.13.2.1 2005/06/19 15:23:54 stronk7 Exp $
 
2
 
 
3
function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='',$hook='',$printicons=1,$ratings=NULL, $aliases=true) {
 
4
    global $CFG, $USER;
 
5
 
 
6
 
 
7
    $user = get_record('user', 'id', $entry->userid);
 
8
    $strby = get_string('writtenby', 'glossary');
 
9
 
15
10
    $return = false;
16
11
    if ($entry) {
 
12
        echo '<table class="glossarypost encyclopedia" cellspacing="0">';
 
13
        echo '<tr valign="top">';
 
14
        echo '<td class="left picture">';
 
15
        
17
16
        print_user_picture($user->id, $course->id, $user->picture);
18
17
    
19
 
        echo "</td>";
20
 
        echo "<td valign=\"top\" width=100% bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\">";
21
 
        echo "<b>";
 
18
        echo '</td>';
 
19
        echo '<td class="entryheader">';
 
20
        echo '<span class="concept">';
22
21
        glossary_print_entry_concept($entry);
23
 
        echo "</b><br />";
24
 
    
25
 
        echo "<font size=\"2\">$strby " . fullname($user, isteacher($course->id)) . "</font>";
26
 
        echo "&nbsp;&nbsp;<font size=1>(".get_string("lastedited").": ".
27
 
             userdate($entry->timemodified).")</font>";
28
 
        echo "</td>";
29
 
        echo "\n<td bgcolor=\"$THEME->cellheading\" width=35 valign=top class=\"forumpostheader\">";
30
 
 
 
22
        echo '</span><br />';
 
23
 
 
24
        $fullname = fullname($user, isteacher($course->id));
 
25
        $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
 
26
        $by->date = userdate($entry->timemodified);
 
27
        echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
 
28
 
 
29
        echo '</td>';
 
30
        
 
31
        echo '<td class="entryapproval">';
31
32
        glossary_print_entry_approval($cm, $entry, $mode);
32
 
        echo "</td>";
 
33
        echo '</td>';
33
34
        
34
 
        echo "</tr>";
 
35
        echo '</tr>';
35
36
 
36
 
        echo "\n<tr>";
37
 
        echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostside\">&nbsp;</td>";
38
 
        echo "\n<td width=100% colspan=\"2\" bgcolor=\"$THEME->cellcontent\" class=\"forumpostmessage\">";
39
 
        echo "<table width=\"100%\" border=\"0\"><tr><td>";
 
37
        echo '<tr valign="top">';
 
38
        echo '<td class="left side" rowspan="2">&nbsp;</td>';
 
39
        echo '<td colspan="2" class="entry">';
40
40
 
41
41
        if ($entry->attachment) {
42
42
            $entry->course = $course->id;
43
43
            if (strlen($entry->definition)%2) {
44
 
                $align = "right";
 
44
                $align = 'right';
45
45
            } else {
46
 
                $align = "left";
 
46
                $align = 'left';
47
47
            }
48
 
            glossary_print_entry_attachment($entry,"",$align,false);
 
48
            glossary_print_entry_attachment($entry,'',$align,false);
49
49
        }
50
50
        glossary_print_entry_definition($entry);
51
 
        echo "</td></tr></table>";
52
51
 
53
52
        if ($printicons or $ratings or $aliases) {
 
53
            echo '</td></tr>';
 
54
            echo '<tr>';
 
55
            echo '<td colspan="2" class="entrylowersection">';
54
56
            $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings, $aliases);
55
57
            echo ' ';
56
58
        }
 
59
        
 
60
        echo '</td></tr>';
 
61
        echo "</table>\n";
 
62
        
57
63
    } else {
58
 
        echo "<center>";
59
 
        print_string("noentry", "glossary");
60
 
        echo "</center>";
 
64
        echo '<center>';
 
65
        print_string('noentry', 'glossary');
 
66
        echo '</center>';
61
67
    }
62
 
    echo "</td></tr>";
63
 
 
64
 
    echo "</table>\n";
65
68
    
66
69
    return $return;
67
70
}
68
71
 
69
 
function glossary_print_entry_encyclopedia($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL) {
 
72
function glossary_print_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL) {
70
73
 
71
74
    //The print view for this format is exactly the normal view, so we use it
72
75
 
73
76
    //Take out autolinking in definitions un print view
74
 
    $entry->definition = '<nolink>'.$entry->definition.'</nolink> ';
 
77
    $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
75
78
 
76
79
    //Call to view function (without icons, ratings and aliases) and return its result
 
80
    
77
81
    return glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
78
82
 
79
83
}