]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error"
authordongsheng <dongsheng>
Sun, 15 Jun 2008 09:48:42 +0000 (09:48 +0000)
committerdongsheng <dongsheng>
Sun, 15 Jun 2008 09:48:42 +0000 (09:48 +0000)
lang/en_utf8/error.php
user/filters/lib.php
user/profile/definelib.php
user/profile/lib.php

index a4d62d8ab772ddc808cc4ee92a8a8c752c163f35..b365ce87a61faf226e10ff68030954dcb42cf3b5 100644 (file)
@@ -31,6 +31,7 @@ $string['cannotcreatedefaultcat'] = 'Error creating a default category for conte
 $string['cannotcreategroup'] = 'Error creating group';
 $string['cannotcreatelangdir'] = 'Cannot create lang dir.';
 $string['cannotcreatelangbase'] = 'Error: Could not create base lang directory.';
+$string['cannotcreatefield'] = 'Error creating new field';
 $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';
@@ -41,7 +42,9 @@ $string['cannotcustomizelocallang'] = 'You do not have permission to customize t
 $string['cannotdeletelangcache'] = 'Language cache can not be deleted, please fix permissions in dataroot/cache/languages!';
 $string['cannotdeletebackupids'] = 'Couldn\'t delete previous backup ids.';
 $string['cannotdeletecap'] = 'Could not delete deprecated capability $a';
+$string['cannotdeletecate'] = 'Error while deliting category';
 $string['cannotdeletecourse'] = 'You do not have the permission to delete this course.';
+$string['cannotdeletecustomfield'] = 'Error deleting custom field data';
 $string['cannotdeleterole'] = 'It can not be deleted, because $a';
 $string['cannotdeleterolewithid'] = 'Could not delete role with ID $a';
 $string['cannotdownloadcomponents'] = 'Cannot download components.';
@@ -115,6 +118,7 @@ $string['cannotupdatecategory'] = 'Could not update the category ($a)';
 $string['cannotupdatecoursemodule'] = 'Could not update the course module with the correct section';
 $string['cannotupdatecomment'] = 'Could not update this comment';
 $string['cannotupdatecm'] = 'Could not update the course module with the correct section';
+$string['cannotupdatefield'] = 'Error updating field';
 $string['cannotupdatelevel'] = 'Could not update the indent level on that course module';
 $string['cannotupdategroup'] = 'Error updating group';
 $string['cannotupdaterecord'] = 'Could not update record ID $a';
@@ -126,6 +130,7 @@ $string['cannotupdateuseronexauth'] = 'Failed to update user data on external au
 $strign['cannotupdatepasswordonextauth'] = 'Failed to update password on external auth: $a. See the server logs for more details.';
 $string['cannotupdateplugincap'] = 'Could not update $a capabilities!';
 $string['cannotupdateprofile'] = 'Error updating user record';
+$string['cannotupdatecustomprofile'] = 'Error updating user custom record';
 $stirng['cannotupdaterss'] = 'Cannot update rss';
 $string['cannotupdatesummary'] = 'Could not update the summary!';
 $string['cannotupdatesubcate'] = 'Could not update a child category!';
index 3893f35f02c4ecb204255ba474f8f71157b84e2f..bcb6624504c40d1e7f7b61020663429bc0bdf214 100644 (file)
@@ -229,7 +229,7 @@ class user_filter_type {
      * @return string the filtering condition or null if the filter is disabled
      */
     function get_sql_filter($data) {
-        print_error('Abstract method get_sql_filter() called - must be implemented');
+        print_error('mustbeoveride', 'debug', '', 'get_sql_filter');
     }
 
     /**
@@ -238,7 +238,7 @@ class user_filter_type {
      * @return mixed array filter data or false when filter not set
      */
     function check_data($formdata) {
-        print_error('Abstract method check_data() called - must be implemented');
+        print_error('mustbeoveride', 'debug', '', 'check_data');
     }
 
     /**
@@ -246,7 +246,7 @@ class user_filter_type {
      * @param object $mform a MoodleForm object to setup
      */
     function setupForm(&$mform) {
-        print_error('Abstract method setupForm() called - must be implemented');
+        print_error('mustbeoveride', 'debug', '', 'setupForm');
     }
 
     /**
@@ -255,6 +255,6 @@ class user_filter_type {
      * @return string active filter label
      */
     function get_label($data) {
-        print_error('Abstract method get_label() called - must be implemented');
+        print_error('mustbeoveride', 'debug', '', 'get_label');
     }
 }
index 7d65d62834eca16783aa6cdced27f37f27056906..afd0791fcddbb32bca0f8295f250739007cc6fd4 100644 (file)
@@ -154,11 +154,11 @@ class profile_define_base {
         if (empty($data->id)) {
             unset($data->id);
             if (!$data->id = $DB->insert_record('user_info_field', $data)) {
-                print_error('Error creating new field');
+                print_error('cannotcreatefield');
             }
         } else {
             if (!$DB->update_record('user_info_field', $data)) {
-                print_error('Error updating field');
+                print_error('cannotupdatefield');
             }
         }
     }
@@ -229,11 +229,11 @@ function profile_delete_category($id) {
 
     /// Retrieve the category
     if (!$category = $DB->get_record('user_info_category', array('id'=>$id))) {
-        print_error('Incorrect category id');
+        print_error('invalidcategoryid');
     }
 
     if (!$categories = $DB->get_records('user_info_category', null, 'sortorder ASC')) {
-        print_error('Error no categories!?!?');
+        print_error('nocate', 'debug');
     }
 
     unset($categories[$category->id]);
@@ -268,7 +268,7 @@ function profile_delete_category($id) {
 
     /// Finally we get to delete the category
     if (!$DB->delete_records('user_info_category', array('id'=>$category->id))) {
-        print_error('Error while deliting category');
+        print_error('cannotdeletecate');
     }
     profile_reorder_categories();
     return true;
@@ -280,7 +280,7 @@ function profile_delete_field($id) {
 
     /// Remove any user data associated with this field
     if (!$DB->delete_records('user_info_data', array('fieldid'=>$id))) {
-        print_error('Error deleting custom field data');
+        print_error('cannotdeletecustomfield');
     }
 
     /// Try to remove the record from the database
@@ -425,11 +425,11 @@ function profile_edit_category($id, $redirect) {
                 unset($data->id);
                 $data->sortorder = $DB->count_records('user_info_category') + 1;
                 if (!$DB->insert_record('user_info_category', $data, false)) {
-                    print_error('There was a problem adding the record to the database');
+                    print_error('cannotinsertcategory');
                 }
             } else {
                 if (!$DB->update_record('user_info_category', $data)) {
-                    print_error('There was a problem updating the record in the database');
+                    print_error('cannotupdatecategory');
                 }
             }
             profile_reorder_categories();
index 607cdaf063fed8ecf96ad27246d5005fa8bc3298..6a9f57322c6ca1459e2e60bca1bfad23a5f80d0b 100644 (file)
@@ -43,7 +43,7 @@ class profile_field_base {
      * @param  form  instance of the moodleform class
      */
     function edit_field_add(&$mform) {
-        print_error('mustbeoveride', 'debug');
+        print_error('mustbeoveride', 'debug', '', 'edit_field_add');
     }