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
422f85d8
Commit
422f85d8
authored
Nov 09, 2007
by
Dries
Browse files
- Patch
#189852
by hswong3i: use schema API to update/insert the contact form records.
parent
beb7cfa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/contact/contact.admin.inc
View file @
422f85d8
...
...
@@ -110,13 +110,13 @@ function contact_admin_edit_submit($form, &$form_state) {
}
$form_state
[
'values'
][
'recipients'
]
=
implode
(
','
,
$recipients
);
if
(
empty
(
$form_state
[
'values'
][
'cid'
])
||
$form_state
[
'values'
][
'contact_op'
]
==
'add'
)
{
d
b_query
(
"INSERT INTO
{
contact
}
(category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)"
,
$form_state
[
'values'
][
'category'
],
$form_state
[
'values'
][
'recipients'
],
$form_state
[
'values'
][
'reply'
],
$form_state
[
'values'
][
'weight'
]
,
$form_state
[
'values'
]
[
'selected'
]
);
d
rupal_write_record
(
'contact'
,
$form_state
[
'values'
]);
drupal_set_message
(
t
(
'Category %category has been added.'
,
array
(
'%category'
=>
$form_state
[
'values'
][
'category'
])));
watchdog
(
'mail'
,
'Contact form: category %category added.'
,
array
(
'%category'
=>
$form_state
[
'values'
][
'category'
]),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
'admin/build/contact'
));
}
else
{
d
b_query
(
"UPDATE
{
contact
}
SET category = '%s', recipients = '%s', reply = '%s', weight = %d, selected = %d WHERE cid = %d"
,
$form_state
[
'values'
][
'category'
],
$form_state
[
'values'
][
'recipients'
],
$form_state
[
'values'
][
'reply'
],
$form_state
[
'values'
][
'weigh
t'
]
,
$form_state
[
'values'
]
[
'selected'
],
$form_state
[
'values'
][
'cid'
]
);
d
rupal_write_record
(
'contac
t'
,
$form_state
[
'values'
]
,
'cid'
);
drupal_set_message
(
t
(
'Category %category has been updated.'
,
array
(
'%category'
=>
$form_state
[
'values'
][
'category'
])));
watchdog
(
'mail'
,
'Contact form: category %category updated.'
,
array
(
'%category'
=>
$form_state
[
'values'
][
'category'
]),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
'admin/build/contact'
));
}
...
...
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