]> git.mjollnir.org Git - moodle.git/commitdiff
Cleanups for footer on home page
authormartin <martin>
Thu, 15 Aug 2002 04:37:35 +0000 (04:37 +0000)
committermartin <martin>
Thu, 15 Aug 2002 04:37:35 +0000 (04:37 +0000)
index.php
lib/moodlelib.php

index 881c48ed216a0ab281e03a7f1d9983f9b697d3df..d44954bab2d135de46660e588002811bc9eab077 100644 (file)
--- a/index.php
+++ b/index.php
   </TR>
 </TABLE>
 
-<? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
-
-<P ALIGN=center>
-<A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
-</P>
+<? print_footer("home") ?>
 
index 893619f30ca384e5e5a768e956bda9af9f37f630..101387c622bfbc488843061cd3cc4e0c148a620f 100644 (file)
@@ -43,9 +43,17 @@ function print_footer ($course=NULL) {
     global $USER, $CFG, $THEME;
 
     if ($course) {
-        $homelink = "<A TARGET=_top HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>";
+        if ($course == "home") {   // special case for site home page
+            if (!$dversion = get_field("config", "value", "name", "version")) {
+                $dversion = "unknown!";
+            }
+            $homelink  = "<P ALIGN=center><A TITLE=\"Version $dversion: Click to visit moodle.com\" HREF=\"http://moodle.com/\">";
+            $homelink .= "<IMG WIDTH=85 HEIGHT=25 SRC=\"pix/madewithmoodle.gif\" BORDER=0></A></P>";
+        } else {
+            $homelink = "<A TARGET=_top HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>";
+        }
     } else {
-        $homelink = "<A TARGET=_top HREF=\"$CFG->wwwroot\">Home</A>";
+        $homelink = "<A TARGET=_top HREF=\"$CFG->wwwroot\">".get_string("home")."</A>";
     }
     if ($USER->realuser) {
         if ($realuser = get_record("user", "id", $USER->realuser)) {