From 60c5878351cc547dbfda260fefcf378491c958ec Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 16 Oct 2009 19:06:25 +0000 Subject: - Patch #593746 by #593746 by sun, andypost: prepare Drupal core for dynamic data translation. --- modules/contact/contact.install | 1 + modules/contact/contact.pages.inc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'modules/contact') 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. -- cgit v1.2.3