]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error"
authordongsheng <dongsheng>
Wed, 14 May 2008 06:03:04 +0000 (06:03 +0000)
committerdongsheng <dongsheng>
Wed, 14 May 2008 06:03:04 +0000 (06:03 +0000)
files/index.php
lang/en_utf8/error.php

index 8e3ec42920cd5cfe2edef63d4eb17bca3d0bd238..5a820a37474304f070cbc43c465eefba83ff2210 100644 (file)
 
     if ($choose) {
         if (count(explode('.', $choose)) > 2) {
-            print_error('Incorrect format for choose parameter');
+            print_error('invalidformatpara');
         }
     }
 
 
     if (! $course = get_record("course", "id", $id) ) {
-        print_error("That's an invalid course id");
+        print_error('invalidcourseid');
     }
 
     require_login($course);
 
 
     if (! $basedir = make_upload_directory("$course->id")) {
-        print_error("The site administrator needs to fix the file permissions");
+        print_error("nopermissiontomkdir");
     }
 
     $baseweb = $CFG->wwwroot;
 
     if ($wdir == "/backupdata") {
         if (! make_upload_directory("$course->id/backupdata")) {   // Backup folder
-            print_error("Could not create backupdata folder.  The site administrator needs to fix the file permissions");
+            print_error("nopermissiontomkdir");
         }
     }
 
     if (!is_dir($basedir.$wdir)) {
         html_header($course, $wdir);
-        print_error("Requested directory does not exist.", '', "$CFG->wwwroot/files/index.php?id=$id");
+        print_error('nofolder', '', "$CFG->wwwroot/files/index.php?id=$id");
     }
 
     switch ($action) {
                 }
 
                 if (!zip_files($files,"$basedir$wdir/$name")) {
-                    print_error("zipfileserror","error");
+                    print_error("zipfileserror", "error");
                 }
 
                 clearfilelist();
                 $file = basename($file);
 
                 if (!unzip_file("$basedir$wdir/$file")) {
-                    print_error("unzipfileserror","error");
+                    print_error("unzipfileserror", "error");
                 }
 
                 echo "<div style=\"text-align:center\"><form action=\"index.php\" method=\"get\">";
index 10cb3a51911196e5775c2d1444040881cc7286d2..c28c214b97b1ba3ae76be90a614c93393d247450 100644 (file)
@@ -128,6 +128,7 @@ $string['invalidcoursenameshort'] = 'Invalid short course name';
 $string['invalidevent'] = 'Invalid event';
 $string['invalidfieldname'] = '\"$a\" is not a valid field name';
 $string['invalidfiletype'] = '\"$a\" is not a valid file type';
+$string['invalidformatpara'] = 'Incorrect format for choose parameter';
 $string['invalidgroupid'] = 'INcorrect group id specified.';
 $string['invalidipformat'] = 'Invalid IP address format';
 $string['invalidmd5'] = 'Invalid md5';
@@ -186,11 +187,13 @@ $string['nousers'] = 'No such user!';
 $string['nonmeaningfulcontent'] = 'Non meaningful content';
 $string['noparticipatorycms'] = 'Sorry, but you have no participatory course modules to report on.';
 $string['nopermissions'] = 'Sorry, but you do not currently have permissions to do that ($a)';
+$string['nopermissiontomkdir'] = 'Cannot create folder. The site administrator needs to fix the file permissions';
 $string['nopermissiontoimportact'] = 'You do not have the required permissions to import activities to this course';
 $string['nopermissiontoviewpage'] = 'You are not allowed to look at this page';
 $string['nopermissiontomanagegroup'] = 'You do not have the required permissions to manage groups.';
 $string['nosite'] = 'No sites';
 $string['nositeid'] = 'No site ID';
+$string['nofolder'] = 'Requested directory does not exist.';
 $string['nostatstodisplay'] = 'There is no available data to display, sorry.';
 $string['notavailable'] = 'That is not currently available';
 $string['notmemberofgroup'] = 'You are not a member of this course group';