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
8f7fb49a
Commit
8f7fb49a
authored
Aug 29, 2012
by
Matthias Hutterer
Browse files
Fixed contact form page callback.
parent
9e15a5dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
email.module
email.module
+12
-9
No files found.
email.module
View file @
8f7fb49a
...
...
@@ -256,12 +256,12 @@ function theme_email_textfield($element) {
* Implementation of hook_menu().
*/
function
email_menu
()
{
$items
[
'email/%/%'
]
=
array
(
$items
[
'email/%
node
/%'
]
=
array
(
'title'
=>
'Email Contact Form'
,
'page callback'
=>
'email_mail_page'
,
'page arguments'
=>
array
(
1
,
2
),
'access callback'
=>
'
user
_access'
,
'access arguments'
=>
array
(
'
access content'
),
'access callback'
=>
'
node
_access'
,
'access arguments'
=>
array
(
'
view'
,
1
),
'type'
=>
MENU_CALLBACK
,
);
$items
[
'admin/settings/email'
]
=
array
(
...
...
@@ -277,19 +277,22 @@ function email_menu() {
/**
* The contact form page.
*
* @param $node
* The node object on which the email address is stored.
* @param $field_name
* The name of the CCK field which holds the email address.
*
* @return
* Rendered page output containing either the contact form or a flood warning.
*/
function
email_mail_page
(
$nid
,
$field_name
)
{
if
(
!
is_numeric
(
$nid
))
{
drupal_not_found
();
return
;
}
function
email_mail_page
(
$node
,
$field_name
)
{
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
();
return
;
...
...
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