From: martin Date: Sun, 11 Aug 2002 15:41:54 +0000 (+0000) Subject: Changes related to language support ... get_string() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=97c270e9a84ca8e181e7eef328aca4acedf2825b;p=moodle.git Changes related to language support ... get_string() Minor little interface cleanups along the way --- diff --git a/course/delete.php b/course/delete.php index 6eed9b9107..1df4f60d7d 100644 --- a/course/delete.php +++ b/course/delete.php @@ -1,4 +1,5 @@ shortname); - $strdeletecheckfull = get_string("deletecheckfull"); + $strdeletecoursecheck = get_string("deletecoursecheck"); print_header("$site->fullname : $strdeletecheck", $site->fullname, "wwwroot/admin\">$stradministration -> $strdeletecourse -> $strdeletecheck"); - notice_yesno("$strdeletecheckfull

$course->fullname", + notice_yesno("$strdeletecoursecheck

$course->fullname", "delete.php?id=$course->id&delete=".md5($course->timemodified), "delete.php"); exit; diff --git a/course/edit.html b/course/edit.html index 9ed0f07e58..4e053c6d03 100644 --- a/course/edit.html +++ b/course/edit.html @@ -35,7 +35,7 @@

: categories, "category", "$form->category"); + choose_from_menu ($form->categories, "category", "$form->category", ""); formerr($err["category"]); ?> @@ -43,7 +43,8 @@

: format"); + choose_from_menu ($form->courseformats, "format", "$form->format", ""); + helpbutton("courseformats", get_string("courseformats")); formerr($err["format"]); ?> @@ -65,24 +66,11 @@ "8" => "8 $newsitems", "9" => "9 $newsitems", "10" => "10 $newsitems"); - choose_from_menu ($options, "newsitems", "$form->newsitems"); + choose_from_menu ($options, "newsitems", "$form->newsitems", ""); formerr($err["newsitems"]); ?> - - -

: - - () - - - -

: - - () - -

: + +

: + + () + + + +

: + + () + + "> diff --git a/course/edit.php b/course/edit.php index e9b375899f..cea6196102 100644 --- a/course/edit.php +++ b/course/edit.php @@ -1,4 +1,5 @@ categories = get_records_sql_menu("SELECT id,name FROM course_categories"); + + $form->courseformats = array ( + "weeks" => get_string("formatweeks"), + "social" => get_string("formatsocial"), + "topics" => get_string("formattopics") + ); $streditcoursesettings = get_string("editcoursesettings"); $straddnewcourse = get_string("addnewcourse"); diff --git a/course/editsection.php b/course/editsection.php index 64437d7c9e..beae84dcb3 100644 --- a/course/editsection.php +++ b/course/editsection.php @@ -1,4 +1,5 @@ format]; + $sectionname = get_string("name$course->format"); $stredit = get_string("edit", "", " $sectionname $section->section"); print_header($stredit, $stredit, "", "form.summary"); diff --git a/course/enrol.php b/course/enrol.php index 1c74a3131d..d39136b24e 100644 --- a/course/enrol.php +++ b/course/enrol.php @@ -1,6 +1,5 @@ "Weekly layout", - "social" => "Social layout", - "topics" => "Topics layout" - ); -$COURSE_SECTION = array ( - "weeks" => "week", - "social" => "section", - "topics" => "topic" - ); +$COURSE_MAX_LOG_DISPLAY = 150; // days -$COURSE_MAX_LOG_DISPLAY = 150; // days +$COURSE_TEACHER_COLOR = "#990000"; // To hilight certain items that are teacher-only -$COURSETEACHERCOLOR = "#990000"; // To hilight certain items +$COURSE_LIVELOG_REFRESH = 60; // Seconds function print_log_selector_form($course, $selecteduser=0, $selecteddate="today") { @@ -66,7 +58,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today" $timemidnight = $today = usergetmidnight($timenow); // Put today up the top of the list - $dates = array("$timemidnight" => "Today, ".userdate($timenow, "%e %B %Y") ); + $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, "%e %B %Y") ); if (! $course->startdate) { $course->startdate = $course->timecreated; @@ -92,10 +84,10 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today" echo "id\">"; } if ($course->category) { - choose_from_menu ($users, "user", $selecteduser, "All participants"); + choose_from_menu ($users, "user", $selecteduser, get_string("allparticipants") ); } - choose_from_menu ($dates, "date", $selecteddate, "Any day"); - echo ""; + choose_from_menu ($dates, "date", $selecteddate, get_string("alldays")); + echo ""; echo ""; echo ""; } @@ -183,7 +175,7 @@ function print_all_courses($cat=1, $style="full", $maxcount=999) { if ($courses = get_records("course", "category", $cat, "fullname ASC")) { if ($style == "minimal") { $count = 0; - $icon = "\"Course\""; + $icon = "\"".get_string("course")."\""; foreach ($courses as $course) { $moddata[]="shortname\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname"; $modicon[]=$icon; @@ -233,11 +225,11 @@ function print_course($course) { echo "

