From: martin Date: Sat, 10 Aug 2002 14:27:14 +0000 (+0000) Subject: More tweaks to recent activity box X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4c654ee30b94619b44b98d365588de24ea0f8787;p=moodle.git More tweaks to recent activity box --- diff --git a/course/lib.php b/course/lib.php index e8d1eadbea..7f6bef218d 100644 --- a/course/lib.php +++ b/course/lib.php @@ -262,8 +262,15 @@ function print_recent_activity($course) { global $CFG, $USER, $COURSETEACHERCOLOR; if (! $USER->lastlogin ) { - echo "

Welcome to the course! Here you will find a list of what's new since your last login.

"; + echo "

"; + print_string("welcometocourse"); + echo "

"; return; + } else { + echo "

"; + echo get_string("yourlastlogin").":
"; + echo userdate($USER->lastlogin, "%A, %e %b %Y, %H:%M"); + echo "

"; } if (! $logs = get_records_sql("SELECT * FROM log WHERE time > '$USER->lastlogin' AND course = '$course->id' ORDER BY time ASC")) { @@ -278,7 +285,7 @@ function print_recent_activity($course) { foreach ($logs as $log) { if ($log->module == "course" and $log->action == "enrol") { if (! $heading) { - print_headline("New users:"); + print_headline(get_string("newusers").":"); $heading = true; $content = true; } @@ -297,18 +304,21 @@ function print_recent_activity($course) { switch ($log->action) { case "add mod": - $changelist["$log->info"] = array ("operation" => "add", "text" => "Added a ".$info[0].":
wwwroot/course/$log->url\">$modname"); + $stradded = get_string("addeda", "", get_string("modulename", $info[0])); + $changelist["$log->info"] = array ("operation" => "add", "text" => "$stradded:
wwwroot/course/$log->url\">$modname"); break; case "update mod": + $strupdated = get_string("updatedthe", "", get_string("modulename", $info[0])); if (! $changelist["$log->info"]) { - $changelist["$log->info"] = array ("operation" => "update", "text" => "Updated the ".$info[0].":
wwwroot/course/$log->url\">$modname"); + $changelist["$log->info"] = array ("operation" => "update", "text" => "$strupdated:
wwwroot/course/$log->url\">$modname"); } break; case "delete mod": if ($changelist["$log->info"]["operation"] == "add") { $changelist["$log->info"] = NULL; } else { - $changelist["$log->info"] = array ("operation" => "delete", "text" => "Deleted a ".$info[0]); + $strdeleted = get_string("deleteda", "", get_string("modulename", $info[0])); + $changelist["$log->info"] = array ("operation" => "delete", "text" => $strdeleted); } break; } @@ -323,7 +333,7 @@ function print_recent_activity($course) { } } if (count($changes) > 0) { - print_headline("Course changes:"); + print_headline(get_string("courseupdates").":"); $content = true; foreach ($changes as $changeinfo => $change) { echo "

".$change["text"]."

"; @@ -366,7 +376,7 @@ function print_recent_activity($course) { } } if (! $heading) { - print_headline("Discussion Posts:"); + print_headline(get_string("newforumposts").":"); $heading = true; $content = true; } diff --git a/course/topics.php b/course/topics.php index 476d9c8947..d4ccaa49be 100644 --- a/course/topics.php +++ b/course/topics.php @@ -204,7 +204,7 @@ echo "
"; // Print all the recent activity - print_simple_box(get_string("sinceyourlastlogin"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); + print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0); print_recent_activity($course); print_simple_box_end(); diff --git a/course/weeks.php b/course/weeks.php index 532a9dce07..fc2031d27f 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -196,7 +196,7 @@ echo "
"; // Print all the recent activity - print_simple_box(get_string("sinceyourlastlogin"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); + print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0); print_recent_activity($course); print_simple_box_end();