From: dongsheng Date: Fri, 13 Jun 2008 06:55:25 +0000 (+0000) Subject: "MDL-14129, fix print_error" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f857fa9ff596c626cf148383902aa911c73e6621;p=moodle.git "MDL-14129, fix print_error" --- diff --git a/lang/en_utf8/message.php b/lang/en_utf8/message.php index c84a327367..b2e7ec1a98 100644 --- a/lang/en_utf8/message.php +++ b/lang/en_utf8/message.php @@ -17,6 +17,7 @@ $string['blocknoncontacts'] = 'Block all new messages from people who are not on $string['contactlistempty'] = 'Your contact list is currently empty'; $string['contacts'] = 'Contacts'; $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['emailmessages'] = 'Email messages when I am offline'; diff --git a/message/discussion.php b/message/discussion.php index f690da706e..03b0243933 100644 --- a/message/discussion.php +++ b/message/discussion.php @@ -10,7 +10,7 @@ } if (empty($CFG->messaging)) { - print_error("Messaging is disabled on this site"); + print_error('disabled', 'message'); } /// Script parameters diff --git a/message/history.php b/message/history.php index 93b1d35eb7..ceef16619d 100644 --- a/message/history.php +++ b/message/history.php @@ -11,19 +11,19 @@ } if (empty($CFG->messaging)) { - print_error("Messaging is disabled on this site"); + print_error('disabled', 'message'); } /// Script parameters $userid1 = required_param('user1', PARAM_INT); if (! $user1 = $DB->get_record("user", array("id"=>$userid1))) { // Check it's correct - print_error("User ID 1 was incorrect"); + print_error('invaliduserid'); } if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM))) { // Able to see any discussion $userid2 = optional_param('user2', $USER->id, PARAM_INT); if (! $user2 = $DB->get_record("user", array("id"=>$userid2))) { // Check - print_error("User ID 2 was incorrect"); + print_error('invaliduserid'); } } else { $userid2 = $USER->id; // Can only see messages involving yourself diff --git a/message/index.php b/message/index.php index 70c43c16e5..2b6fa7c330 100644 --- a/message/index.php +++ b/message/index.php @@ -11,7 +11,7 @@ } if (empty($CFG->messaging)) { - print_error("Messaging is disabled on this site"); + print_error('disabled', 'message'); } /// Optional variables that may be passed in diff --git a/message/refresh.php b/message/refresh.php index ba478c16d4..5b098ec20f 100644 --- a/message/refresh.php +++ b/message/refresh.php @@ -11,7 +11,7 @@ } if (empty($CFG->messaging)) { - print_error("Messaging is disabled on this site"); + print_error('disabled', 'message'); } /// Script parameters diff --git a/message/send.php b/message/send.php index e8b6ee0ef2..df52e462ec 100644 --- a/message/send.php +++ b/message/send.php @@ -10,7 +10,7 @@ if (isguest()) { } if (empty($CFG->messaging)) { - print_error("Messaging is disabled on this site"); + print_error('disabled', 'message'); } if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTEM))) { @@ -51,7 +51,7 @@ if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTE /// Check the user we are talking to is valid if (! $user = $DB->get_record('user', array('id'=>$userid))) { - print_error("User ID was incorrect"); + print_error('invaliduserid'); } /// Check that the user is not blocking us!! diff --git a/message/user.php b/message/user.php index f30200f9d8..a722392002 100644 --- a/message/user.php +++ b/message/user.php @@ -10,7 +10,7 @@ } if (empty($CFG->messaging)) { - print_error("Messaging is disabled on this site"); + print_error('disabled', 'message'); } /// Script parameters @@ -23,7 +23,7 @@ /// Check the user we are talking to is valid if (! $user = $DB->get_record('user', array('id'=>$userid))) { - print_error("User ID was incorrect"); + print_error('invaliduserid'); } /// Possibly change some contacts if requested