From b18921676ebf1c22e6c31adb56d4bb5d3e07c4ea Mon Sep 17 00:00:00 2001 From: poltawski Date: Mon, 29 Oct 2007 10:44:50 +0000 Subject: [PATCH] MDL-11124 - Allowed 'There are no [modulename]' translations. This is currently hardcoded and can be discovered through the user interface resonably easily. Merged from MOODLE_19_STABLE --- lang/en_utf8/moodle.php | 1 + mod/chat/index.php | 2 +- mod/choice/index.php | 2 +- mod/data/index.php | 3 ++- mod/exercise/index.php | 2 +- mod/exercise/locallib.php | 2 +- mod/glossary/index.php | 4 ++-- mod/hotpot/index.php | 2 +- mod/journal/index.php | 2 +- mod/lams/index.php | 2 +- mod/lesson/index.php | 2 +- mod/quiz/index.php | 2 +- mod/resource/index.php | 2 +- mod/scorm/index.php | 2 +- mod/survey/index.php | 2 +- mod/wiki/index.php | 2 +- mod/workshop/index.php | 2 +- 17 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 555a5c560a..dc9c29473c 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1428,6 +1428,7 @@ $string['thanks'] = 'Thanks'; $string['theme'] = 'Theme'; $string['themes'] = 'Themes'; $string['themesaved'] = 'New theme saved'; +$string['thereareno'] = 'There are no $a in this course'; $string['thischarset'] = 'UTF-8'; $string['thisdirection'] = 'ltr'; $string['thislanguage'] = 'English'; diff --git a/mod/chat/index.php b/mod/chat/index.php index 84daca9740..a9a365fe9b 100644 --- a/mod/chat/index.php +++ b/mod/chat/index.php @@ -31,7 +31,7 @@ /// Get all the appropriate data if (! $chats = get_all_instances_in_course('chat', $course)) { - notice('There are no chats', "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strchats), "../../course/view.php?id=$course->id"); die(); } diff --git a/mod/choice/index.php b/mod/choice/index.php index 27924d75a9..3b0706c710 100644 --- a/mod/choice/index.php +++ b/mod/choice/index.php @@ -23,7 +23,7 @@ if (! $choices = get_all_instances_in_course("choice", $course)) { - notice("There are no choices", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strchoices), "../../course/view.php?id=$course->id"); } if ( !empty($USER->id) and $allanswers = get_records("choice_answers", "userid", $USER->id)) { diff --git a/mod/data/index.php b/mod/data/index.php index d069bc2001..9d98d049e8 100755 --- a/mod/data/index.php +++ b/mod/data/index.php @@ -41,6 +41,7 @@ $strtopic = get_string('topic'); $strname = get_string('name'); $strdata = get_string('modulename','data'); + $strdataplural = get_string('modulenameplural','data'); $navlinks = array(); $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); @@ -49,7 +50,7 @@ print_header_simple($strdata, '', $navigation, '', '', true, "", navmenu($course)); if (! $datas = get_all_instances_in_course("data", $course)) { - notice("There are no databases", "$CFG->wwwroot/course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle',$strdataplural) , "$CFG->wwwroot/course/view.php?id=$course->id"); } $timenow = time(); diff --git a/mod/exercise/index.php b/mod/exercise/index.php index 5be04f65e5..7b50f834f8 100644 --- a/mod/exercise/index.php +++ b/mod/exercise/index.php @@ -31,7 +31,7 @@ print_header_simple("$strexercises", "", $navigation, "", "", true, "", navmenu($course)); if (! $exercises = get_all_instances_in_course("exercise", $course)) { - notice("There are no exercises", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strexercises), "../../course/view.php?id=$course->id"); die; } diff --git a/mod/exercise/locallib.php b/mod/exercise/locallib.php index b607c74904..be25289779 100644 --- a/mod/exercise/locallib.php +++ b/mod/exercise/locallib.php @@ -2796,7 +2796,7 @@ function exercise_print_teacher_table($course) { // print how many assessments each teacher has done in each exercise if (! $exercises = get_all_instances_in_course("exercise", $course)) { - notice("There are no exercises", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', get_string('modulenameplural', 'exercise')), "../../course/view.php?id=$course->id"); die; } diff --git a/mod/glossary/index.php b/mod/glossary/index.php index b3209f2458..14365f21d6 100644 --- a/mod/glossary/index.php +++ b/mod/glossary/index.php @@ -36,7 +36,7 @@ /// Get all the appropriate data if (! $glossarys = get_all_instances_in_course("glossary", $course)) { - notice("There are no glossaries", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strglossarys), "../../course/view.php?id=$course->id"); die; } @@ -128,4 +128,4 @@ print_footer($course); -?> \ No newline at end of file +?> diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index cf9d727ade..7077710f8d 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -74,7 +74,7 @@ } } if (empty($hotpots)) { - notice("There are no $strmodulenameplural", $next_url); + notice(get_string('thereareno', 'moodle', $strmodulenameplural), $next_url); exit; } $hotpotids = implode(',', array_keys($hotpots)); diff --git a/mod/journal/index.php b/mod/journal/index.php index a71b6c06a1..52dd12bf7c 100644 --- a/mod/journal/index.php +++ b/mod/journal/index.php @@ -26,7 +26,7 @@ if (! $journals = get_all_instances_in_course("journal", $course)) { - notice("There are no journals", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strjournals), "../../course/view.php?id=$course->id"); die; } diff --git a/mod/lams/index.php b/mod/lams/index.php index 4fa817c899..94fae61b81 100644 --- a/mod/lams/index.php +++ b/mod/lams/index.php @@ -33,7 +33,7 @@ /// Get all the appropriate data if (! $lamss = get_all_instances_in_course("lams", $course)) { - notice("There are no lams", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strlamss) , "../../course/view.php?id=$course->id"); die; } diff --git a/mod/lesson/index.php b/mod/lesson/index.php index a28404b903..0b9ce3ba20 100644 --- a/mod/lesson/index.php +++ b/mod/lesson/index.php @@ -39,7 +39,7 @@ /// Get all the appropriate data if (! $lessons = get_all_instances_in_course("lesson", $course)) { - notice("There are no lessons", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strlessons), "../../course/view.php?id=$course->id"); die; } diff --git a/mod/quiz/index.php b/mod/quiz/index.php index e3bed8b6d5..3de177a3d2 100644 --- a/mod/quiz/index.php +++ b/mod/quiz/index.php @@ -40,7 +40,7 @@ // Get all the appropriate data if (!$quizzes = get_all_instances_in_course("quiz", $course)) { - notice("There are no quizzes", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strquizzes), "../../course/view.php?id=$course->id"); die; } diff --git a/mod/resource/index.php b/mod/resource/index.php index 5172ea1f5e..657783e45c 100644 --- a/mod/resource/index.php +++ b/mod/resource/index.php @@ -31,7 +31,7 @@ "", "", true, "", navmenu($course)); if (! $resources = get_all_instances_in_course("resource", $course)) { - notice("There are no resources", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strresources), "../../course/view.php?id=$course->id"); exit; } diff --git a/mod/scorm/index.php b/mod/scorm/index.php index 92c9ee8a0c..b02db29588 100755 --- a/mod/scorm/index.php +++ b/mod/scorm/index.php @@ -40,7 +40,7 @@ } if (! $scorms = get_all_instances_in_course("scorm", $course)) { - notice("There are no scorms", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strscorms), "../../course/view.php?id=$course->id"); exit; } diff --git a/mod/survey/index.php b/mod/survey/index.php index 7ea8a4fed4..ab99905958 100644 --- a/mod/survey/index.php +++ b/mod/survey/index.php @@ -29,7 +29,7 @@ "", "", true, "", navmenu($course)); if (! $surveys = get_all_instances_in_course("survey", $course)) { - notice("There are no surveys.", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strsurveys), "../../course/view.php?id=$course->id"); } if ($course->format == "weeks") { diff --git a/mod/wiki/index.php b/mod/wiki/index.php index 5f7f351643..396499ccb9 100644 --- a/mod/wiki/index.php +++ b/mod/wiki/index.php @@ -33,7 +33,7 @@ /// Get all the appropriate data if (! $wikis = get_all_instances_in_course("wiki", $course)) { - notice("There are no wikis", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strwikis), "../../course/view.php?id=$course->id"); die; } diff --git a/mod/workshop/index.php b/mod/workshop/index.php index d52d8d245e..d08ba27f43 100644 --- a/mod/workshop/index.php +++ b/mod/workshop/index.php @@ -30,7 +30,7 @@ print_header_simple("$strworkshops", "", $navigation, "", "", true, "", navmenu($course)); if (! $workshops = get_all_instances_in_course("workshop", $course)) { - notice("There are no workshops", "../../course/view.php?id=$course->id"); + notice(get_string('thereareno', 'moodle', $strworkshops), "../../course/view.php?id=$course->id"); die; } -- 2.39.5