]> git.mjollnir.org Git - moodle.git/commitdiff
Added per-course config and use of a word for "student"
authormartin <martin>
Sun, 2 Jun 2002 08:10:50 +0000 (08:10 +0000)
committermartin <martin>
Sun, 2 Jun 2002 08:10:50 +0000 (08:10 +0000)
course/edit.html
course/edit.php
course/social.php
course/weeks.php

index d6c47823b6dff349846d70824ff41852d7a280ac..d528f3b0a68016cb2ba64c5faeadce88e4e809b6 100644 (file)
        </td>
 </tr>
 <tr valign=top>
-       <td><P>Word used to refer<BR>to your role:</td>
+       <td><P>Word for teacher:</td>
        <td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>">
-       <? formerr($err["teacher"]) ?>
+       (eg Teacher, Tutor, Facilitator etc) <? formerr($err["teacher"]) ?>
+       </td>
+</tr>
+<tr valign=top>
+       <td><P>Word for student:</td>
+       <td><input type="text" name="student" size=25 value="<? p($form->student) ?>">
+       (eg Student, Participant etc) <? formerr($err["student"]) ?>
        </td>
 </tr>
 <tr valign=top>
index 876bd79f03f5b77df2cd8dd9edff8b2951eff515..cde0501a0cc2e6494ec87ca33309efe01e14426d 100644 (file)
         if (!isadmin()) {
             error("Only administrators can use this page");
         }
+
+        if (! $site = get_record("course", "category", 0)) {
+            redirect("$CFG->wwwroot/admin/");
+        }
     }
 
 
         } else {
             $ts = getdate(time() + 3600 * 24);
             $te = getdate(time() + 3600 * 24 * 7 * 16);
+            $form->teacher = "Facilitator";
+            $form->student = "Student";
+            $form->fullname = "Course Fullname 101";
+            $form->shortname = "CF101";
+            $form->summary = "Write a concise and interesting paragraph here that explains what this course is about.";
+            $form->format = 0;
+            $form->category = 1;
         }
 
         $form->startday = $ts[mday];
         $form->endday = $te[mday];
         $form->endmonth = $te[mon];
         $form->endyear = $te[year];
-
-        if (!$course) {
-            $form->teacher = "Facilitator";
-            $form->fullname = "Course Fullname 101";
-            $form->shortname = "CF101";
-            $form->summary = "Write a concise and interesting paragraph here that explains what this course is about.";
-            $form->format = 0;
-            $form->category = 1;
-        }
     }
 
     for ($i=1;$i<=31;$i++) {
 
     //$form->owners   = get_records_sql_menu("SELECT u.id, CONCAT(u.firstname, " ", u.lastname) FROM users u, teachers t WHERE t.user = u.id");
 
-    if (isadmin()) {
-        print_header("Admin: Creating a new course", "$CFG->sitename: Administration",
-                     "<A HREF=\"$CFG->wwwroot/admin/\">Admin</A> 
-                      -> Create a new course", $focus);
-
-    } else {
+    if (isset($course)) {
            print_header("Edit course settings", "$course->fullname", 
                      "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> 
                       -> Edit course settings", $focus);
+    } else {
+        print_header("Admin: Creating a new course", "$site->shortname: Administration",
+                     "<A HREF=\"$CFG->wwwroot/admin/\">Admin</A> 
+                      -> Create a new course", $focus);
     }
 
     print_simple_box_start("center", "", "$THEME->cellheading");
@@ -147,8 +148,10 @@ function validate_form($course, &$form, &$err) {
         $err["summary"] = "Missing summary";
 
     if (empty($form->teacher))
-        $err["teacher"] = "Missing Teacher/Tutor/Instructor/Facilitator";
+        $err["teacher"] = "Must choose something";
 
+    if (empty($form->student))
+        $err["student"] = "Must choose something";
 
     if ($form->startdate > $form->enddate)
         $err["startdate"] = "Starts after it ends!";
index b080f23af88f3d01a037b65ec091b9aa10e290db..cd9ea24ac7ec3041cf95127adc095a56bfa24fa4 100644 (file)
@@ -20,7 +20,7 @@
 
       //echo "<BR><BR>";
       print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
-      $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">Participants</A>";
+      $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">List of all people</A>";
       $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">";
       $moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>";
       $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";
index aaad5b05b9983850172c7ae848d4f76a7ce92023..f75058357eac8bf46867c6ce08874b6ffe1e6db8 100644 (file)
@@ -37,7 +37,7 @@
     // Links to people
 
     print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
-    $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">Participants</A>";
+    $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">List of all people</A>";
     $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">";
     $moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>";
     $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";