summaryrefslogtreecommitdiff
path: root/modules/contact
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-16 19:06:25 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-16 19:06:25 +0000
commit60c5878351cc547dbfda260fefcf378491c958ec (patch)
tree9985db3bf964c09cb8564b54c79f345d773edf21 /modules/contact
parent4430d46334127c69d5ff97ce2e15475c0fae2654 (diff)
downloadbrdo-60c5878351cc547dbfda260fefcf378491c958ec.tar.gz
brdo-60c5878351cc547dbfda260fefcf378491c958ec.tar.bz2
- Patch #593746 by #593746 by sun, andypost: prepare Drupal core for dynamic data translation.
Diffstat (limited to 'modules/contact')
-rw-r--r--modules/contact/contact.install1
-rw-r--r--modules/contact/contact.pages.inc8
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/contact/contact.install b/modules/contact/contact.install
index ac245d586..42f15272d 100644
--- a/modules/contact/contact.install
+++ b/modules/contact/contact.install
@@ -25,6 +25,7 @@ function contact_schema() {
'not null' => TRUE,
'default' => '',
'description' => 'Category name.',
+ 'translatable' => TRUE,
),
'recipients' => array(
'type' => 'text',
diff --git a/modules/contact/contact.pages.inc b/modules/contact/contact.pages.inc
index 2855bec83..fa5606448 100644
--- a/modules/contact/contact.pages.inc
+++ b/modules/contact/contact.pages.inc
@@ -24,7 +24,13 @@ function contact_site_form($form, &$form_state) {
}
// Get an array of the categories and the current default category.
- $categories = db_query("SELECT cid, category FROM {contact} ORDER BY weight, category")->fetchAllKeyed();
+ $categories = db_select('contact', 'c')
+ ->addTag('translatable')
+ ->fields('c', array('cid', 'category'))
+ ->orderBy('weight')
+ ->orderBy('category')
+ ->execute()
+ ->fetchAllKeyed();
$default_category = db_query("SELECT cid FROM {contact} WHERE selected = 1")->fetchField();
// If there are no categories, do not display the form.