"; } if ($course->guest or ($course->password == "")) { - echo "wwwroot/course/view.php?id=$course->id\">"; + echo "wwwroot/course/view.php?id=$course->id\">"; echo "\"\"wwwroot/user/user.gif\">  "; } if ($course->password) { - echo "wwwroot/course/view.php?id=$course->id\">"; + echo "wwwroot/course/view.php?id=$course->id\">"; echo "\"\"wwwroot/pix/i/key.gif\">"; } @@ -259,7 +251,7 @@ function print_recent_activity($course) { // This function trawls through the logs looking for // anything new since the user's last login - global $CFG, $USER, $COURSETEACHERCOLOR; + global $CFG, $USER, $COURSE_TEACHER_COLOR; if (! $USER->lastlogin ) { echo "

"; @@ -371,7 +363,7 @@ function print_recent_activity($course) { if (!isteacher($course->id)) { continue; } else { - $teacherpost = "COLOR=$COURSETEACHERCOLOR"; + $teacherpost = "COLOR=$COURSE_TEACHER_COLOR"; } } } @@ -395,9 +387,8 @@ function print_recent_activity($course) { } if (! $content) { - echo "Nothing new since your last login"; + echo "".get_string("nothingnew").""; } - } @@ -772,14 +763,14 @@ function make_editing_buttons($moduleid, $absolute=false) { $path = ""; } return "    - \"$delete\" - \"$moveup\" - \"$movedown\" - \"$update\""; + + + + "; } ?> diff --git a/course/log.php b/course/log.php index 9a5904b003..c925f164eb 100644 --- a/course/log.php +++ b/course/log.php @@ -1,6 +1,5 @@ shortname: $strlogs", "$course->fullname", "id\">$course->shortname -> $strlogs", ""); - print_heading("Choose which logs you want to look at"); + print_heading(get_string("chooselogs").":"); print_log_selector_form($course); - print_heading("Or see what is happening right now"); + echo "
"; + print_heading(get_string("chooselivelogs").":"); echo "

"; - link_to_popup_window("/course/loglive.php?id=$course->id","livelog","Live logs", 500, 800); + link_to_popup_window("/course/loglive.php?id=$course->id","livelog", get_string("livelogs"), 500, 800); echo "

