"MDL-14129, fixed hardcoded print_header"

This commit is contained in:
dongsheng 2008-09-25 07:40:31 +00:00
parent 7e76b9e8db
commit 53e242f9d1
3 changed files with 8 additions and 6 deletions

View File

@ -139,6 +139,7 @@ $string['cannotupdaterole'] = 'Cannot update role!';
$string['cannotupdatemod'] = 'Could not update $a'; $string['cannotupdatemod'] = 'Could not update $a';
$string['cannotupdatemodcap'] = 'Could not update $a capabilities!'; $string['cannotupdatemodcap'] = 'Could not update $a capabilities!';
$string['cannotupdateuser'] = 'Updating user failed'; $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['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['cannotupdatepasswordonextauth'] = 'Failed to update password on external auth: $a. See the server logs for more details.';
$string['cannotupdateplugincap'] = 'Could not update $a capabilities!'; $string['cannotupdateplugincap'] = 'Could not update $a capabilities!';

View File

@ -18,6 +18,7 @@ $string['context'] = 'context';
$string['disabled'] = 'Messaging is disabled on this site'; $string['disabled'] = 'Messaging is disabled on this site';
$string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted'; $string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted';
$string['discussion'] = 'Discussion'; $string['discussion'] = 'Discussion';
$string['errorcallingprocessor'] = 'Error calling defined processor';
$string['emailmessages'] = 'Email messages when I am offline'; $string['emailmessages'] = 'Email messages when I am offline';
$string['emailtagline'] = 'This email is a copy of a message sent to you at \"$a\"'; $string['emailtagline'] = 'This email is a copy of a message sent to you at \"$a\"';
$string['emptysearchstring'] = 'You must search for something'; $string['emptysearchstring'] = 'You must search for something';

View File

@ -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) $course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
if (!$course = $DB->get_record('course', array('id' => $course))) { if (!$course = $DB->get_record('course', array('id' => $course))) {
error('Course ID was incorrect'); print_error('invalidcourseid');
} }
if ($course->id != SITEID) { if ($course->id != SITEID) {
@ -62,7 +62,7 @@ if (isguestuser()) {
} }
if (!$user = $DB->get_record('user', array('id' => $userid))) { if (!$user = $DB->get_record('user', array('id' => $userid))) {
error('User ID was incorrect'); print_error('invaliduserid');
} }
$systemcontext = get_context_instance(CONTEXT_SYSTEM); $systemcontext = get_context_instance(CONTEXT_SYSTEM);
@ -121,13 +121,13 @@ if ( ($form = data_submitted()) && confirm_sesskey()) {
$pclass = new $processclass(); $pclass = new $processclass();
$pclass->process_form($form, $preferences); $pclass->process_form($form, $preferences);
} else{ } else{
error('Error calling defined processor'); print_error('errorcallingprocessor', 'message');
} }
} }
} }
/// Save all the new preferences to the database /// Save all the new preferences to the database
if (!set_user_preferences( $preferences, $user->id ) ){ 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"); 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 = new $processclass();
$pclass->load_data($preferences, $user->id); $pclass->load_data($preferences, $user->id);
} else{ } else{
error('Error calling defined processor'); print_error('errorcallingprocessor', 'message');
} }
} }
} }
@ -249,7 +249,7 @@ foreach ( $processors as $processorid => $processor){
$pclass = new $processclass(); $pclass = new $processclass();
$pclass->config_form($preferences); $pclass->config_form($preferences);
} else{ } else{
error('Error calling defined processor'); print_error('errorcallingprocessor', 'message');
} }
} }
} }