function flag_actions_system_send_email_action_form in Flag 7.3
Same name and namespace in other branches
- 5 flag_actions.module \flag_actions_system_send_email_action_form()
- 6.2 flag_actions.module \flag_actions_system_send_email_action_form()
- 6 flag_actions.module \flag_actions_system_send_email_action_form()
- 7.2 flag_actions.module \flag_actions_system_send_email_action_form()
Make modifications to the "Send e-mail" action form.
File
- ./
flag_actions.module, line 659 - Actions support for the Flag module.
Code
function flag_actions_system_send_email_action_form(&$form, &$flag, $context) {
if (!isset($context['recipient'])) {
$form['recipient']['#default_value'] = '[site:mail]';
}
if (!isset($context['subject'])) {
$form['subject']['#default_value'] = t('Content Flagged @flag_title', array(
'@flag_title' => $flag
->get_title(),
));
}
if (!isset($context['message'])) {
$form['message']['#default_value'] = t("The @flag_entity_type [flag-action:content-title] has been flagged [flag-action:count] times with the @flag_title flag.\n\nView this @flag_entity_type at [flag-action:content-url].", array(
'@flag_entity_type' => $flag->entity_type,
'@flag_title' => $flag
->get_title(),
));
}
$form['help'] = array(
'#type' => 'fieldset',
'#title' => t('Tokens'),
'#description' => t('The following tokens can be used in the recipient, subject, or message.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['help']['basic'] = array(
'#markup' => theme('flag_tokens_browser', array(
'types' => array(
'flag',
'flag-action',
),
)),
);
$form['help']['tokens'] = array(
'#type' => 'fieldset',
'#title' => t('More tokens'),
'#description' => t("Depending on the type of the content being flagged, the following tokens can be used in the recipients, subject, or message. For example, if the content being flagged is a node, you can use any of the node tokens --but you can't use the comment tokens: they won't be recognized. Similarly, if the content being flagged is a user, you can use only the user tokens."),
'#value' => theme('flag_tokens_browser', array(
'types' => $flag
->get_labels_token_types(),
'global_types' => FALSE,
)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
}