mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
new resort function for courses in a category
This commit is contained in:
parent
241ae0d52b
commit
49d3bab8aa
2 changed files with 16 additions and 3 deletions
|
@ -38,13 +38,19 @@
|
||||||
|
|
||||||
/// Rename the category if requested
|
/// Rename the category if requested
|
||||||
|
|
||||||
if (!empty($rename)) {
|
if (!empty($_GET['rename'])) {
|
||||||
$category->name = $rename;
|
$category->name = $rename;
|
||||||
if (! set_field("course_categories", "name", $category->name, "id", $category->id)) {
|
if (! set_field("course_categories", "name", $category->name, "id", $category->id)) {
|
||||||
notify("An error occurred while renaming the category");
|
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
|
/// Print headings
|
||||||
|
|
||||||
|
@ -302,9 +308,15 @@
|
||||||
if ($adminediting) {
|
if ($adminediting) {
|
||||||
echo "<center>";
|
echo "<center>";
|
||||||
|
|
||||||
/// Print link to create a new course
|
/// Print button to re-sort courses by name
|
||||||
unset($options);
|
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");
|
print_single_button("edit.php", $options, get_string("addnewcourse"), "get");
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
|
|
||||||
|
|
|
@ -614,6 +614,7 @@ $string['removeteacher'] = "Remove teacher";
|
||||||
$string['rename'] = "Rename";
|
$string['rename'] = "Rename";
|
||||||
$string['renamefileto'] = "Rename <b>\$a</b> to";
|
$string['renamefileto'] = "Rename <b>\$a</b> to";
|
||||||
$string['required'] = "Required";
|
$string['required'] = "Required";
|
||||||
|
$string['resortcoursesbyname'] = "Resort courses by name";
|
||||||
$string['resources'] = "Resources";
|
$string['resources'] = "Resources";
|
||||||
$string['restore'] = "Restore";
|
$string['restore'] = "Restore";
|
||||||
$string['restorecancelled'] = "Restore cancelled";
|
$string['restorecancelled'] = "Restore cancelled";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue