]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14129, fix print_error
authordongsheng <dongsheng>
Tue, 22 Apr 2008 08:52:25 +0000 (08:52 +0000)
committerdongsheng <dongsheng>
Tue, 22 Apr 2008 08:52:25 +0000 (08:52 +0000)
backup/backup.php
lang/en_utf8/error.php

index a4c352e6bc669055d11150b4673f4c62fc9b3e9c..31b811607b95eeb07d94559c4f6d8737b85cf1c1 100644 (file)
     if (!empty($id)) {
         require_login($id);
         if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $id))) {
-            print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+            print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php");
         }
     } else {
         require_login();
         if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
-            print_error("You need to be an admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+            print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php");
         }
     }
 
     if (!empty($to)) {
         if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $to))) {
-            print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+            print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php");
         }
     }
 
     //Check site
     if (!$site = get_site()) {
-        print_error("Site not found!");
+        print_error("cannotfindsite");
     }
 
     //Check necessary functions exists. Thanks to gregb@crowncollege.edu
@@ -96,7 +96,7 @@
 
     //Get and check course
     if (! $course = get_record("course", "id", $id)) {
-        print_error("Course ID was incorrect (can't find it)");
+        print_error('unknowncourseidnumber','error');
     }
 
     //Print header
index d8f966a5d9e3dcbe808776fc522a2904b0d1c5fa..acd6453024c340be0bcd6b9625595e9f8765e745 100644 (file)
@@ -6,6 +6,7 @@ $string['adminprimarynoedit'] = 'The primary admin cannot be edited by others';
 $string['blockdoesnotexist'] = 'This block does not exist';
 $string['blockcannotinistantiate'] = 'Problem in instantiating block object';
 $string['blockcannotconfig'] = 'This block does not support global configuration';
+$string['backupcontainexternal'] = 'This backup file contains external Moodle Network Hosts that are not configured locally.';
 $string['cannotassignrole'] = 'Cannot assign role in course';
 $string['cannotsaveconfig'] = 'Problem saving config \"$a[0]\" as \"$a[1]\" for plugin \"$a[2]\"'; 
 $string['cannotsavefile'] = 'Cannot save the file\"$a[0]\/$a[1]\"!';
@@ -38,6 +39,7 @@ $string['cannotsetupcategory'] = 'Serious Error! Could not set up a default cour
 $string['cannotsetupsite'] = 'Serious Error! Could not set up the site!';
 $string['cannotunzipfile'] = 'Cannot unzip file.';
 $string['cannotupdaterole'] = 'Cannot update role!';
+$string['cannotusepage'] = 'Only teacher and administrator can use this page.';
 $string['cannotviewprofile'] = 'You can not view the profile of this user.';
 $string['cantunenrollfrommetacourse'] = 'You can not unenrol from this meta course.';
 $string['cantunenrollinthisrole'] = 'You can not unenrol from this course while you are in your current role.';