From: dongsheng Date: Thu, 25 Sep 2008 07:40:31 +0000 (+0000) Subject: "MDL-14129, fixed hardcoded print_header" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=53e242f9d133074d81a21c2524462e53cd78c129;p=moodle.git "MDL-14129, fixed hardcoded print_header" --- diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index a070242d2c..6ea7557bf3 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -139,6 +139,7 @@ $string['cannotupdaterole'] = 'Cannot update role!'; $string['cannotupdatemod'] = 'Could not update $a'; $string['cannotupdatemodcap'] = 'Could not update $a capabilities!'; $string['cannotupdateuser'] = 'Updating user failed'; +$string['cannotupdateusermsgpref'] = 'Updating user failed'; $string['cannotupdateuseronexauth'] = 'Failed to update user data on external auth: $a. See the server logs for more details.'; $string['cannotupdatepasswordonextauth'] = 'Failed to update password on external auth: $a. See the server logs for more details.'; $string['cannotupdateplugincap'] = 'Could not update $a capabilities!'; diff --git a/lang/en_utf8/message.php b/lang/en_utf8/message.php index 09b5ea6a51..ce5b35b100 100644 --- a/lang/en_utf8/message.php +++ b/lang/en_utf8/message.php @@ -18,6 +18,7 @@ $string['context'] = 'context'; $string['disabled'] = 'Messaging is disabled on this site'; $string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted'; $string['discussion'] = 'Discussion'; +$string['errorcallingprocessor'] = 'Error calling defined processor'; $string['emailmessages'] = 'Email messages when I am offline'; $string['emailtagline'] = 'This email is a copy of a message sent to you at \"$a\"'; $string['emptysearchstring'] = 'You must search for something'; diff --git a/message/edit.php b/message/edit.php index 6e2bc80338..923ea71d26 100644 --- a/message/edit.php +++ b/message/edit.php @@ -43,7 +43,7 @@ $userid = optional_param('id', $USER->id, PARAM_INT); // user id $course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site) if (!$course = $DB->get_record('course', array('id' => $course))) { - error('Course ID was incorrect'); + print_error('invalidcourseid'); } if ($course->id != SITEID) { @@ -62,7 +62,7 @@ if (isguestuser()) { } if (!$user = $DB->get_record('user', array('id' => $userid))) { - error('User ID was incorrect'); + print_error('invaliduserid'); } $systemcontext = get_context_instance(CONTEXT_SYSTEM); @@ -121,13 +121,13 @@ if ( ($form = data_submitted()) && confirm_sesskey()) { $pclass = new $processclass(); $pclass->process_form($form, $preferences); } else{ - error('Error calling defined processor'); + print_error('errorcallingprocessor', 'message'); } } } /// Save all the new preferences to the database if (!set_user_preferences( $preferences, $user->id ) ){ - error('Error updating user message preferences'); + print_error('cannotupdateusermsgpref'); } redirect("$CFG->wwwroot/message/edit.php?id=$user->id&course=$course->id"); @@ -163,7 +163,7 @@ foreach ( $processors as $processorid => $processor){ $pclass = new $processclass(); $pclass->load_data($preferences, $user->id); } else{ - error('Error calling defined processor'); + print_error('errorcallingprocessor', 'message'); } } } @@ -249,7 +249,7 @@ foreach ( $processors as $processorid => $processor){ $pclass = new $processclass(); $pclass->config_form($preferences); } else{ - error('Error calling defined processor'); + print_error('errorcallingprocessor', 'message'); } } }