]> git.mjollnir.org Git - moodle.git/commitdiff
Included new format for glossary display "Encyclopedia"
authorstronk7 <stronk7>
Mon, 29 Sep 2003 21:37:54 +0000 (21:37 +0000)
committerstronk7 <stronk7>
Mon, 29 Sep 2003 21:37:54 +0000 (21:37 +0000)
lang/en/glossary.php
mod/glossary/formats/3.php [new file with mode: 0644]

index 567c79edd10c040f65d83d781cf3642c81fe6908..79d4841b266d694b0a66f94da314e60210bf2e61 100644 (file)
@@ -23,6 +23,7 @@ $string['displayformat'] = "Display format";
 $string['displayformatdefault'] = "Simple, dictionary style";
 $string['displayformat1'] = "Full without author.";
 $string['displayformat2']  = "Full with author.";
+$string['displayformat3']  = "Encyclopedia.";
 $string['editentry'] = "Edit entry";
 $string['editcategories'] = "Edit categories";
 $string['entries'] = "Entries";
diff --git a/mod/glossary/formats/3.php b/mod/glossary/formats/3.php
new file mode 100644 (file)
index 0000000..ea58b96
--- /dev/null
@@ -0,0 +1,62 @@
+<?PHP  // $Id$
+require_once("lib.php");
+
+function glossary_print_entry_by_format($course, $cm, $glossary, $entry,$currentview="",$cat="") {
+    global $THEME, $CFG, $USER;
+
+//    if ($entry->timemarked < $entry->modified) {
+        $colour = $THEME->cellheading2;
+//    } else {
+//        $colour = $THEME->cellheading;
+//    }
+
+    $user = get_record("user", "id", $entry->userid);
+    $strby = get_string("writtenby","glossary");
+
+    echo "<table width=95% border=0><tr><td>";
+
+    echo "\n<TABLE BORDER=1 width=100% CELLSPACING=0 valign=top cellpadding=10>";
+
+    echo "\n<TR>";
+    echo "\n<TD ROWSPAN=2 BGCOLOR=\"$colour\" WIDTH=35 VALIGN=TOP>";
+    if ($entry) {
+          print_user_picture($user->id, $course->id, $user->picture);
+    }
+    echo "</TD>";
+    echo "<TD NOWRAP WIDTH=100% BGCOLOR=\"$THEME->cellheading\">";
+    if ($entry) {
+        echo "<b>$entry->concept</b><br><FONT SIZE=2>$strby $user->firstname $user->lastname</font>";
+        echo "&nbsp;&nbsp;<FONT SIZE=1>(".get_string("lastedited").": ".userdate($entry->timemodified).")</FONT></small>";
+    }
+    echo "</TR>";
+
+    echo "\n<TR><TD WIDTH=100% BGCOLOR=\"$THEME->cellcontent\">";
+    if ($entry) {
+        if ($entry->attachment) {
+            $entry->course = $course->id;
+            if (strlen($entry->definition)%2) {
+                $align = "right";
+            } else {
+                $align = "left";
+            }
+            echo "<table border=0 align=$align><tr><td>";
+            echo glossary_print_attachments($entry);
+            echo "</td></tr></table>";
+        }
+         echo format_text($entry->definition, $entry->format);
+
+         glossary_print_entry_icons($course, $cm, $glossary, $entry,$currentview,$cat);
+
+    } else {
+         echo "<center>";
+        print_string("noentry", "glossary");
+         echo "</center>";
+    }
+    echo "</TD></TR>";
+
+    echo "</TABLE>\n";
+
+    echo "</td></tr></table>";
+}
+
+?>