Skip to content

Commit

Permalink
"MDL-14129, fix print_error"
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed May 14, 2008
1 parent ec30ee0 commit 02dc703
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 7 additions & 7 deletions files/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -158,7 +158,7 @@ function set_value(txt) {


if (! $basedir = make_upload_directory("$course->id")) {
print_error("The site administrator needs to fix the file permissions");
print_error("nopermissiontomkdir");
}

$baseweb = $CFG->wwwroot;
Expand All @@ -176,13 +176,13 @@ function set_value(txt) {

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) {
Expand Down Expand Up @@ -474,7 +474,7 @@ function set_value(txt) {
}

if (!zip_files($files,"$basedir$wdir/$name")) {
print_error("zipfileserror","error");
print_error("zipfileserror", "error");
}

clearfilelist();
Expand Down Expand Up @@ -532,7 +532,7 @@ function set_value(txt) {
$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\">";
Expand Down
3 changes: 3 additions & 0 deletions lang/en_utf8/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
$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';
Expand Down Expand Up @@ -186,11 +187,13 @@
$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';
Expand Down

0 comments on commit 02dc703

Please sign in to comment.