Merge branch 'MDL-30871-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Dan Poltawski 2012-11-20 11:47:17 +08:00
commit 86ebf41545
3 changed files with 9 additions and 9 deletions

View File

@ -151,7 +151,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
if(! @unlink($filename)) {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = get_admin();
$eventdata->userto = get_admin();
@ -169,7 +169,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
// Send mail to admin
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = get_admin();
$eventdata->userto = get_admin();
@ -280,7 +280,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = $teacher;
$eventdata->userto = $user;
@ -303,7 +303,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = $user;
$eventdata->userto = $teacher;

View File

@ -40,7 +40,6 @@ $string['blocknoncontacts'] = 'Prevent non-contacts from messaging me';
$string['contactlistempty'] = 'Your contact list is empty';
$string['contacts'] = 'Contacts';
$string['context'] = 'context';
$string['couldnotfindpreference'] = 'Could not load preference {$a}. Does the component and name you supplied to message_send() match a row in message_providers? Message providers must appear in the database so users can configure how they will be notified when they receive messages.';
$string['defaultmessageoutputs'] = 'Default message outputs';
$string['defaults'] = 'Defaults';
$string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted';

View File

@ -155,10 +155,11 @@ function message_send($eventdata) {
if (isset($defaultpreferences->{$defaultpreference})) {
$permitted = $defaultpreferences->{$defaultpreference};
} else {
//MDL-25114 They supplied an $eventdata->component $eventdata->name combination which doesn't
//exist in the message_provider table (thus there is no default settings for them)
$preferrormsg = get_string('couldnotfindpreference', 'message', $defaultpreference);
throw new coding_exception($preferrormsg,'blah');
// MDL-25114 They supplied an $eventdata->component $eventdata->name combination which doesn't
// exist in the message_provider table (thus there is no default settings for them).
$preferrormsg = "Could not load preference $defaultpreference. Make sure the component and name you supplied
to message_send() are valid.";
throw new coding_exception($preferrormsg);
}
// Find out if user has configured this output