From 97898ac9c2e4f0641e8f82d04183b862eefa3e1a Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 3 Aug 2002 11:58:40 +0000 Subject: [PATCH] Customisable section 0 on social forum --- course/social.php | 21 ++++++++------------- course/view.php | 1 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/course/social.php b/course/social.php index 590eb9c3d6..c2c92211b8 100644 --- a/course/social.php +++ b/course/social.php @@ -23,21 +23,16 @@ print_side_block("", $moddata, "", $modicon); - // Then, print all the available readings - + // Then, print all the available resources (Section 0) print_simple_box("Resources", $align="CENTER", $width="100%", $color="$THEME->cellheading"); + print_section($site->id, $sections[0], $mods, $modnamesused, true); - if ($readings = reading_list_all_readings($course->id, "timemodified DESC", 0, true)) { - foreach ($readings as $reading) { - $readingdata[] = $reading; - $readingicon[] = "\"Reading\""; - } - } - if (isediting($course->id)) { - $readingdata[] = "id§ion=0&add=reading\">Add reading..."; - $readingicon[] = " "; - } - print_side_block("", $readingdata, "", $readingicon); + if (isediting($site->id)) { + echo "
"; + popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=0&add=", + $modnames, "section0", "", "Add..."); + echo "
"; + } // Print all the recent activity print_simple_box("Recent Activity", $align="CENTER", $width="100%", $color="$THEME->cellheading"); diff --git a/course/view.php b/course/view.php index 724da490da..6cbe7bf6bd 100644 --- a/course/view.php +++ b/course/view.php @@ -49,6 +49,7 @@ update_course_icon($course->id)); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts); + $sections = get_all_sections($course->id); switch ($course->format) { case "weeks": -- 2.39.5