From 2c0411e2ed23b9cd4a3c4dd3e3fb9c544c01eef8 Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 10 Aug 2002 13:42:12 +0000 Subject: [PATCH] Tweaks and tidy-ups for course home pages (weekly and topics) --- course/lib.php | 3 +- course/log.php | 10 ++++--- course/topics.php | 68 ++++++++++++++++++++++++------------------- course/weeks.php | 72 +++++++++++++++++++++++++++------------------- lang/en/moodle.php | 20 +++++++++++++ lib/moodlelib.php | 8 ++++-- 6 files changed, 113 insertions(+), 68 deletions(-) diff --git a/course/lib.php b/course/lib.php index 967d8d27db..18af8e799f 100644 --- a/course/lib.php +++ b/course/lib.php @@ -368,7 +368,8 @@ function print_recent_activity($course) { $heading = true; $content = true; } - echo "

$post->firstname $post->lastname:
"; + $date = userdate($post->modified, "%e %b, %H:%M"); + echo "

$date - $post->firstname $post->lastname
"; echo "\"wwwroot/mod/forum/$log->url\">"; if ($log->action == "add") { echo "$post->subject"; diff --git a/course/log.php b/course/log.php index d89f2c9f93..9a5904b003 100644 --- a/course/log.php +++ b/course/log.php @@ -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", "id\">$course->shortname -> - id\">Logs -> Logs for $userinfo, $dateinfo", ""); + id\">$strlogs -> $userinfo, $dateinfo", ""); print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")"); @@ -54,8 +56,8 @@ } else { - print_header("$course->shortname: Logs", "$course->fullname", - "id\">$course->shortname -> Logs", ""); + print_header("$course->shortname: $strlogs", "$course->fullname", + "id\">$course->shortname -> $strlogs", ""); print_heading("Choose which logs you want to look at"); diff --git a/course/topics.php b/course/topics.php index 0728aea501..476d9c8947 100644 --- a/course/topics.php +++ b/course/topics.php @@ -45,16 +45,16 @@ $blinker = " *"; - print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading"); - $moddata[]="id\">List of all people"; - $modicon[]="\"List"; - $editmyprofile = "id&course=$course->id\">Edit my profile"; + print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); + $moddata[]="id\">".get_string("listofallpeople").""; + $modicon[]="\"\""; + $editmyprofile = "id&course=$course->id\">".get_string("editmyprofile").""; if ($USER->description) { $moddata[]= $editmyprofile; } else { $moddata[]= $editmyprofile.$blinker; } - $modicon[]="\"Me\""; + $modicon[]="\"\""; print_side_block("", $moddata, "", $modicon); @@ -65,7 +65,7 @@ if ($modnamesused) { foreach ($modnamesused as $modname => $modfullname) { $moddata[] = "id\">".$modnamesplural[$modname].""; - $modicon[] = "\"$modfullname\""; + $modicon[] = "\"\""; } } print_simple_box("Activities", $align="CENTER", $width="100%", $color="$THEME->cellheading"); @@ -80,25 +80,27 @@ // Admin links and controls if (isteacher($course->id)) { - $adminicon[]="\"Edit\""; - if (isediting($course->id)) { - $admindata[]="id&edit=off\">Turn editing off"; - } else { - $admindata[]="id&edit=on\">Turn editing on"; - } + echo "
"; + $admindata[]="id\">".get_string("settings")."..."; + $adminicon[]="\"\""; + $admindata[]="id\">".get_string("logs")."..."; + $adminicon[]="\"\""; + $admindata[]="id\">".get_string("files")."..."; + $adminicon[]="\"\""; + if ($teacherforum = forum_get_course_forum($course->id, "teacher")) { - $admindata[]="id\">Teacher Forum..."; - $adminicon[]="\"Teacher"; + $admindata[]="id\">".get_string("teacherforum").""; + $adminicon[]="\"\""; } - $admindata[]="id\">Course settings..."; - $adminicon[]="\"Course"; - $admindata[]="id\">Logs..."; - $adminicon[]="\"Log\""; - $admindata[]="id\">Files..."; - $adminicon[]="\"Files\""; + $adminicon[]="\"\""; + if (isediting($course->id)) { + $admindata[]="id&edit=off\">".get_string("turneditingoff").""; + } else { + $admindata[]="id&edit=on\">".get_string("turneditingon").""; + } - 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); } @@ -106,7 +108,7 @@ // Start main column echo ""; - 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. @@ -114,6 +116,9 @@ $timenow = time(); $section = 1; + $streditsummary = get_string("editsummary"); + $stradd = get_string("add"); + echo ""; while ($section <= $course->numsections) { @@ -147,7 +152,7 @@ } if (isediting($course->id)) { - $thissection->summary .= " id>\"Edit

