Skip to content
Browse files

Slight formatting tweaks (forum index)

  • Loading branch information...
1 parent 71fb963 commit 37b155148db88f403b1af9b5d9869c4fa675dad8 martin committed Jul 20, 2002
Showing with 41 additions and 35 deletions.
  1. +3 −0 course/topics.php
  2. +3 −0 course/weeks.php
  3. +3 −5 lib/moodlelib.php
  4. +1 −0 mod/choice/index.php
  5. +29 −30 mod/forum/index.php
  6. +1 −0 mod/journal/index.php
  7. +1 −0 mod/survey/index.php
View
3 course/topics.php
@@ -67,6 +67,9 @@
$modicon = array();
if ($modtype) {
foreach ($modtype as $modname => $modfullname) {
+ if ($modname == "discuss") {
+ continue; // Covered by forum
+ }
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modfullname."s</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$modfullname\">";
}
View
3 course/weeks.php
@@ -50,6 +50,9 @@
$modicon = array();
if ($modtype) {
foreach ($modtype as $modname => $modfullname) {
+ if ($modname == "discuss") {
+ continue; // Covered by forum
+ }
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modfullname."s</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$modfullname\">";
}
View
8 lib/moodlelib.php
@@ -131,7 +131,7 @@ function print_table($table) {
// $table->align is an array of column alignments
// $table->data[] is an array of arrays containing the data.
- if ( $table->align) {
+ if ($table->align) {
foreach ($table->align as $key => $aa) {
if ($aa) {
$align[$key] = "ALIGN=\"$aa\"";
@@ -141,10 +141,8 @@ function print_table($table) {
}
}
- echo "<BR>";
-
- print_simple_box_start("CENTER","","#FFFFFF",0);
- echo "<TABLE BORDER=0 valign=top align=center cellpadding=10 cellspacing=1>\n";
+ print_simple_box_start("CENTER", "80%", "#FFFFFF", 0);
+ echo "<TABLE WIDTH=100% BORDER=0 valign=top align=center cellpadding=10 cellspacing=1>\n";
if ($table->head) {
echo "<TR>";
View
1 mod/choice/index.php
@@ -66,6 +66,7 @@
"$aa");
}
}
+ echo "<BR>";
print_table($table);
print_footer($course);
View
59 mod/forum/index.php
@@ -32,25 +32,35 @@
$can_subscribe = (isstudent($course->id) || isteacher($course->id) || isadmin());
if ($can_subscribe) {
- $newtable->head = array ("Forum", "Description", "Topics", "Subscribed");
+ $table->head = array ("Forum", "Description", "Topics", "Subscribed");
} else {
- $newtable->head = array ("Forum", "Description", "Topics");
+ $table->head = array ("Forum", "Description", "Topics");
}
- $newtable->align = array ("LEFT", "LEFT", "CENTER", "CENTER");
+ $table->align = array ("LEFT", "LEFT", "CENTER", "CENTER");
if ($forums = get_records("forum", "course", $id, "name ASC")) {
- $table = $newtable;
foreach ($forums as $forum) {
- if ($forum->type == "teacher") {
- if (!isteacher($course->id)) {
- continue;
- }
+ switch ($forum->type) {
+ case "discussion":
+ case "general":
+ case "eachuser":
+ $contentforums[] = $forum;
+ break;
+ case "teacher":
+ if (isteacher($course->id)) {
+ $generalforums[] = $forum;
+ }
+ break;
+ default:
+ $generalforums[] = $forum;
+ break;
}
- if ($forum->type == "eachuser" or $forum->type == "discussion") {
- continue; // Display these later on.
- }
+ }
+ }
+ if ($generalforums) {
+ foreach ($generalforums as $forum) {
$count = count_records("discuss", "forum", "$forum->id");
if ($can_subscribe) {
@@ -69,22 +79,13 @@
"$count");
}
}
- if ($table) {
- print_heading("General Forums");
- print_table($table);
- $table = $newtable;
- }
-
- foreach ($forums as $forum) {
- if ($forum->type == "teacher") {
- if (!isteacher($course->id)) {
- continue;
- }
- }
- if ($forum->type != "eachuser" and $forum->type != "discussion") {
- continue;
- }
+ print_heading("General Forums");
+ print_table($table);
+ unset($table->data);
+ }
+ if ($contentforums) {
+ foreach ($contentforums as $forum) {
$count = count_records("discuss", "forum", "$forum->id");
if ($can_subscribe) {
@@ -103,10 +104,8 @@
"$count");
}
}
- if ($table) {
- print_heading("Forums about course content");
- print_table($table);
- }
+ print_heading("Course content");
+ print_table($table);
}
echo "<DIV ALIGN=CENTER>";
View
1 mod/journal/index.php
@@ -64,6 +64,7 @@
}
}
+ echo "<BR>";
print_table($table);
print_footer($course);
View
1 mod/survey/index.php
@@ -48,6 +48,7 @@
}
}
+ echo "<BR>";
print_table($table);
print_footer($course);

0 comments on commit 37b1551

Please sign in to comment.
Something went wrong with that request. Please try again.