Permalink
Browse files

Another big checkin.

This includes some significant cleanups to the new course categories
system.  The basic idea is that the categories/course browser is now
unified under one system, and admin features related to that have
all been moved into the browser (as little icons).

I'm much happier with this as a foundation that can scale and be
built upon.

Still to go:

  - searching
  - paging
  - polishing

Also in here are a lot of little cleanups around the place, such as
the initial setup process.
  • Loading branch information...
moodler
moodler committed Aug 7, 2003
1 parent 7b2e275 commit d2b6ba704ebf74787d793b24cf78ace2699d7bf5
View
@@ -71,7 +71,7 @@
} else {
print_header();
print_heading($strconfigvariables);
print_simple_box(get_string("configintro"), "center");
print_simple_box(get_string("configintro"), "center", "50%");
echo "<br />";
}
View
@@ -359,11 +359,8 @@
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$table->data[0][0] .= "<p><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></p>";
}
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>".
"<p><a href=\"../course/delete.php\">".get_string("deletecourse")."</a></p>".
"<p><a href=\"../course/categories.php\">".get_string("categories")."</a></p>";
$table->data[0][1] .= "<p><a href=\"../backup/backup.php\">".get_string("coursebackup")."</a></p>";
$table->data[0][1] = "<p><a href=\"../course/index.php?edit=on\">".get_string("coursemanagement")."</a></p>".
"<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>";
$table->data[0][1] .= "<p><a href=\"../files/index.php?id=$site->id\">".get_string("courserestore")."</a></p>";
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
$table->data[0][2] = "<p><a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a></p>";
View
@@ -54,28 +54,28 @@
</td>
</tr>
<tr valign=top>
<td><p><?php print_string("wordforteacher") ?>:</td>
<td align=right><p><?php print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" maxlength="100" size=25 value="<?php p($form->teacher) ?>">
(<?php print_string("wordforteachereg") ?>)
<?php if (isset($err["teacher"])) formerr($err["teacher"]); ?>
</td>
</tr>
<tr valign=top>
<td><p><?php print_string("wordforteachers") ?>:</td>
<td align=right><p><?php print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" maxlength="100" size=25 value="<?php p($form->teachers) ?>">
(<?php print_string("wordforteacherseg") ?>)
<?php if (isset($err["teachers"])) formerr($err["teachers"]); ?>
</td>
</tr>
<tr valign=top>
<td><p><?php print_string("wordforstudent") ?>:</td>
<td align=right><p><?php print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" maxlength="100" size=25 value="<?php p($form->student) ?>">
(<?php print_string("wordforstudenteg") ?>)
<?php if (isset($err["student"])) formerr($err["student"]); ?>
</td>
</tr>
<tr valign=top>
<td><p><?php print_string("wordforstudents") ?>:</td>
<td align=right><p><?php print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" maxlength="100" size=25 value="<?php p($form->students) ?>">
(<?php print_string("wordforstudentseg") ?>)
<?php if (isset($err["students"])) formerr($err["students"]); ?>
View
@@ -31,7 +31,7 @@
if ($newid = insert_record("course", $form)) {
$cat->name = get_string("miscellaneous");
if (insert_record("course_categories", $cat)) {
redirect("$CFG->wwwroot/", get_string("changessaved"));
redirect("$CFG->wwwroot/$CFG->admin/index.php", get_string("changessaved"));
} else {
error("Serious Error! Could not set up a default course category!");
}
@@ -61,7 +61,10 @@
$form->id = "";
$form->category = 0;
$form->format = "social";
$form->newsitems = 0;
$form->teacher = get_string("defaultcourseteacher");
$form->teachers = get_string("defaultcourseteachers");
$form->student = get_string("defaultcoursestudent");
$form->students = get_string("defaultcoursestudents");
$firsttime = true;
}
@@ -87,7 +90,7 @@
if ($firsttime) {
print_header();
print_heading($strsitesettings);
print_simple_box(get_string("configintrosite"), "center");
print_simple_box(get_string("configintrosite"), "center", "50%");
echo "<br />";
} else {
print_header("$site->shortname: $strsitesettings", "$site->fullname",
@@ -115,9 +118,6 @@ function validate_form(&$form, &$err) {
if (empty($form->shortname))
$err["shortname"] = get_string("missingshortsitename");
if (empty($form->summary))
$err["summary"] = get_string("missingsitedescription");
return;
}
View
@@ -5,7 +5,7 @@
define("MAX_USERS_PER_PAGE", 30);
optional_variable($id); // course id
require_variable($id); // course id
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, ""); // search string
@@ -21,6 +21,7 @@
}
$strassignteachers = get_string("assignteachers");
$strcourses = get_string("courses");
$stradministration = get_string("administration");
$strexistingteachers = get_string("existingteachers");
$strnoexistingteachers = get_string("noexistingteachers");
@@ -40,45 +41,16 @@
}
if (!$id) {
print_header("$site->shortname: $strassignteachers", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strassignteachers");
$isadmin = isadmin(); /// cache value
$courses = get_courses();
print_heading(get_string("choosecourse"));
print_simple_box_start("center");
if (!empty($courses)) {
foreach ($courses as $course) {
if ($isadmin or isteacher($course->id, $USER->id)){
echo "<a href=\"teacher.php?id=$course->id\">$course->fullname ($course->shortname)</a><br>\n";
$coursesfound = TRUE;
}
}
}
print_simple_box_end();
if ($coursesfound == FALSE) {
print_heading(get_string("nocoursesyet"));
print_continue("../$CFG->admin/index.php");
}
print_footer();
exit;
}
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
print_header("$site->shortname: $course->shortname: $strassignteachers",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"teacher.php\">$strassignteachers</a> -> $course->shortname", "");
"<a href=\"../course/index.php\">$strcourses</a> -> ".
"<a href=\"../course/view.php?id=$course->id\">$course->fullname</a> -> ".
"$strassignteachers", "");
print_heading("<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname ($course->shortname)</a>");
@@ -156,7 +128,9 @@
$teacherarray = array();
foreach ($teachers as $teacher) {
$teacherarray[] = $teacher->id;
echo "<p align=right>$teacher->firstname $teacher->lastname, $teacher->email &nbsp;&nbsp; <a href=\"teacher.php?id=$course->id&remove=$teacher->id\" title=\"$strremoveteacher\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
echo "<p align=right>$teacher->firstname $teacher->lastname, $teacher->email &nbsp;";
print_user_picture($teacher->id, $site->id, $teacher->picture, false, false, false);
echo "&nbsp;&nbsp;<a href=\"teacher.php?id=$course->id&remove=$teacher->id\" title=\"$strremoveteacher\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
}
$teacherlist = implode(",",$teacherarray);
unset($teacherarray);
@@ -187,7 +161,9 @@
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?id=$course->id&add=$user->id\"".
"title=\"$straddteacher\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
"border=0></a>&nbsp;&nbsp;";
print_user_picture($user->id, $site->id, $user->picture, false, false, false);
echo "&nbsp;$user->firstname $user->lastname, $user->email";
}
}
Oops, something went wrong.

0 comments on commit d2b6ba7

Please sign in to comment.