Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ba9f7f17
Commit
ba9f7f17
authored
Aug 10, 2006
by
Dries
Browse files
- Patch
#77668
by matthieu: fixed contact form.
parent
fd7c5f10
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/contact/contact.module
View file @
ba9f7f17
...
...
@@ -160,7 +160,7 @@ function contact_admin_categories() {
* Category edit page.
*/
function
contact_admin_edit
(
$cid
=
NULL
)
{
if
(
arg
(
2
)
==
"edit"
&&
$cid
>
0
)
{
if
(
arg
(
3
)
==
"edit"
&&
$cid
>
0
)
{
$edit
=
db_fetch_array
(
db_query
(
"SELECT * FROM
{
contact
}
WHERE cid = %d"
,
$cid
));
}
$form
[
'category'
]
=
array
(
'#type'
=>
'textfield'
,
...
...
@@ -236,7 +236,7 @@ function contact_admin_edit_submit($form_id, $form_values) {
$recipients
[
$key
]
=
trim
(
$recipient
);
}
$form_values
[
'recipients'
]
=
implode
(
','
,
$recipients
);
if
(
arg
(
2
)
==
'add'
)
{
if
(
arg
(
3
)
==
'add'
)
{
db_query
(
"INSERT INTO
{
contact
}
(category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)"
,
$form_values
[
'category'
],
$form_values
[
'recipients'
],
$form_values
[
'reply'
],
$form_values
[
'weight'
],
$form_values
[
'selected'
]);
drupal_set_message
(
t
(
'Category %category has been added.'
,
array
(
'%category'
=>
theme
(
'placeholder'
,
$form_values
[
'category'
]))));
watchdog
(
'mail'
,
t
(
'Contact form: category %category added.'
,
array
(
'%category'
=>
theme
(
'placeholder'
,
$form_values
[
'category'
]))),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
'admin/build/contact'
));
...
...
@@ -272,7 +272,7 @@ function contact_admin_delete($cid = NULL) {
* Process category delete form submission.
*/
function
contact_admin_delete_submit
(
$form_id
,
$form_values
)
{
db_query
(
"DELETE FROM
{
contact
}
WHERE cid = %d"
,
arg
(
3
));
db_query
(
"DELETE FROM
{
contact
}
WHERE cid = %d"
,
arg
(
4
));
drupal_set_message
(
t
(
'Category %category has been deleted.'
,
array
(
'%category'
=>
theme
(
'placeholder'
,
$form_values
[
'category'
]))));
watchdog
(
'mail'
,
t
(
'Contact form: category %category deleted.'
,
array
(
'%category'
=>
theme
(
'placeholder'
,
$form_values
[
'category'
]))),
WATCHDOG_NOTICE
);
...
...
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