Permalink
Browse files

Tweaks and tidy-ups for course home pages (weekly and topics)

  • Loading branch information...
1 parent b0ccbd9 commit 2c0411e2ed23b9cd4a3c4dd3e3fb9c544c01eef8 martin committed Aug 10, 2002
Showing with 113 additions and 68 deletions.
  1. +2 −1 course/lib.php
  2. +6 −4 course/log.php
  3. +38 −30 course/topics.php
  4. +42 −30 course/weeks.php
  5. +20 −0 lang/en/moodle.php
  6. +5 −3 lib/moodlelib.php
View
@@ -368,7 +368,8 @@ function print_recent_activity($course) {
$heading = true;
$content = true;
}
- echo "<P><FONT SIZE=1 $teacherpost>$post->firstname $post->lastname:<BR>";
+ $date = userdate($post->modified, "%e %b, %H:%M");
+ echo "<P><FONT SIZE=1 $teacherpost>$date - $post->firstname $post->lastname<BR>";
echo "\"<A HREF=\"$CFG->wwwroot/mod/forum/$log->url\">";
if ($log->action == "add") {
echo "<B>$post->subject</B>";
View
@@ -26,6 +26,8 @@
$user = "";
}
+ $strlogs = get_string("logs");
+
if ($user || $date) {
@@ -42,9 +44,9 @@
$dateinfo = userdate($date, "%A, %e %B %Y");
}
- print_header("$course->shortname: Logs", "$course->fullname",
+ print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> ->
- <A HREF=\"log.php?id=$course->id\">Logs</A> -> Logs for $userinfo, $dateinfo", "");
+ <A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
@@ -54,8 +56,8 @@
} else {
- print_header("$course->shortname: Logs", "$course->fullname",
- "<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> Logs", "");
+ print_header("$course->shortname: $strlogs", "$course->fullname",
+ "<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
print_heading("Choose which logs you want to look at");
View
@@ -45,16 +45,16 @@
$blinker = " <BLINK>*</BLINK>";
- print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
- $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">List of all people</A>";
- $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">";
- $editmyprofile = "<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>";
+ print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">".get_string("listofallpeople")."</A>";
+ $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ $editmyprofile = "<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile.$blinker;
}
- $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";
+ $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
print_side_block("", $moddata, "", $modicon);
@@ -65,7 +65,7 @@
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
- $modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$modfullname\">";
+ $modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
}
}
print_simple_box("Activities", $align="CENTER", $width="100%", $color="$THEME->cellheading");
@@ -80,40 +80,45 @@
// Admin links and controls
if (isteacher($course->id)) {
- $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"Edit\">";
- if (isediting($course->id)) {
- $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">Turn editing off</A>";
- } else {
- $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">Turn editing on</A>";
- }
+ echo "<BR>";
+ $admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
+ $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ $admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
+ $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">".get_string("files")."...</A>";
+ $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+
if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
- $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">Teacher Forum...</A>";
- $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"Teacher Forum\">";
+ $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
+ $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
}
- $admindata[]="<A HREF=\"edit.php?id=$course->id\">Course settings...</A>";
- $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"Course settings\">";
- $admindata[]="<A HREF=\"log.php?id=$course->id\">Logs...</A>";
- $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"Log\">";
- $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">Files...</A>";
- $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"Files\">";
+ $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ if (isediting($course->id)) {
+ $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
+ } else {
+ $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
+ }
- print_simple_box("Administration", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("administration"),"CENTER", "100%", $THEME->cellheading);
print_side_block("", $admindata, "", $adminicon);
}
// Start main column
echo "</TD><TD WIDTH=\"*\">";
- print_simple_box("Topic Outline", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("topicoutline"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
// Everything below uses "section" terminology - each "section" is a topic.
// Now all the sectionly modules
$timenow = time();
$section = 1;
+ $streditsummary = get_string("editsummary");
+ $stradd = get_string("add");
+
echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
while ($section <= $course->numsections) {
@@ -147,7 +152,7 @@
}
if (isediting($course->id)) {
- $thissection->summary .= "&nbsp;<A HREF=editsection.php?id=$thissection->id><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"Edit summary\"></A></P>";
+ $thissection->summary .= "&nbsp;<A HREF=editsection.php?id=$thissection->id><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
}
echo text_to_html($thissection->summary);
@@ -157,20 +162,23 @@
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
- $modnames, "section$section", "", "Add...");
+ $modnames, "section$section", "", "$stradd...");
echo "</DIV>";
}
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$highlightcolor\" VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
if (isset($USER->topic)) {
- echo "<A HREF=\"view.php?id=$course->id&topic=all\" TITLE=\"Show all topics\"><IMG SRC=../pix/i/all.gif BORDER=0></A><BR><BR>";
+ $strshowalltopics = get_string("showalltopics");
+ echo "<A HREF=\"view.php?id=$course->id&topic=all\" TITLE=\"$strshowalltopics\"><IMG SRC=../pix/i/all.gif BORDER=0></A><BR><BR>";
} else {
- echo "<A HREF=\"view.php?id=$course->id&topic=$section\" TITLE=\"Show only topic $section\"><IMG SRC=../pix/i/one.gif BORDER=0></A><BR><BR>";
+ $strshowonlytopic = get_string("showonlytopic", "", $section);
+ echo "<A HREF=\"view.php?id=$course->id&topic=$section\" TITLE=\"$strshowonlytopic\"><IMG SRC=../pix/i/one.gif BORDER=0></A><BR><BR>";
}
if (isediting($course->id) and $course->marker != $section) {
- echo "<A HREF=\"view.php?id=$course->id&marker=$section\" TITLE=\"Mark this topic as the current topic\"><IMG SRC=../pix/i/marker.gif BORDER=0></A><BR><BR>";
+ $strmarkthistopic = get_string("markthistopic");
+ echo "<A HREF=\"view.php?id=$course->id&marker=$section\" TITLE=\"$strmarkthistopic\"><IMG SRC=../pix/i/marker.gif BORDER=0></A><BR><BR>";
}
echo "</TD>";
echo "</TR>";
@@ -181,12 +189,12 @@
echo "</TABLE>";
- echo "</TD><TD WIDTH=180>";
+ echo "</TD><TD WIDTH=210>";
// Print all the news items.
if ($news = forum_get_course_forum($course->id, "news")) {
- print_simple_box("Latest News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
@@ -196,7 +204,7 @@
echo "<BR>";
// Print all the recent activity
- print_simple_box("Recent Activity", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("sinceyourlastlogin"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
View
@@ -32,11 +32,16 @@
// Links to people
- print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
- $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">List of all people</A>";
- $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">";
- $moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>";
- $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";
+ print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">".get_string("listofallpeople")."</A>";
+ $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ $editmyprofile = "<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
+ if ($USER->description) {
+ $moddata[]= $editmyprofile;
+ } else {
+ $moddata[]= $editmyprofile.$blinker;
+ }
+ $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
print_side_block("", $moddata, "", $modicon);
@@ -47,10 +52,10 @@
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
- $modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$modfullname\">";
+ $modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
}
}
- print_simple_box("Activities", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("activities"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $moddata, "", $modicon);
// Print a form to search forums
@@ -62,33 +67,35 @@
// Admin links and controls
if (isteacher($course->id)) {
- $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"Edit\">";
+ echo "<BR>";
+ $admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
+ $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ $admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
+ $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">".get_string("files")."...</A>";
+ $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+
+ if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
+ $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
+ $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ }
+ $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
if (isediting($course->id)) {
- $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">Turn editing off</A>";
+ $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
} else {
- $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">Turn editing on</A>";
+ $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
}
- if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
- $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">Teacher Forum...</A>";
- $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"Teacher Forum\">";
- }
- $admindata[]="<A HREF=\"edit.php?id=$course->id\">Course settings...</A>";
- $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"Course\">";
- $admindata[]="<A HREF=\"log.php?id=$course->id\">Logs...</A>";
- $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"Log\">";
- $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">Files...</A>";
- $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"Files\">";
-
- print_simple_box("Administration", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+
+ print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $admindata, "", $adminicon);
}
// Start main column
echo "</TD><TD WIDTH=\"*\">";
- print_simple_box("Weekly Outline", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("weeklyoutline"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
// Now all the weekly modules
$timenow = time();
@@ -97,6 +104,9 @@
$weekofseconds = 604800;
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
+ $streditsummary = get_string("editsummary");
+ $stradd = get_string("add");
+
echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
while ($weekdate < $course->enddate) {
@@ -137,7 +147,7 @@
}
if (isediting($course->id)) {
- $thisweek->summary .= "&nbsp;<A HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"Edit summary\"></A></P>";
+ $thisweek->summary .= "&nbsp;<A TITLE=\"$streditsummary\" HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
}
echo text_to_html($thisweek->summary);
@@ -147,17 +157,19 @@
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=",
- $modnames, "section$week", "", "Add...");
+ $modnames, "section$week", "", "$stradd...");
echo "</DIV>";
}
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$highlightcolor\" VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
if (isset($USER->section)) {
- echo "<A HREF=\"view.php?id=$course->id&week=all\" TITLE=\"Show all weeks\"><IMG SRC=../pix/i/all.gif BORDER=0></A></FONT>";
+ $strshowallweeks = get_string("showallweeks");
+ echo "<A HREF=\"view.php?id=$course->id&week=all\" TITLE=\"$strshowallweeks\"><IMG SRC=../pix/i/all.gif BORDER=0></A></FONT>";
} else {
- echo "<A HREF=\"view.php?id=$course->id&week=$week\" TITLE=\"Show only week $week\"><IMG SRC=../pix/i/one.gif BORDER=0></A></FONT>";
+ $strshowonlyweek = get_string("showonlyweek", "", $week);
+ echo "<A HREF=\"view.php?id=$course->id&week=$week\" TITLE=\"$strshowonlyweek\"><IMG SRC=../pix/i/one.gif BORDER=0></A></FONT>";
}
echo "</TD>";
echo "</TR>";
@@ -169,12 +181,12 @@
echo "</TABLE>";
- echo "</TD><TD WIDTH=180>";
+ echo "</TD><TD WIDTH=210>";
// Print all the news items.
if ($news = forum_get_course_forum($course->id, "news")) {
- print_simple_box("Latest News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
@@ -184,7 +196,7 @@
echo "<BR>";
// Print all the recent activity
- print_simple_box("Recent Activity", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box(get_string("sinceyourlastlogin"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
Oops, something went wrong.

0 comments on commit 2c0411e

Please sign in to comment.