]> git.mjollnir.org Git - moodle.git/commitdiff
Changed weekly format ... makes more sense now I think
authormartin <martin>
Tue, 4 Dec 2001 16:13:36 +0000 (16:13 +0000)
committermartin <martin>
Tue, 4 Dec 2001 16:13:36 +0000 (16:13 +0000)
course/lib.php
course/weeks.php

index cdc52359d58cd3ac2bfdad0e4064ec273dc13990..b9872e58054387f1e9bf55532a4b8dda2c77751f 100644 (file)
@@ -112,7 +112,7 @@ function print_course($course) {
     echo "<P><FONT SIZE=3><B><A HREF=\"view.php?id=$course->id\">$course->fullname</A></B></FONT></P>";
     if ($teachers = get_records_sql("SELECT u.* FROM user u, user_teachers t 
                                      WHERE u.id = t.user AND t.course = '$course->id' 
-                                     ORDER BY t.authority DESC")) {
+                                     ORDER BY t.authority ASC")) {
 
         echo "<P><FONT SIZE=1>\n";
         foreach ($teachers as $teacher) {
index 85b07c250cf1d73a999e71ca695424d7855a869f..d70ef0054ba1a52a4ba92f1ca70de6e872e6f5ab 100644 (file)
         $weeks[$cw->week] = $cw;
     }
 
-    // Layout the whole page as two big columns.
+    // Layout the whole page as three big columns.
     echo "<TABLE BORDER=0 CELLPADDING=4>";
-    echo "<TR VALIGN=top><TD VALIGN=top WIDTH=200>";
+    echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
     echo "<IMG SRC=\"../pix/spacer.gif\" WIDTH=180 HEIGHT=1><BR>";
     
     // Layout the left column
 
-    print_side_block("<A HREF=\"new.php?id=$course->id\">What's New!</A>", 
-                     "", "<FONT SIZE=1>...since your last login</FONT>");
-
-    // Then, print all the news items.
-
-    include("../mod/discuss/lib.php");
-    if ($news = get_course_news_forum($course->id)) {
-        print_simple_box_start("CENTER", "100%", "#FFFFFF", 5);
-        echo "<P><B><FONT SIZE=2>Latest News</FONT></B><BR>";
-        echo "<FONT SIZE=1>";
-        forum_latest_topics($news->id, 5, "minimal", "DESC", false);
-        echo "</FONT>";
-        print_simple_box_end();
-    }
-
-    // Now, print all the course links on the side
+    // Print all the course links on the side
 
     // Then all the links to module types
 
 
     $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">Participants</A>";
     $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"Participants\">";
+    $moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my info</A>";
+    $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";
 
     print_side_block("Activities", $moddata, "", $modicon);
 
     // Admin links and controls
 
-    $admindata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">My details</A>";
-    $adminicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"About me\">";
+    if ($USER->teacher[$course->id] || isadmin()) {
+        $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"Edit\">";
+        if ($USER->editing) {
+            $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">Turn editing off</A>";
+        } else {
+            $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">Turn editing on</A>";
+        }
 
-    if ($USER->teacher[$course->id]) {
-        $admindata[]="<A HREF=\"edit.php?id=$course->id\">Course settings</A>";
+        $admindata[]="<A HREF=\"edit.php?id=$course->id\">Course settings...</A>";
         $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"Course\">";
-        $admindata[]="<A HREF=\"log.php?id=$course->id\">Logs</A>";
+        $admindata[]="<A HREF=\"log.php?id=$course->id\">Logs...</A>";
         $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"Log\">";
-        $admindata[]="<A HREF=\"email.php?id=$course->id\">Send mail</A>";
-        $adminicon[]="<IMG SRC=\"../pix/i/email.gif\" HEIGHT=16 WIDTH=16 ALT=\"Email\">";
-        $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">Files</A>";
+        $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">Files...</A>";
         $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"Files\">";
+
+        print_side_block("Administration", $admindata, "", $adminicon);
     }
-    print_side_block("Administration", $admindata, "", $adminicon);
 
 
     // Start main column
-    echo "</TD><TD WIDTH=100%>";
-
-    // Now all the weekly modules
+    echo "</TD><TD WIDTH=\"*\">";
 
+    echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0><TR><TD>";
+    echo "<P><IMG SRC=\"../pix/spacer.gif\" WIDTH=100% HEIGHT=3><BR>";
+    echo "<B><FONT SIZE=2>Weekly Outline</FONT></B>\n";
+    
+    echo "</FONT>";
+    echo "</TD></TR></TABLE>";
 
+    // Now all the weekly modules
     $timenow = time();
     $weekdate = $course->startdate;    // this should be 0:00 Monday of that week
     $week = 1;
     $weekofseconds = 604800;
 
-    echo "<P><IMG SRC=\"../pix/spacer.gif\" WIDTH=100% HEIGHT=3><BR>";
-    echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>";
-    echo "<TR><TD>";
-    echo "<B><FONT SIZE=2>Weekly Outline</FONT></B>\n";
-    
-    // Global switches
-    echo "</TD><TD NOWRAP ALIGN=RIGHT><P><FONT SIZE=1>";
-    if ($USER->teacher[$course->id]) {
-        if ($USER->editing) {
-            echo "<A HREF=\"view.php?id=$course->id&edit=off\">Turn editing off</A>";
-        } else {
-            echo "<A HREF=\"view.php?id=$course->id&edit=on\">Turn editing on</A>";
-        }
-    }
-    if ($USER->help) {
-        echo "&nbsp;&nbsp;&nbsp;<A HREF=\"view.php?id=$course->id&help=off\">Turn help off</A>";
-    } else {
-        echo "&nbsp;&nbsp;&nbsp;<A HREF=\"view.php?id=$course->id&help=on\">Turn help on</A>";
-    }
-    echo "</FONT></P></TD></TR></TABLE>";
-
     echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
     while ($weekdate < $course->enddate) {
         echo "<TR>";
         $weekdate = $nextweekdate;
     }
     echo "</TABLE>";
-    echo "</TABLE>";
     
 
-    echo "</TD></TR></TABLE>";
+    echo "</TD><TD WIDTH=180>";
+
+    // Print What's New
+
+    print_side_block("<A HREF=\"new.php?id=$course->id\">What's New!</A>", 
+                     "", "<FONT SIZE=1>...since your last login</FONT>");
+
+    // Then, print all the news items.
+
+    include("../mod/discuss/lib.php");
+    if ($news = get_course_news_forum($course->id)) {
+        echo "<P><B><FONT SIZE=2>Latest News</FONT></B><BR>";
+        print_simple_box_start("CENTER", "100%", "#FFFFFF", 3);
+        echo "<FONT SIZE=1>";
+        forum_latest_topics($news->id, 5, "minimal", "DESC", false);
+        echo "</FONT>";
+        print_simple_box_end();
+    }
+
+    echo "</TD></TR></TABLE>\n";
 
 ?>