diff --git a/CHANGES b/CHANGES index 016af2fe9ba..3ce57a23367 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,183 @@ +2002-09-09 Monday 00:13 martin + + * lib/weblib.php: + + Added height and width to smiley icons, to make emails look better + in circumstances where external images are blocked (eg some webmail + programs like squirrelmail). + +2002-09-09 Monday 00:04 martin + + * mod/forum/lib.php: + + Added an "unsubscribe" link to emails + +2002-09-08 Sunday 23:39 martin + + * mod/forum/lib.php: + + Fixed a bug. When replying to an email copy, you would be + forwarded to the login screen to login first. However, this was + being saved as the place to go back to after replying. + + I added a check for this so now it behaves as you'd expect. + +2002-09-08 Sunday 17:47 martin + + * mod/choice/mod.html: + + Text window a bit bigger + +2002-09-08 Sunday 17:42 martin + + * lang/en/choice.php, mod/choice/lib.php, mod/choice/mod.html, + mod/choice/report.php, mod/choice/version.php, + mod/choice/view.html, mod/choice/view.php: + + Choices now support up to 6 choices. Backward compatible to + 2-choice format. + +2002-09-08 Sunday 17:41 martin + + * course/: social.php, topics.php, weeks.php: + + Tip over 'Edit profile' is the user's name + +2002-09-08 Sunday 17:22 martin + + * lang/en/help/choice/options.html: + + Help for choices + +2002-09-08 Sunday 13:29 martin + + * course/: social.php, topics.php, weeks.php: + + Clarified the "participants" link ... + +2002-09-08 Sunday 13:23 martin + + * course/view.php: + + Link at bottom now goes to site home, not this page + +2002-09-08 Sunday 13:15 martin + + * course/teachers.php, lang/en/help/teachers.html: + + Added documentation to the teachers page. + +2002-09-08 Sunday 13:15 martin + + * lib/moodlelib.php: + + Improved print_table() a bit (can now specify column widths) + +2002-09-08 Sunday 11:34 martin + + * course/teachers.php: + + Need this file to go with the previous changes! + +2002-09-08 Sunday 11:34 martin + + * lang/en/moodle.php, user/index.php, user/lib.php: + + Changes to improve display of teachers + +2002-09-08 Sunday 11:24 martin + + * version.php, course/edit.html, course/edit.php, course/lib.php, + course/social.php, course/topics.php, course/weeks.php, + lang/en/moodle.php, lib/moodlelib.php, lib/db/mysql.sql, + user/index.php: + + Changes to allow much better control over what "teachers" are + called in a course. Firstly, the course settings page now allows + the teachers to specify the word they want to use in place of + "teachers" and "students" as well as "teacher" and "student". + Secondly, a new teacher admin tool allows any teacher to modify the + order and displayed role of teachers in that course. This affects + the display on the course listings, the participants page and so + on. + +2002-09-07 Saturday 22:57 martin + + * admin/lang.php, lang/en/moodle.php, lib/moodlelib.php: + + Improvements to the language checker. As well as checking for + missing strings, you can now see the current language compared + side-by-side with English. + +2002-09-07 Saturday 22:56 martin + + * admin/index.php: + + Add a link if a "manage database" directory exists + +2002-09-07 Saturday 13:01 martin + + * mod/newmodule_template.zip: + + Slight update to README + +2002-09-07 Saturday 11:54 martin + + * mod/newmodule_template.zip: + + Added a README that explains the process + +2002-09-07 Saturday 11:31 martin + + * mod/: README, newmodule_template.zip: + + Added a template for new modules that contains the bare + necessities. + +2002-09-06 Friday 23:17 martin + + * version.php: + + Checking in the current release number for CVS users + +2002-09-06 Friday 23:10 martin + + * user/view.php: + + Don't try and print the last access date if it doesn't exist + +2002-09-06 Friday 22:06 martin + + * version.php, admin/index.php, lib/moodlelib.php: + + Added a new $release variable that shows the user-friendly version + number + +2002-09-06 Friday 22:05 martin + + * lib/setup.php: + + Cleaned up a bit + +2002-09-06 Friday 01:31 martin + + * user/edit.php: + + Fixed bug in password checking for new admin user ... + +2002-09-05 Thursday 20:29 martin + + * UPGRADING.txt: + + Updated the info to mention that the upgrading only works if you + are logged in as the *administrator* and visit the site home page. + +2002-09-05 Thursday 20:25 martin + + * CHANGES: + + CHANGES UP TO 1.0.3.1 + 2002-09-05 Thursday 20:24 martin * version.php: diff --git a/admin/index.php b/admin/index.php index 8c5b0d9c6f1..ba1d561b4a9 100644 --- a/admin/index.php +++ b/admin/index.php @@ -207,7 +207,8 @@ } $table->data[0][1] = "
".get_string("addnewcourse")."
". "".get_string("assignteachers")."
". - "".get_string("deletecourse")."
"; + "".get_string("deletecourse")."
". + ""; $table->data[0][2] = "". ""; diff --git a/admin/site.php b/admin/site.php index 057565453d0..b0f774798c7 100644 --- a/admin/site.php +++ b/admin/site.php @@ -23,17 +23,17 @@ if ($form->id) { if (update_record("course", $form)) { - redirect("$CFG->wwwroot/admin/index.php", "Changes saved"); + redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved")); } else { error("Serious Error! Could not update the site record! (id = $form->id)"); } } else { if ($newid = insert_record("course", $form)) { - $cat->name = "General"; + $cat->name = get_string("miscellaneous"); if (insert_record("course_categories", $cat)) { - redirect("$CFG->wwwroot/admin/index.php", "Changes saved", "1"); + redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"), "1"); } else { - error("Serious Error! Could not set up the default categories!"); + error("Serious Error! Could not set up a default course category!"); } } else { error("Serious Error! Could not set up the site!"); diff --git a/course/categories.php b/course/categories.php new file mode 100644 index 00000000000..53018d14b28 --- /dev/null +++ b/course/categories.php @@ -0,0 +1,122 @@ +fullname: $strcategories", "$site->fullname", + "wwwroot/admin\">$stradministration -> $strcategories"); + + print_heading($strcategories); + +/// If data submitted, then process and store. + + if (match_referer() && isset($HTTP_POST_VARS)) { + + $categories = array(); + + // Peel out all the data from variable names. + foreach ($HTTP_POST_VARS as $key => $val) { + if ($key == "new" and $val != "") { + $cat->name = $val; + if (!insert_record("course_categories", $cat)) { + error("Could not insert the new category '$val'"); + } else { + notify(get_string("categoryadded", "", $val)); + } + + } else { + $cat->id = substr($key,1); + $cat->name = $val; + if (!update_record("course_categories", $cat)) { + error("Could not update the category '$val'"); + } + } + } + } + + +/// Get the existing categories + if (!$categories = get_all_categories()) { + // Try and make one + $cat->name = get_string("miscellaneous"); + if ($cat->id = insert_record("course_categories", $cat)) { + $categories[$cat->id] = $cat; + } else { + error("Serious error: Could not create a default category!"); + } + } + +/// Delete category if the user wants to delete it + if (isset($delete)) { + if (delete_records("course_categories", "id", $delete)) { + notify(get_string("categorydeleted", "", $categories[$delete]->name)); + unset($categories[$delete]); + } else { + error("An error occurred while trying to delete a category"); + } + } + +/// Find lowest ID category - this is the default category + $default = 99999; + foreach ($categories as $category) { + if ($category->id < $default) { + $default = $category->id; + } + } + +/// Find any orphan courses that don't yet have a valid category and set to default + if ($courses = get_records_sql("SELECT * FROM course WHERE category > 0")) { + foreach ($courses as $course) { + if (!isset( $categories[$course->category] )) { + set_field("course", "category", $default, "id", $course->id); + } + } + } + + +/// Print the table of all categories + $table->head = array ($strcategory, $strcourses, $strdelete); + $table->align = array ("LEFT", "CENTER", "CENTER"); + $table->size = array ("50", "20", "20"); + $table->width = 100; + + echo ""; + + print_footer(); + +?> diff --git a/course/index.php b/course/index.php index 5b3cdb3bd2c..76675a7c373 100644 --- a/course/index.php +++ b/course/index.php @@ -4,15 +4,41 @@ require("../config.php"); require("lib.php"); - $title = get_string("courses"); + optional_variable($category, 0); - print_header($title, $title, $title, ""); + $strcourses = get_string("courses"); - optional_variable($cat, 1); + if (!$categories = get_all_categories()) { + error("Could not find any course categories!"); + } - echo "";
+ if (isset($categories[$category])) {
+ $thiscatname = $categories[$category]->name;
+ $navigation = "$strcourses -> $thiscatname";
+ } else {
+ $navigation = $strcourses;
+ }
+ print_header($strcourses, $strcourses, $navigation);
- print_all_courses($cat);
+ $showcategories = (count($categories) > 1);
+ if ($showcategories) {
+ echo "
|