]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14129, fix print_error
authordongsheng <dongsheng>
Thu, 15 May 2008 03:22:13 +0000 (03:22 +0000)
committerdongsheng <dongsheng>
Thu, 15 May 2008 03:22:13 +0000 (03:22 +0000)
lang/en_utf8/error.php
lang/en_utf8/form.php
lib/editor/tinymce/coursefiles.php
lib/form/editorhelp.php
lib/formslib.php

index 3339e775b91e53f7f7d5e2e0e2074e9457218a88..126d49c35d108524e5aaba5adc1cbc9ac4ad97bc 100644 (file)
@@ -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';
index 822729c5fe05322cfeb956e781534616e54910aa..bec757ec631732423e2df8629e41a8a7968d432f 100644 (file)
@@ -1,5 +1,6 @@
 <?PHP // $Id$
 
+$string['mustbeoverriden'] = 'Abstract form_definition() method in class $a must be overriden, please fix the code.';
 $string['somefieldsrequired'] = 'There are required fields in this form marked$a.'; 
 $string['err_alphanumeric']='You must enter only letters or numbers here.';
 $string['err_email']='You must enter a valid email address here.';
index 358a56861fe8ea1f67f3227ae624e1b416fd33be..dea570cc77dcb2bdbf3af92b99240f4b4d7cea6a 100644 (file)
@@ -27,7 +27,7 @@
 \r
 \r
     if (! $course = get_record("course", "id", $id) ) {\r
-        print_error("That's an invalid course id");\r
+        print_error("invalidcourseid");\r
     }\r
 \r
     require_login($course);\r
     }\r
 \r
     if (! $basedir = make_upload_directory("$course->id")) {\r
-        print_error("The site administrator needs to fix the file permissions");\r
+        print_error("cannotcreateuploaddir");\r
     }\r
 \r
     $baseweb = $CFG->wwwroot;\r
                 }\r
 \r
                 if (!zip_files($files,"$basedir/$wdir/$name")) {\r
-                    print_error("zipfileserror","error");\r
+                    print_error("zipfileserror", "error");\r
                 }\r
 \r
                 clearfilelist();\r
                 $file = basename($file);\r
 \r
                 if (!unzip_file("$basedir/$wdir/$file")) {\r
-                    print_error("unzipfileserror","error");\r
+                    print_error("unzipfileserror", "error");\r
                 }\r
 \r
                 echo "<center><form action=\"coursefiles.php\" method=\"get\">\n";\r
index 6b031fc69ed64f1c01ac8b27cb9540d5e6a55165..4b8e9167c0a226ccd553caf61dcafd3b4bde54ac 100644 (file)
@@ -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 "<a href=\"$CFG->wwwroot/help.php?module=$module&amp;file=$page.html\">$linktext</a>";
 }
 
-?>
\ No newline at end of file
+?>
index 53786cdb50e15571b396802a58f86e436a5cbc0f..b62b77dc91076b7761d8f5f51a96690f78b505f1 100644 (file)
@@ -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));
     }
 
     /**