Permalink
Browse files

Changes related to language strings and clean up

  • Loading branch information...
1 parent 238a826 commit f781b794255474652f7f02a5d41a5b4640d3f659 martin committed Aug 2, 2002
Showing with 39 additions and 31 deletions.
  1. +1 −1 mod/forum/discuss.php
  2. +37 −29 mod/forum/index.php
  3. +1 −1 mod/forum/lib.php
@@ -49,7 +49,7 @@
$navtail = "<A HREF=\"discuss.php?d=$discussion->id\">$discussion->name</A> -> $post->subject";
}
- $navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">Forums</A> -> <A HREF=\"../forum/view.php?f=$forum->id\">$forum->name</A>";
+ $navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">".get_string("forums", "forum")."</A> -> <A HREF=\"../forum/view.php?f=$forum->id\">$forum->name</A>";
if ($cm->id) {
$updatebutton = update_module_icon($cm->id, $course->id);
View
@@ -10,7 +10,7 @@
error("Course ID is incorrect");
}
} else {
- if (! $course = get_record("course", "category", 0)) {
+ if (! $course = get_site()) {
error("Could not find a top-level course!");
}
}
@@ -21,23 +21,30 @@
unset($SESSION->fromdiscussion);
- add_to_log($course->id, "forum", "view forums", "index.php?id=$course->id", "");
+ add_to_log($course->id, "forum", "view forums", "index.php?id=$course->id");
+
+ $strforums = get_string("forums", "forum");
if ($course->category) {
- print_header("$course->shortname: Forums", "$course->fullname",
- "<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> -> Forums", "");
+ print_header("$course->shortname: $strforums", "$course->fullname",
+ "<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> -> $strforums");
} else {
- print_header("$course->shortname: Forums", "$course->fullname", "Forums", "");
+ print_header("$course->shortname: $strforums", "$course->fullname", "$strforums");
}
+ $strforum = get_string("forum", "forum");
+ $strdescription = get_string("description", "forum");
+ $strdiscussions = get_string("discussions", "forum");
+ $strsubscribed = get_string("subscribed", "forum");
+
+ $table->head = array ($strforum, $strdescription, $strdiscussions);
+ $table->align = array ("LEFT", "LEFT", "CENTER");
+
+ $can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin());
- $can_subscribe = (isstudent($course->id) || isteacher($course->id) || isadmin());
if ($can_subscribe) {
- $table->head = array ("Forum", "Description", "Topics", "Subscribed");
- } else {
- $table->head = array ("Forum", "Description", "Topics");
+ $table->head[] = $strsubscribed;
+ $table->align[] = "CENTER";
}
- $table->align = array ("LEFT", "LEFT", "CENTER", "CENTER");
-
if ($forums = get_records("forum", "course", $id, "name ASC")) {
foreach ($forums as $forum) {
@@ -61,14 +68,16 @@
if ($can_subscribe) {
if (forum_is_forcesubscribed($forum->id)) {
- $sublink = "YES";
+ $sublink = get_string("yes");
} else {
if (forum_is_subscribed($USER->id, $forum->id)) {
- $subscribed = "YES";
+ $subscribed = get_string("yes");
+ $subtitle = get_string("unsubscribe", "forum");
} else {
- $subscribed = "NO";
+ $subscribed = get_string("no");
+ $subtitle = get_string("subscribe", "forum");
}
- $sublink = "<A TITLE=\"Change your subscription\" HREF=\"subscribe.php?id=$forum->id\">$subscribed</A>";
+ $sublink = "<A TITLE=\"$subtitle\" HREF=\"subscribe.php?id=$forum->id\">$subscribed</A>";
}
$table->data[] = array ("<A HREF=\"view.php?f=$forum->id\">$forum->name</A>",
"$forum->intro", "$count", "$sublink");
@@ -77,34 +86,33 @@
"$forum->intro", "$count");
}
}
- print_heading("General Forums");
+ print_heading(get_string("generalforums", "forum"));
print_table($table);
unset($table->data);
}
- if ($can_subscribe) {
- $table->head = array ("", "Forum", "Description", "Topics", "Subscribed");
- } else {
- $table->head = array ("", "Forum", "Description", "Topics");
- }
- $table->align = array ("CENTER", "LEFT", "LEFT", "CENTER", "CENTER");
+ // Add extra field for section number, at the front
+ array_unshift($table->head, "");
+ array_unshift($table->align, "CENTER");
- if ($moduleforums = get_all_instances_in_course("forum", $course->id)) {
- foreach ($moduleforums as $forum) {
+ if ($learningforums = get_all_instances_in_course("forum", $course->id)) {
+ foreach ($learningforums as $forum) {
$count = count_records("forum_discussions", "forum", "$forum->id");
$forum->intro = forum_shorten_post($forum->intro);
if ($can_subscribe) {
if (forum_is_forcesubscribed($forum->id)) {
- $sublink = "YES";
+ $sublink = get_string("yes");
} else {
if (forum_is_subscribed($USER->id, $forum->id)) {
- $subscribed = "YES";
+ $subscribed = get_string("yes");
+ $subtitle = get_string("unsubscribe", "forum");
} else {
- $subscribed = "NO";
+ $subscribed = get_string("no");
+ $subtitle = get_string("subscribe", "forum");
}
- $sublink = "<A TITLE=\"Change your subscription\" HREF=\"subscribe.php?id=$forum->id\">$subscribed</A>";
+ $sublink = "<A TITLE=\"$subtitle\" HREF=\"subscribe.php?id=$forum->id\">$subscribed</A>";
}
$table->data[] = array ("$forum->section", "<A HREF=\"view.php?f=$forum->id\">$forum->name</A>",
"$forum->intro", "$count", "$sublink");
@@ -113,7 +121,7 @@
"$forum->intro", "$count");
}
}
- print_heading("Course content");
+ print_heading(get_string("learningforums", "forum"));
print_table($table);
}
View
@@ -11,7 +11,7 @@
// These are course content forums that can be added to the course manually
$FORUM_TYPE = array ("general" => "General forum",
- "eachuser" => "Each $student posts one discussion",
+ "eachuser" => "Each person posts one discussion",
"single" => "A single simple discussion");
$FORUM_POST_RATINGS = array ("3" => "Shows a more connected approach",

0 comments on commit f781b79

Please sign in to comment.