diff --git a/admin/config.php b/admin/config.php
index 05197f75bcc..d84f911fb7a 100644
--- a/admin/config.php
+++ b/admin/config.php
@@ -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 "
";
}
diff --git a/admin/index.php b/admin/index.php
index 7fd01bdc45f..4eeb9585313 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -359,11 +359,8 @@
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$table->data[0][0] .= "
dbtype/frame.php\">".get_string("managedatabase")."
"; } - $table->data[0][1] = "".get_string("addnewcourse")."
". - "".get_string("assignteachers")."
". - "".get_string("deletecourse")."
". - ""; - $table->data[0][1] .= "".get_string("coursebackup")."
"; + $table->data[0][1] = "".get_string("coursemanagement")."
". + "".get_string("addnewcourse")."
"; $table->data[0][1] .= "id\">".get_string("courserestore")."
"; if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") { $table->data[0][2] = ""; diff --git a/admin/site.html b/admin/site.html index a013c479153..2c4dadcc305 100644 --- a/admin/site.html +++ b/admin/site.html @@ -54,28 +54,28 @@:
:
:
:
:
:
:
:
$teacher->firstname $teacher->lastname, $teacher->email id&remove=$teacher->id\" title=\"$strremoveteacher\">
$teacher->firstname $teacher->lastname, $teacher->email ";
+ print_user_picture($teacher->id, $site->id, $teacher->picture, false, false, false);
+ echo " id&remove=$teacher->id\" title=\"$strremoveteacher\">
id&add=$user->id\"".
"title=\"$straddteacher\">
$user->firstname $user->lastname, $user->email";
+ "border=0> ";
+ print_user_picture($user->id, $site->id, $user->picture, false, false, false);
+ echo " $user->firstname $user->lastname, $user->email";
}
}
diff --git a/course/categories.php b/course/categories.php
deleted file mode 100644
index 668466dc8bd..00000000000
--- a/course/categories.php
+++ /dev/null
@@ -1,318 +0,0 @@
-shortname: $strcategories", "$site->fullname",
- "admin/index.php\">$stradministration -> $strcategories",
- "addform.addcategory");
-
-
-/// If data for a new category was submitted, then add it
- if ($form = data_submitted()) {
- if (!empty($form->addcategory)) {
- unset($newcategory);
- $newcategory->name = $form->addcategory;
- $newcategory->sortorder = 999;
- if (!insert_record("course_categories", $newcategory)) {
- notify("Could not insert the new category '$newcategory->name'");
- } else {
- notify(get_string("categoryadded", "", $newcategory->name));
- }
- }
- }
-
-
-/// Delete a category if necessary
-
- if (isset($delete)) {
- if ($tempcat = get_record("course_categories", "id", $delete)) {
- if (delete_records("course_categories", "id", $tempcat->id)) {
- notify(get_string("categorydeleted", "", $tempcat->name));
- }
- if ($children = get_records("course_categories", "parent", $tempcat->id)) {
- foreach ($children as $childcat) {
- if (! set_field("course_categories", "parent", $tempcat->parent, "id", $childcat->id)) {
- notify("Could not update a child category!");
- }
- }
- }
- }
- }
-
-
-/// Create a default category if necessary
- if (!$categories = get_categories()) { /// No category yet!
- // Try and make one
- unset($tempcat);
- $tempcat->name = get_string("miscellaneous");
- if (!$tempcat->id = insert_record("course_categories", $tempcat)) {
- error("Serious error: Could not create a default category!");
- }
- }
-
-
-/// Move a category to a new parent if required
-
- if (isset($move) and isset($moveto)) {
- if ($tempcat = get_record("course_categories", "id", $move)) {
- if ($tempcat->parent != $moveto) {
- if (! set_field("course_categories", "parent", $moveto, "id", $tempcat->id)) {
- notify("Could not update that category!");
- }
- }
- }
- }
-
-
-/// Hide or show a category
- if (isset($hide) or isset($show)) {
- if (isset($hide)) {
- $tempcat = get_record("course_categories", "id", $hide);
- $visible = 0;
- } else {
- $tempcat = get_record("course_categories", "id", $show);
- $visible = 1;
- }
- if ($tempcat) {
- if (! set_field("course_categories", "visible", $visible, "id", $tempcat->id)) {
- notify("Could not update that category!");
- }
- if (! set_field("course", "visible", $visible, "category", $tempcat->id)) {
- notify("Could not hide/show any courses in this category !");
- }
- }
- }
-
-
-/// Move a category up or down
-
- if (isset($moveup) or isset($movedown)) {
-
- $swapcategory = NULL;
- $movecategory = NULL;
-
- if (isset($moveup)) {
- if ($movecategory = get_record("course_categories", "id", $moveup)) {
- $categories = get_categories("$movecategory->parent");
-
- foreach ($categories as $category) {
- if ($category->id == $movecategory->id) {
- break;
- }
- $swapcategory = $category;
- }
- }
- }
- if (isset($movedown)) {
- if ($movecategory = get_record("course_categories", "id", $movedown)) {
- $categories = get_categories("$movecategory->parent");
-
- $choosenext = false;
- foreach ($categories as $category) {
- if ($choosenext) {
- $swapcategory = $category;
- break;
- }
- if ($category->id == $movecategory->id) {
- $choosenext = true;
- }
- }
- }
- }
- if ($swapcategory and $movecategory) { // Renumber everything for robustness
- $count=0;
- foreach ($categories as $category) {
- $count++;
- if ($category->id == $swapcategory->id) {
- $category = $movecategory;
- } else if ($category->id == $movecategory->id) {
- $category = $swapcategory;
- }
- if (! set_field("course_categories", "sortorder", $count, "id", $category->id)) {
- notify("Could not update that category!");
- }
- }
- }
- }
-
-/// Find the default category (the one with the lowest ID)
- $categories = get_categories();
- $default = 99999;
- foreach ($categories as $category) {
- fix_category_courses($category->id);
- 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_courses()) {
- foreach ($courses as $course) {
- if (!isset( $categories[$course->category] )) {
- set_field("course", "category", $default, "id", $course->id);
- }
- }
- }
-
-/// Print form for creating new categories
-
- print_simple_box_start("center");
- echo "
| $strcategories | "; - echo "$stredit | "; - echo "$strmovecategoryto | "; - - print_category_edit(NULL, $displaylist, $parentlist); - - echo "
|---|
"; - for ($i=0; $i<$depth;$i++) { - echo " "; - } - $linkcss = $category->visible ? "" : " class=\"dimmed\" "; - echo "edit\" href=\"category.php?id=$category->id\">$category->name"; - echo "
"; - echo "| $strcourses | "; - echo "$stredit | "; - echo "$strmovecourseto | $stredit | "; + if ($adminediting) { + echo "$strmovecourseto | "; + } + } + echo ""; + $numcourses = count($courses); $count = 0; @@ -168,53 +227,66 @@ $linkcss = $course->visible ? "" : " class=\"dimmed\" "; echo "
|---|---|---|---|---|
| id\">$course->fullname | "; - echo "";
- if (!empty($course->visible)) {
- echo "id&hide=$course->id\"> | ";
+ echo "wwwroot/$CFG->admin/teacher.php?id=$course->id\"> | ";
+ echo ""; + popup_form ("category.php?id=$category->id&move=$course->id&moveto=", $displaylist, + "moveform$course->id", "$course->category", "", "", "", false); + echo " | "; } - - if ($down) { - echo "id&movedown=$course->id\">"; - popup_form ("category.php?id=$category->id&move=$course->id&moveto=", $displaylist, - "moveform$course->id", "$course->category", "", "", "", false); - echo " | "; echo "