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
c964a719
Commit
c964a719
authored
Jul 30, 2008
by
Matthias Hutterer
Browse files
added 'sortable' to db definitions, support for content permissions in
contact forms
parent
cf887375
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
email.module
email.module
+9
-2
No files found.
email.module
View file @
c964a719
...
...
@@ -29,7 +29,7 @@ function email_theme() {
function
email_field_info
()
{
return
array
(
'email'
=>
array
(
'label'
=>
'E
-M
ail'
,
'label'
=>
'E
m
ail'
,
'callbacks'
=>
array
(
'tables'
=>
CONTENT_CALLBACK_DEFAULT
,
'arguments'
=>
CONTENT_CALLBACK_DEFAULT
,
...
...
@@ -45,7 +45,7 @@ function email_field_info() {
function
email_field_settings
(
$op
,
$field
)
{
switch
(
$op
)
{
case
'database columns'
:
$columns
[
'email'
]
=
array
(
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
FALSE
);
$columns
[
'email'
]
=
array
(
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
FALSE
,
'sortable'
=>
TRUE
);
return
$columns
;
}
}
...
...
@@ -224,6 +224,7 @@ function email_textfield_process($element, $edit, $form_state, $form) {
'#description'
=>
t
(
$field
[
'widget'
][
'description'
]),
'#required'
=>
$element
[
'#required'
],
'#maxlength'
=>
255
,
'#size'
=>
isset
(
$field
[
'widget'
][
'size'
])
?
$field
[
'widget'
][
'size'
]
:
60
,
'#default_value'
=>
isset
(
$element
[
'#value'
][
$field_key
])
?
$element
[
'#value'
][
$field_key
]
:
NULL
,
);
return
$element
;
...
...
@@ -260,6 +261,12 @@ function email_mail_page($nid, $field_name) {
drupal_not_found
();
return
;
}
if
(
module_exists
(
'content_permissions'
))
{
if
(
!
user_access
(
'view '
.
$field_name
))
{
drupal_not_found
();
return
;
}
}
$node
=
node_load
(
intval
(
$nid
));
if
(
!
$node
)
{
drupal_not_found
();
...
...
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