Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added per-course config and use of a word for "student"

  • Loading branch information...
commit 5e69314dcae11124746e9b1c608b1c7b59891881 1 parent 6777e02
martin authored
View
10 course/edit.html
@@ -41,9 +41,15 @@
</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>
View
35 course/edit.php
@@ -21,6 +21,10 @@
if (!isadmin()) {
error("Only administrators can use this page");
}
+
+ if (! $site = get_record("course", "category", 0)) {
+ redirect("$CFG->wwwroot/admin/");
+ }
}
@@ -79,6 +83,13 @@
} 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];
@@ -88,15 +99,6 @@
$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++) {
@@ -113,15 +115,14 @@
//$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!";
View
2  course/social.php
@@ -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\">";
View
2  course/weeks.php
@@ -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\">";

0 comments on commit 5e69314

Please sign in to comment.
Something went wrong with that request. Please try again.