"; + $thissection->summary .= " id>\"$streditsummary\"

"; } echo text_to_html($thissection->summary); @@ -157,7 +162,7 @@ if (isediting($course->id)) { echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&add=", - $modnames, "section$section", "", "Add..."); + $modnames, "section$section", "", "$stradd..."); echo "
"; } @@ -165,12 +170,15 @@ echo ""; echo ""; @@ -181,12 +189,12 @@ echo "
"; echo ""; if (isset($USER->topic)) { - echo "id&topic=all\" TITLE=\"Show all topics\">

"; + $strshowalltopics = get_string("showalltopics"); + echo "id&topic=all\" TITLE=\"$strshowalltopics\">

"; } else { - echo "id&topic=$section\" TITLE=\"Show only topic $section\">

"; + $strshowonlytopic = get_string("showonlytopic", "", $section); + echo "id&topic=$section\" TITLE=\"$strshowonlytopic\">

"; } if (isediting($course->id) and $course->marker != $section) { - echo "id&marker=$section\" TITLE=\"Mark this topic as the current topic\">

"; + $strmarkthistopic = get_string("markthistopic"); + echo "id&marker=$section\" TITLE=\"$strmarkthistopic\">

"; } echo "
"; - echo ""; + echo ""; // 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 ""; forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false); @@ -196,7 +204,7 @@ echo "
"; // 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(); diff --git a/course/weeks.php b/course/weeks.php index fa3f6b7a73..532a9dce07 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -32,11 +32,16 @@ // Links to people - print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading"); - $moddata[]="id\">List of all people"; - $modicon[]="\"List"; - $moddata[]="id&course=$course->id\">Edit my profile"; - $modicon[]="\"Me\""; + print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); + $moddata[]="id\">".get_string("listofallpeople").""; + $modicon[]="\"\""; + $editmyprofile = "id&course=$course->id\">".get_string("editmyprofile").""; + if ($USER->description) { + $moddata[]= $editmyprofile; + } else { + $moddata[]= $editmyprofile.$blinker; + } + $modicon[]="\"\""; print_side_block("", $moddata, "", $modicon); @@ -47,10 +52,10 @@ if ($modnamesused) { foreach ($modnamesused as $modname => $modfullname) { $moddata[] = "id\">".$modnamesplural[$modname].""; - $modicon[] = "\"$modfullname\""; + $modicon[] = "\"\""; } } - 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,25 +67,27 @@ // Admin links and controls if (isteacher($course->id)) { - $adminicon[]="\"Edit\""; + echo "
"; + $admindata[]="id\">".get_string("settings")."..."; + $adminicon[]="\"\""; + $admindata[]="id\">".get_string("logs")."..."; + $adminicon[]="\"\""; + $admindata[]="id\">".get_string("files")."..."; + $adminicon[]="\"\""; + + if ($teacherforum = forum_get_course_forum($course->id, "teacher")) { + $admindata[]="id\">".get_string("teacherforum").""; + $adminicon[]="\"\""; + } + $adminicon[]="\"\""; if (isediting($course->id)) { - $admindata[]="id&edit=off\">Turn editing off"; + $admindata[]="id&edit=off\">".get_string("turneditingoff").""; } else { - $admindata[]="id&edit=on\">Turn editing on"; + $admindata[]="id&edit=on\">".get_string("turneditingon").""; } - if ($teacherforum = forum_get_course_forum($course->id, "teacher")) { - $admindata[]="id\">Teacher Forum..."; - $adminicon[]="\"Teacher"; - } - $admindata[]="id\">Course settings..."; - $adminicon[]="\"Course\""; - $admindata[]="id\">Logs..."; - $adminicon[]="\"Log\""; - $admindata[]="id\">Files..."; - $adminicon[]="\"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); } @@ -88,7 +95,7 @@ // Start main column echo ""; - 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 ""; while ($weekdate < $course->enddate) { @@ -137,7 +147,7 @@ } if (isediting($course->id)) { - $thisweek->summary .= " id\">\"Edit

"; + $thisweek->summary .= " id\">\"$streditsummary\"

