</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>
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");
$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!";
//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\">";
// 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\">";