File: faq_format.php

package info (click to toggle)
moodle 1.4.4.dfsg.1-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,876 kB
  • ctags: 29,496
  • sloc: php: 271,617; sql: 5,084; xml: 702; perl: 638; sh: 403; java: 283; makefile: 42; pascal: 21
file content (60 lines) | stat: -rw-r--r-- 2,175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?PHP  // $Id: faq_format.php,v 1.2.2.1 2004/11/09 18:37:01 stronk7 Exp $

function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
    global $THEME, $USER;
    $return = false;
    if ( $entry ) {
        $colour = $THEME->cellheading2;

        echo "\n<br /><table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";

        echo '<tr>';
        echo "<td valign=\"top\" width=100% bgcolor=\"$colour\">";
        $entry->course = $course->id;

        echo '<b>' . get_string("question","glossary") . ':</b> ';
        glossary_print_entry_concept($entry);
        echo '<br />';

        echo "<font size=1>(".get_string("lastedited").": ".
             userdate($entry->timemodified).")</font>";
        echo "</td>";
        echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostheader\">";

        glossary_print_entry_approval($cm, $entry, $mode);
        glossary_print_entry_attachment($entry,"html","right");
        echo "</td>";

        echo "</tr>";

        echo "\n<tr>";
        echo "\n<td width=100% colspan=\"2\" bgcolor=\"$THEME->cellcontent\" class=\"forumpostmessage\">";
        echo '<b>' . get_string("answer","glossary") . ':</b> ';

        glossary_print_entry_definition($entry);


        $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
        echo '</td></tr></table>';

    } else {
        echo '<center>';
        print_string("noentry", "glossary");
        echo '</center>';
    }
    return $return;
}

function glossary_print_entry_faq($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL) {

    //The print view for this format is exactly the normal view, so we use it

    //Take out autolinking in definitions un print view
    $entry->definition = '<nolink>'.$entry->definition.'</nolink>';

    //Call to view function (without icons, ratings and aliases) and return its result
    return glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);

}

?>