Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
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
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
email.module
email.module
+15
-0
No files found.
email.module
View file @
8cb7f31e
...
...
@@ -20,6 +20,9 @@ function email_theme() {
'email_formatter_contact'
=>
array
(
'arguments'
=>
array
(
'element'
=>
NULL
),
),
'email_formatter_plain'
=>
array
(
'arguments'
=>
array
(
'element'
=>
NULL
),
),
);
}
...
...
@@ -99,6 +102,11 @@ function email_field_formatter_info() {
'field types'
=>
array
(
'email'
),
'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'
))
{
$formats
+=
array
(
...
...
@@ -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'
])
:
''
;
}
/**
* 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().
...
...
Write
Preview
Markdown
is supported
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