new resort function for courses in a category

This commit is contained in:
moodler 2003-08-11 05:24:48 +00:00
parent 241ae0d52b
commit 49d3bab8aa
2 changed files with 16 additions and 3 deletions

View file

@ -38,13 +38,19 @@
/// Rename the category if requested
if (!empty($rename)) {
if (!empty($_GET['rename'])) {
$category->name = $rename;
if (! set_field("course_categories", "name", $category->name, "id", $category->id)) {
notify("An error occurred while renaming the category");
}
}
/// Resort the category if requested
if (!empty($_GET['resort'])) {
fix_course_sortorder($category->id, "fullname ASC");
}
/// Print headings
@ -302,9 +308,15 @@
if ($adminediting) {
echo "<center>";
/// Print link to create a new course
/// Print button to re-sort courses by name
unset($options);
$option["category"] = $category->id;
$options["id"] = $category->id;
$options["resort"] = "name";
print_single_button("category.php", $options, get_string("resortcoursesbyname"), "get");
/// Print button to create a new course
unset($options);
$options["category"] = $category->id;
print_single_button("edit.php", $options, get_string("addnewcourse"), "get");
echo "<br />";

View file

@ -614,6 +614,7 @@ $string['removeteacher'] = "Remove teacher";
$string['rename'] = "Rename";
$string['renamefileto'] = "Rename <b>\$a</b> to";
$string['required'] = "Required";
$string['resortcoursesbyname'] = "Resort courses by name";
$string['resources'] = "Resources";
$string['restore'] = "Restore";
$string['restorecancelled'] = "Restore cancelled";