From: dongsheng Date: Wed, 14 May 2008 06:03:04 +0000 (+0000) Subject: "MDL-14129, fix print_error" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=02dc70329871fef28092fdc9b12b5a6fc4daa867;p=moodle.git "MDL-14129, fix print_error" --- diff --git a/files/index.php b/files/index.php index 8e3ec42920..5a820a3747 100644 --- a/files/index.php +++ b/files/index.php @@ -25,13 +25,13 @@ 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); @@ -158,7 +158,7 @@ if (! $basedir = make_upload_directory("$course->id")) { - print_error("The site administrator needs to fix the file permissions"); + print_error("nopermissiontomkdir"); } $baseweb = $CFG->wwwroot; @@ -176,13 +176,13 @@ 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) { @@ -474,7 +474,7 @@ } if (!zip_files($files,"$basedir$wdir/$name")) { - print_error("zipfileserror","error"); + print_error("zipfileserror", "error"); } clearfilelist(); @@ -532,7 +532,7 @@ $file = basename($file); if (!unzip_file("$basedir$wdir/$file")) { - print_error("unzipfileserror","error"); + print_error("unzipfileserror", "error"); } echo "
"; diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index 10cb3a5191..c28c214b97 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -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';