"; } echo text_to_html($thisweek->summary); @@ -147,7 +157,7 @@ if (isediting($course->id)) { echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$week&add=", - $modnames, "section$week", "", "Add..."); + $modnames, "section$week", "", "$stradd..."); echo "
"; } @@ -155,9 +165,11 @@ echo ""; echo ""; @@ -169,12 +181,12 @@ echo "
"; echo ""; if (isset($USER->section)) { - echo "id&week=all\" TITLE=\"Show all weeks\">"; + $strshowallweeks = get_string("showallweeks"); + echo "id&week=all\" TITLE=\"$strshowallweeks\">"; } else { - echo "id&week=$week\" TITLE=\"Show only week $week\">"; + $strshowonlyweek = get_string("showonlyweek", "", $week); + echo "id&week=$week\" TITLE=\"$strshowonlyweek\">"; } echo "
"; - echo ""; + echo ""; // 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 ""; forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false); @@ -184,7 +196,7 @@ echo "
"; // 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(); diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 610a2ec97f..7ca1f72794 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1,7 +1,9 @@ "; $string[logout] = "Logout"; +$string[logs] = "Logs"; $string[mainmenu] = "Main menu"; +$string[markthistopic] = "Mark this topic as the current topic"; $string[maximumchars] = "Maximum of \$a characters"; $string[maximumgrade] = "Maximum grade"; $string[missingcategory] = "You need to choose a category"; @@ -202,6 +210,7 @@ $string[passwordsenttext] = "

Please check your email for your new password

The new password was automatically generated, so you might like to link>change it to something easier to remember."; +$string[people] = "People"; $string[personalprofile] = "Personal profile"; $string[phone] = "Phone"; $string[returningtosite] = "Returning to this web site?"; @@ -211,7 +220,13 @@ $string[section] = "Section"; $string[selectacountry] = "Select a country"; $string[senddetails] = "Send my details via email"; $string[serverlocaltime] = "Server's local time"; +$string[settings] = "Settings"; $string[shortname] = "Short name"; +$string[showalltopics] = "Show all topics"; +$string[showallweeks] = "Show all weeks"; +$string[showonlytopic] = "Show only topic \$a"; +$string[showonlyweek] = "Show only week \$a"; +$string[sinceyourlastlogin] = "Since your last login"; $string[site] = "Site"; $string[sites] = "Sites"; $string[sitelogs] = "Site logs"; @@ -223,12 +238,16 @@ $string[startsignup] = "Start now by creating a new account!"; $string[summary] = "Summary"; $string[summaryof] = "Summary of \$a"; $string[supplyinfo] = "Please supply some information about yourself"; +$string[teacherforum] = "Teacher forum"; $string[teacheronly] = "for the \$a only"; $string[textformat] = "Plain text format"; $string[timezone] = "Timezone"; $string[thanks] = "Thanks"; $string[todaylogs] = "Today's logs"; $string[topic] = "Topic"; +$string[topicoutline] = "Topic outline"; +$string[turneditingoff] = "Turn editing off"; +$string[turneditingon] = "Turn editing on"; $string[unenrol] = "Unenrol"; $string[unenrolme] = "Unenrol me from \$a"; $string[update] = "Update"; @@ -243,6 +262,7 @@ $string[userprofilefor] = "User profile for \$a"; $string[users] = "Users"; $string[webpage] = "Web page"; $string[week] = "Week"; +$string[weeklyoutline] = "Weekly outline"; $string[welcometocourse] = "Welcome to \$a"; $string[welcometocoursetext] = "Welcome to \$a->coursename! diff --git a/lib/moodlelib.php b/lib/moodlelib.php index e1e45c690c..37ecfa5f3c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -199,10 +199,12 @@ function update_course_icon($courseid) { if (isteacher($courseid)) { if ($USER->editing) { - return "wwwroot/course/view.php?id=$courseid&edit=off\" + return "wwwroot/course/view.php?id=$courseid&edit=off\" TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; } else { - return "wwwroot/course/view.php?id=$courseid&edit=on\" + return "wwwroot/course/view.php?id=$courseid&edit=on\" TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; } } @@ -212,7 +214,7 @@ function update_module_icon($moduleid, $courseid) { global $CFG; if (isteacher($courseid)) { - return "wwwroot/course/mod.php?update=$moduleid&return=true\" TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; + return "wwwroot/course/mod.php?update=$moduleid&return=true\" TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; } } -- 2.39.5