From: dongsheng Date: Thu, 10 Apr 2008 04:22:22 +0000 (+0000) Subject: MDL-14129, creating error string X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bdfa04330958f68dea432b0f3fb713a2ac906b3f;p=moodle.git MDL-14129, creating error string --- diff --git a/admin/mnet/delete.php b/admin/mnet/delete.php index 56ace95b59..15781bdf72 100644 --- a/admin/mnet/delete.php +++ b/admin/mnet/delete.php @@ -15,7 +15,7 @@ require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions"); if (!$site = get_site()) { - print_error('nosite', '', '', NULL, true); + print_error('nosite', 'error'); } /// Initialize variables. diff --git a/admin/mnet/peers.php b/admin/mnet/peers.php index 3434f3b30c..c745ce30d3 100644 --- a/admin/mnet/peers.php +++ b/admin/mnet/peers.php @@ -20,7 +20,7 @@ if (!extension_loaded('openssl')) { if (!$site = get_site()) { admin_externalpage_print_header(); - print_error('nosite', ''); + print_error('nosite', 'error'); } if (!function_exists('curl_init') ) { @@ -82,7 +82,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { $temp_wwwroot = clean_param($form->wwwroot, PARAM_URL); if ($temp_wwwroot !== $form->wwwroot) { trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc."); - print_error("invalidurl", 'mnet','peers.php'); + print_error('invalidurl', 'mnet', 'peers.php'); exit; } unset($temp_wwwroot); @@ -103,7 +103,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { if (isset($form->public_key)) { $form->public_key = clean_param($form->public_key, PARAM_PEM); if (empty($form->public_key)) { - print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id); + print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, ''); exit; } else { $oldkey = $mnet_peer->public_key; @@ -116,8 +116,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { foreach ($mnet_peer->error as $err) { $errmsg .= $err['code'] . ': ' . $err['text'].'
'; } - error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id); - //print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $errmsg); + print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $errmsg); exit; } } @@ -139,7 +138,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { if ($bool) { redirect('peers.php?step=update&hostid='.$mnet_peer->id, get_string('changessaved')); } else { - print_error('Invalid action parameter.', '', 'index.php'); + print_error('invalidaction', 'error', 'index.php'); } } } diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index d09ff857e1..ae4d520ab4 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -67,6 +67,7 @@ $string['groupnotaddederror'] = 'Group \"$a\" not added'; $string['groupunknown'] = 'Group $a not associated to specified course'; $string['guestnoeditprofile'] = 'The guest user cannot edit their profile'; $string['guestnoeditprofileother'] = 'The guest user profile cannot be edited'; +$string['invalidaction'] = 'Invalid action parameter.'; $string['invalidaccessparameter'] = 'Invalid access parameter.'; $string['invalidcourse'] = 'Invalid course'; $string['invalidfieldname'] = '\"$a\" is not a valid field name'; @@ -102,6 +103,7 @@ $string['nousers'] = 'No such user!'; $string['nonmeaningfulcontent'] = 'Non meaningful content'; $string['noparticipatorycms'] = 'Sorry, but you have no participatory course modules to report on.'; $string['nopermissions'] = 'Sorry, but you do not currently have permissions to do that ($a)'; +$string['nosite'] = 'No sites'; $string['notavailable'] = 'That is not currently available'; $string['onlyadmins'] = 'Only administrators can do that.'; $string['onlyeditingteachers'] = 'Only editing teachers can do that.';