Slight formatting tweaks (forum index)
This commit is contained in:
@@ -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\">";
|
||||
}
|
||||
|
||||
@@ -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\">";
|
||||
}
|
||||
|
||||
+3
-5
@@ -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>";
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
"$aa");
|
||||
}
|
||||
}
|
||||
echo "<BR>";
|
||||
print_table($table);
|
||||
|
||||
print_footer($course);
|
||||
|
||||
+29
-30
@@ -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>";
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
echo "<BR>";
|
||||
print_table($table);
|
||||
|
||||
print_footer($course);
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
echo "<BR>";
|
||||
print_table($table);
|
||||
print_footer($course);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user