]> git.mjollnir.org Git - moodle.git/commitdiff
Some changes to accomodate changes in the reading lib
authormartin <martin>
Tue, 26 Feb 2002 06:35:18 +0000 (06:35 +0000)
committermartin <martin>
Tue, 26 Feb 2002 06:35:18 +0000 (06:35 +0000)
index.php

index 8b45088e39748d20e3837de6a9682000e6699f2c..c4538700f33f59978e9c92c854b232e46d84ebe1 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2,6 +2,7 @@
     // index.php - the front page.
     
     require("config.php");
+    include("mod/reading/lib.php"); 
 
     if (! $site = get_record("course", "category", 0)) {
         redirect("$CFG->wwwroot/admin/");
       <LI><A TITLE="Available courses on this server" HREF="course/"><B>Courses</B></A><BR></LI>
       <LI><A TITLE="Site-level Forums" HREF="mod/discuss/index.php?id=<?=$site->id?>">Forums</A></LI>
 
-      <? include("mod/reading/lib.php"); 
-         list_all_readings();
+      <? 
+         if ($readings = list_all_readings()) {
+             foreach ($readings as $reading) {
+                echo "<LI>$reading";
+             }
+         }
+     
+         if ($USER->editing) {
+             echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$course->id&week=0&add=reading\">Add Reading</A>...</P>";
+         }
       ?>
 
         <BR><BR>