From 3c0b6b1610bb1c2ecf15d35aa6a065928c9257e6 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Thu, 15 May 2008 03:22:13 +0000 Subject: [PATCH] MDL-14129, fix print_error --- lang/en_utf8/error.php | 2 ++ lang/en_utf8/form.php | 1 + lib/editor/tinymce/coursefiles.php | 8 ++++---- lib/form/editorhelp.php | 4 ++-- lib/formslib.php | 6 +++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index 3339e775b9..126d49c35d 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -29,6 +29,7 @@ $string['cannotcreatelangdir'] = 'Cannot create lang dir.'; $string['cannotcreatelangbase'] = 'Error: Could not create base lang directory.'; $string['cannotcreatetempdir'] = 'Cannot create temp dir.'; $string['cannotcreatesitedir'] = 'Cannot create site folder. The site administrator needs to fix the file permissions.'; +$string['cannotcreateuploaddir'] = 'Cannot create upload folder. The site administrator needs to fix the file permissions'; $string['cannotcreateorfindstructs'] = 'Error finding or creating section structures for this course'; $string['cannotcreatepopupwin'] = 'Undefined element - cannot create popup window.'; $string['cannotcustomizelocallang'] = 'You do not have permission to customize the strings translation. This permission is controlled by the capability "moodle/site:langeditlocal". Set this capability to allow you to edit local language packages in case you want to modify translations for your site.'; @@ -177,6 +178,7 @@ $string['invalidpagesize'] = 'Invalid page size'; $string['invalidpaymentmethod'] = 'Invalid payment method: $a'; $string['invalidrequest'] = 'Invalid request'; $string['invalidrole'] = 'Invalid role'; +$string['invalidseeky'] = 'Incorrect sesskey submitted, form not accepted!'; $string['invalidshortname'] = 'That\'s an invalid short course name'; $string['invalidscaleid'] = 'Incorrect scale id'; $string['invalidurl'] = 'Invalid url'; diff --git a/lang/en_utf8/form.php b/lang/en_utf8/form.php index 822729c5fe..bec757ec63 100644 --- a/lang/en_utf8/form.php +++ b/lang/en_utf8/form.php @@ -1,5 +1,6 @@ id")) { - print_error("The site administrator needs to fix the file permissions"); + print_error("cannotcreateuploaddir"); } $baseweb = $CFG->wwwroot; @@ -440,7 +440,7 @@ } if (!zip_files($files,"$basedir/$wdir/$name")) { - print_error("zipfileserror","error"); + print_error("zipfileserror", "error"); } clearfilelist(); @@ -492,7 +492,7 @@ $file = basename($file); if (!unzip_file("$basedir/$wdir/$file")) { - print_error("unzipfileserror","error"); + print_error("unzipfileserror", "error"); } echo "
\n"; diff --git a/lib/form/editorhelp.php b/lib/form/editorhelp.php index 6b031fc69e..4b8e9167c0 100644 --- a/lib/form/editorhelp.php +++ b/lib/form/editorhelp.php @@ -25,7 +25,7 @@ for ($i=1; ; $i++){ $topics[$i] = helplink('text', get_string('helptext')); break; default : - print_error('Unknown help topic '.$item); + print_error('unknownhelp', '', '', $item); } } else { $keyword = optional_param("keyword$i", '', PARAM_ALPHAEXT); @@ -72,4 +72,4 @@ function helplink($page, $linktext='', $module='moodle'){ return "wwwroot/help.php?module=$module&file=$page.html\">$linktext"; } -?> \ No newline at end of file +?> diff --git a/lib/formslib.php b/lib/formslib.php index 53786cdb50..b62b77dc91 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -182,7 +182,7 @@ class moodleform { // the _qf__.$this->_formname serves as a marker that form was actually submitted if (array_key_exists('_qf__'.$this->_formname, $submission) and $submission['_qf__'.$this->_formname] == 1) { if (!confirm_sesskey()) { - print_error('Incorrect sesskey submitted, form not accepted!'); + print_error('invalidseeky'); } $files = $_FILES; } else { @@ -225,7 +225,7 @@ class moodleform { $files[$elname] = $this->_upload_manager->files[$elname]['tmp_name']; } } else { - print_error('Incorrect upload attempt!'); + print_error('cannotuploadfile'); } } @@ -489,7 +489,7 @@ class moodleform { * If you need special handling of uploaded files, create instance of $this->_upload_manager here. */ function definition() { - print_error('Abstract form_definition() method in class '.get_class($this).' must be overriden, please fix the code.'); + print_error('mustbeoverriden', 'form', '', get_class($this)); } /** -- 2.39.5