"; - } print_footer($course); diff --git a/course/loggraph.php b/course/loggraph.php index b47d980e4b..73ded0d84f 100644 --- a/course/loggraph.php +++ b/course/loggraph.php @@ -1,4 +1,5 @@ "); + $strlivelogs = get_string("livelogs"); + $strupdatesevery = get_string("updatesevery", "moodle", $COURSE_LIVELOG_REFRESH); + + print_header("$strlivelogs ($strupdatesevery)", "$strlivelogs", "", "", + ""); $user=0; $date=time() - 3600; diff --git a/course/mod.php b/course/mod.php index 2b5512a350..2acd839d31 100644 --- a/course/mod.php +++ b/course/mod.php @@ -153,7 +153,7 @@ error("This module doesn't exist"); } - $sectionname = $COURSE_SECTION[$course->format]; + $sectionname = get_string("name$course->format"); if (! $form = get_record($module->name, "id", $cm->instance)) { error("The required instance of this module doesn't exist"); @@ -189,7 +189,7 @@ error("This course doesn't exist"); } - $sectionname = $COURSE_SECTION[$course->format]; + $sectionname = get_string("name$course->format"); if (! $module = get_record("modules", "name", $add)) { error("This module type doesn't exist"); diff --git a/course/mod_delete.html b/course/mod_delete.html index 3512f44fda..f904b0577d 100644 --- a/course/mod_delete.html +++ b/course/mod_delete.html @@ -2,7 +2,7 @@
-fullmodulename '$form->instancename' ?") ?> +fullmodulename '$form->instancename'")); ?> diff --git a/course/social.php b/course/social.php index 979036a98b..8207626c97 100644 --- a/course/social.php +++ b/course/social.php @@ -10,32 +10,34 @@ id, "news")) { - //forum_print_latest_discussions($news->id, 5, "minimal", "DESC", false); - //} - - //echo "

"; - 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); + // Then, print all the available resources (Section 0) - print_simple_box("Resources", $align="CENTER", $width="100%", $color="$THEME->cellheading"); + print_simple_box(get_string("resources"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); print_section($site->id, $sections[0], $mods, $modnamesused, true); if (isediting($site->id)) { echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=0&add=", - $modnames, "section0", "", "Add..."); + $modnames, "section0", "", get_string("add")."..."); echo "
"; } // Print all the recent activity - print_simple_box("Recent Activity", $align="CENTER", $width="100%", $color="$THEME->cellheading"); + print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading"); echo "
"; print_recent_activity($course); echo "
"; @@ -48,22 +50,28 @@ echo ""; // Print Admin links for teachers and admin. - if (isteacher($course->id) || isadmin()) { - print_simple_box("Admin", $align="CENTER", $width="100%", $color="$THEME->cellheading"); - $adminicon[]="\"Edit\""; + if (isteacher($course->id)) { + 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").""; } - - $admindata[]="id\">Course settings..."; - $adminicon[]="\"Course\""; - $admindata[]="id\">Logs..."; - $adminicon[]="\"Log\""; - $admindata[]="id\">Files..."; - $adminicon[]="\"Files\""; - + + print_simple_box(get_string("administration"),"CENTER", "100%", $THEME->cellheading); print_side_block("", $admindata, "", $adminicon); } @@ -72,11 +80,11 @@ echo ""; if ($social = forum_get_course_forum($course->id, "social")) { if (forum_is_subscribed($USER->id, $social->id)) { - $subtext = "Unsubscribe"; + $subtext = get_string("unsubscribe", "forum"); } else { - $subtext = "Subscribe me by mail"; + $subtext = get_string("subscribe", "forum"); } - $headertext = "
Social Forum - Current Topicsid\">$subtext
"; + $headertext = "
".get_string("socialheadline")."id\">$subtext
"; print_simple_box("$headertext", $align="CENTER", $width="100%", $color="$THEME->cellheading"); echo "\"\"
"; diff --git a/course/teacher.php b/course/teacher.php index c9e32bfd20..89939ced95 100644 --- a/course/teacher.php +++ b/course/teacher.php @@ -1,4 +1,5 @@ shortname", "$course->shortname", "wwwroot/course/view.php?id=$course->id\">$course->shortname -> Unenrol"); + $strunenrol = get_string("unenrol"); + + print_header("$course->shortname: $strunenrol", "$course->fullname", + "wwwroot/course/view.php?id=$course->id\">$course->shortname -> $strunenrol"); if ($user->id == $USER->id) { - notice_yesno ("Are you sure you want to remove yourself from this course?", - "unenrol.php?id=$id&user=$user->id&confirm=yes", "$HTTP_REFERER"); + $strunenrolsure = get_string("unenrolsure", "", get_string("yourself")); } else { - notice_yesno ("Are you sure you want to remove $user->firstname $user->lastname from this course?", - "unenrol.php?id=$id&user=$user->id&confirm=yes", "$HTTP_REFERER"); + $strunenrolsure = get_string("unenrolsure", "", "$user->firstname $user->lastname"); } - print_footer(); + notice_yesno ($strunenrolsure, "unenrol.php?id=$id&user=$user->id&confirm=yes", "$HTTP_REFERER"); + print_footer(); ?> diff --git a/course/user.php b/course/user.php index 0770c76b67..726eacd9f9 100644 --- a/course/user.php +++ b/course/user.php @@ -1,5 +1,7 @@