Drupal: Add new admin parameter to boincteam module.

This commit is contained in:
Shawn Kwang 2019-04-12 13:48:47 -05:00
parent ec8fc74a03
commit e585b1b9f8
2 changed files with 13 additions and 3 deletions

View File

@ -180,7 +180,7 @@ function boincteam_create_form_submit($form, &$form_state) {
}
else {
drupal_set_message(t('Teams cannot be created at this time. The @project administrators have been notified.', array('@project' => PROJECT)));
rules_invoke_event('boincteam_create_team_error', $values['name']);
rules_invoke_event('boincteam_create_team_error', $values['name'], variable_get('boinc_admin_mailing_list_subject_tag', ''));
watchdog('BOINC team', 'BOINC teams cannot be created for an unknown
reason.', 'error');
return FALSE;
@ -215,7 +215,7 @@ function boincteam_create_form_submit($form, &$form_state) {
}
else {
drupal_set_message(t('Teams cannot be created at this time. The @project administrators have been notified.', array('@project' => PROJECT)));
rules_invoke_event('boincteam_create_team_nopathauto_error', $values['name']);
rules_invoke_event('boincteam_create_team_nopathauto_error', $values['name'], variable_get('boinc_admin_mailing_list_subject_tag', ''));
watchdog('BOINC team', 'BOINC teams require the Pathauto module. Teams
cannot be created.', 'error');
}

View File

@ -40,5 +40,15 @@ function rules_events_hook_boincteam_arguments() {
'label' => 'team name',
'required' => TRUE,
),
) + rules_events_global_user_argument();
) + rules_events_hook_boincteam_adminnotify_argument();
}
function rules_events_hook_boincteam_adminnotify_argument() {
return array(
'subject_tag' => array(
'type' => 'string',
'label' => 'Subject tag for email filtering',
'required' => TRUE,
),
) + rules_events_global_user_argument();
}