Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
email
Commits
8cb7f31e
Commit
8cb7f31e
authored
Aug 17, 2010
by
Matthias Hutterer
Browse files
#754554 by puckbag, roderik, alex_b: added plain text email formatter
parent
67b2306c
Changes
1
Hide whitespace changes
Inline
Side-by-side
email.module
View file @
8cb7f31e
...
@@ -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().
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment