Commit 8cb7f31e authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

#754554 by puckbag, roderik, alex_b: added plain text email formatter

parent 67b2306c
...@@ -20,6 +20,9 @@ function email_theme() { ...@@ -20,6 +20,9 @@ function email_theme() {
'email_formatter_contact' => array( 'email_formatter_contact' => array(
'arguments' => array('element' => NULL), 'arguments' => array('element' => NULL),
), ),
'email_formatter_plain' => array(
'arguments' => array('element' => NULL),
),
); );
} }
...@@ -99,6 +102,11 @@ function email_field_formatter_info() { ...@@ -99,6 +102,11 @@ function email_field_formatter_info() {
'field types' => array('email'), 'field types' => array('email'),
'multiple values' => CONTENT_HANDLE_CORE, 'multiple values' => CONTENT_HANDLE_CORE,
), ),
'plain' => array(
'label' => t('Email plain text'),
'field types' => array('email'),
'multiple values' => CONTENT_HANDLE_CORE,
),
); );
if (module_exists('spamspan')) { if (module_exists('spamspan')) {
$formats += array( $formats += array(
...@@ -141,6 +149,13 @@ function theme_email_formatter_contact($element) { ...@@ -141,6 +149,13 @@ function theme_email_formatter_contact($element) {
return !empty($element['#item']['safe']) ? l(t('Email contact form'), 'email/'. $element['#node']->nid .'/'. $element['#field_name']) : ''; return !empty($element['#item']['safe']) ? l(t('Email contact form'), 'email/'. $element['#node']->nid .'/'. $element['#field_name']) : '';
} }
/**
* Theme function for 'plain' email field formatter.
*/
function theme_email_formatter_plain($element) {
return !empty($element['#item']['safe']) ? $element['#item']['safe'] : '';
}
/** /**
* Implementation of hook_widget_info(). * Implementation of hook_widget_info().
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment