diff --git a/admin/index.php b/admin/index.php index 26116958052..36f0a0ac780 100644 --- a/admin/index.php +++ b/admin/index.php @@ -162,16 +162,17 @@ // At this point, the databases exist, and the user is an admin - print_header("$site->fullname: Administration Page","$site->fullname: Administration Page", "Admin"); + $stradministration = get_string("administration"); + print_header("$site->fullname: $stradministration","$site->fullname: $stradministration", "$stradministration"); $table->head = array ("Site Management", "Course Setup", "Other"); $table->align = array ("CENTER", "CENTER", "CENTER"); - $table->data[0][0] = "
". - ""; - $table->data[0][1] = "". - "". - ""; - $table->data[0][2] = ""; + $table->data[0][0] = "".get_string("sitesettings")."
". + "id\">".get_string("sitelogs")."
"; + $table->data[0][1] = "".get_string("addnewcourse")."
". + "".get_string("assignteachers")."
". + "".get_string("deletecourse")."
"; + $table->data[0][2] = ""; print_table($table); diff --git a/admin/site.html b/admin/site.html index 4cbe2323270..c0540d350b0 100644 --- a/admin/site.html +++ b/admin/site.html @@ -44,4 +44,5 @@ + diff --git a/admin/site.php b/admin/site.php index 946b1328351..39104d9a6c9 100644 --- a/admin/site.php +++ b/admin/site.php @@ -3,6 +3,7 @@ require("../config.php"); $course = get_site(); + $course->format = "social"; // override /// If data submitted, then process and store. @@ -49,7 +50,7 @@ $form = $course; } else { $form->category = 0; - $form->newsitems = 1; + $form->format = "social"; } print_header("Admin: Setting up site", "Administration: Setting up site", diff --git a/course/edit.php b/course/edit.php index 674bc674eb7..e9e9507be21 100644 --- a/course/edit.php +++ b/course/edit.php @@ -60,7 +60,7 @@ $section->id = insert_record("course_sections", $section); add_to_log($newid, "course", "new", "view.php?id=$newid", ""); - redirect("$CFG->wwwroot/admin/teacher.php?id=$newid", get_string("changessaved")); + redirect("teacher.php?id=$newid", get_string("changessaved")); } else { error("Serious Error! Could not create the new course!"); } diff --git a/course/lib.php b/course/lib.php index 3cb84d29f12..4c1866bc75a 100644 --- a/course/lib.php +++ b/course/lib.php @@ -174,12 +174,28 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") { } -function print_all_courses($cat=1) { +function print_all_courses($cat=1, $style="full", $maxcount=999) { + global $CFG; if ($courses = get_records("course", "category", $cat, "fullname ASC")) { - foreach ($courses as $course) { - print_course($course); - echo "wwwroot/course/\">".get_string("fulllistofcourses")."...";
+ print_side_block("", $moddata, "$fulllist", $modicon);
+
+ } else {
+ foreach ($courses as $course) {
+ print_course($course);
+ echo "
\n";
+ }
}
} else {
@@ -398,6 +414,7 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
$mods = NULL; // course modules indexed by id
$modnames = NULL; // all course module names
+ $modnamesplural= NULL; // all course module names (plural form)
$modnamesused = NULL; // course module names used
if ($allmods = get_records_sql("SELECT * FROM modules") ) {
@@ -414,7 +431,7 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
FROM modules m, course_modules cm
WHERE cm.course = '$courseid'
AND cm.deleted = '0'
- AND cm.module = m.id") ) {
+ AND cm.module = m.id ") ) {
foreach($rawmods as $mod) { // Index the mods
$mods[$mod->id] = $mod;
$mods[$mod->id]->modfullname = $modnames[$mod->modname];
@@ -432,6 +449,31 @@ function get_all_sections($courseid) {
ORDER BY section");
}
+function print_section($courseid, $section, $mods, $modnamesused, $absolute=false) {
+ global $CFG;
+
+
+ echo "
";
+ if ($section->sequence) {
+
+ $sectionmods = explode(",", $section->sequence);
+
+ foreach ($sectionmods as $modnumber) {
+ $mod = $mods[$modnumber];
+ $instancename = get_field("$mod->modname", "name", "id", "$mod->instance");
+ echo "wwwroot/mod/$mod->modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
+ echo " modfullname\"";
+ echo " HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename";
+ if (isediting($courseid)) {
+ echo make_editing_buttons($mod->id, $absolute);
+ }
+ echo "
\n";
+ }
+ }
+ echo "
-
-
-
";
+ ";
- if ($thissection->sequence) {
-
- $thissectionmods = explode(",", $thissection->sequence);
-
- foreach ($thissectionmods as $modnumber) {
- $mod = $mods[$modnumber];
- $instancename = get_field("$mod->modname", "name", "id", "$mod->instance");
- echo "modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
- echo " modfullname\"";
- echo " HREF=\"../mod/$mod->modname/view.php?id=$mod->id\">$instancename";
- if (isediting($course->id)) {
- echo make_editing_buttons($mod->id);
- }
- echo "
\n";
- }
- }
- echo "
";
- if ($thisweek->sequence) {
-
- $thisweekmods = explode(",", $thisweek->sequence);
-
- foreach ($thisweekmods as $modnumber) {
- $mod = $mods[$modnumber];
- $instancename = get_field("$mod->modname", "name", "id", "$mod->instance");
- echo "modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
- echo " modfullname\"";
- echo " HREF=\"../mod/$mod->modname/view.php?id=$mod->id\">$instancename";
- if (isediting($course->id)) {
- echo make_editing_buttons($mod->id);
- }
- echo "
\n";
- }
- }
- echo "
|
- $readings = reading_list_all_readings();
-
- if ($site->newsitems > 0 or $readings or isediting($site->id)) {
-
- print_simple_box(get_string("mainmenu"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
+
+ $sections = get_all_sections($site->id);
+
+ if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) {
+
if ($site->newsitems > 0 ) {
- echo " "; + echo " ";
+ popup_form("$CFG->wwwroot/course/mod.php?id=$site->id§ion=0&add=",
+ $modnames, "section0", "", "Add...");
+ echo " ";
}
}
-
if (isadmin()) {
- print_simple_box(get_string("admin"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
- echo "";
diff --git a/mod/forum/search.php b/mod/forum/search.php
index 9fb571d4cee..9773bebac86 100644
--- a/mod/forum/search.php
+++ b/mod/forum/search.php
@@ -12,7 +12,9 @@
error("Course id is incorrect.");
}
- require_login($course->id);
+ if ($course->category) {
+ require_login($course->id);
+ }
add_to_log($course->id, "forum", "search", "search.php?id=$course->id&search=$search", "$search");
diff --git a/mod/forum/view.php b/mod/forum/view.php
index 1b5462ea98c..2e1553e21b0 100644
--- a/mod/forum/view.php
+++ b/mod/forum/view.php
@@ -22,7 +22,7 @@
} else if ($f) {
if (! $forum = get_record("forum", "id", $f)) {
- error("Forum ID was incorrect");
+ error("Forum ID was incorrect or no longer exists");
}
if (! $course = get_record("course", "id", $forum->course)) {
error("Forum is misconfigured - don't know what course it's from");
diff --git a/mod/journal/index.php b/mod/journal/index.php
index 41517f72ca0..0004c21e80c 100644
--- a/mod/journal/index.php
+++ b/mod/journal/index.php
@@ -12,8 +12,11 @@
require_login($course->id);
add_to_log($course->id, "journal", "view all", "index.php?id=$course->id", "");
- print_header("$course->shortname: Journals", "$course->fullname",
- "id>$course->shortname -> Journals", "");
+ if ($course->category) {
+ $navigation = "id\">$course->shortname ->";
+ }
+
+ print_header("$course->shortname: Journals", "$course->fullname", "$navigation Journals", "");
if (! $journals = get_all_instances_in_course("journal", $course->id, "cw.section ASC")) {
diff --git a/mod/journal/view.php b/mod/journal/view.php
index 2fa243371a8..dfee3a28c08 100644
--- a/mod/journal/view.php
+++ b/mod/journal/view.php
@@ -25,9 +25,11 @@
error("Course module is incorrect");
}
+ if ($course->category) {
+ $navigation = "id\">$course->shortname ->";
+ }
print_header("$course->shortname: $journal->name", "$course->fullname",
- "id>$course->shortname ->
- id>Journals -> $journal->name", "", "", true,
+ "$navigation id>Journals -> $journal->name", "", "", true,
update_module_icon($cm->id, $course->id));
if (isteacher($course->id)) {
diff --git a/mod/survey/index.php b/mod/survey/index.php
index 4232ac7e275..95d3323ef6e 100644
--- a/mod/survey/index.php
+++ b/mod/survey/index.php
@@ -13,8 +13,10 @@
add_to_log($course->id, "survey", "view all", "index.php?id=$course->id", "");
- print_header("$course->shortname: Surveys", "$course->fullname",
- "id>$course->shortname -> Surveys", "");
+ if ($course->category) {
+ $navigation = "id\">$course->shortname ->";
+ }
+ print_header("$course->shortname: Surveys", "$course->fullname", "$navigation Surveys", "");
if (! $surveys = get_all_instances_in_course("survey", $course->id, "cw.section ASC")) {
diff --git a/mod/survey/view.php b/mod/survey/view.php
index 53a75ebf09d..dd8903fafe1 100644
--- a/mod/survey/view.php
+++ b/mod/survey/view.php
@@ -18,10 +18,12 @@
if (! $survey = get_record("survey", "id", $cm->instance)) {
error("Survey ID was incorrect");
}
-
+
+ if ($course->category) {
+ $navigation = "id\">$course->shortname ->";
+ }
print_header("$course->shortname: $survey->name", "$course->fullname",
- "id>$course->shortname ->
- id>Surveys -> $survey->name", "", "", true,
+ "$navigation id>Surveys -> $survey->name", "", "", true,
update_module_icon($cm->id, $course->id));
if (isteacher($course->id)) {
diff --git a/pix/i/course.gif b/pix/i/course.gif
new file mode 100755
index 00000000000..c84041d803b
Binary files /dev/null and b/pix/i/course.gif differ
|