diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-06 10:38:40 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-06 10:38:40 +0000 |
commit | a40002c76b4d3496e117da49c4f1fdfa2120caba (patch) | |
tree | 6ac8fe8fbc7f7004ec4d2876dca9052762b9f21a /modules/contact | |
parent | 4ef77a590c5d5d24bb788af2c043c0cebb5bf3fe (diff) | |
download | brdo-a40002c76b4d3496e117da49c4f1fdfa2120caba.tar.gz brdo-a40002c76b4d3496e117da49c4f1fdfa2120caba.tar.bz2 |
- Patch #453596 by Xano: clean-up of function names.
Diffstat (limited to 'modules/contact')
-rw-r--r-- | modules/contact/contact.module | 8 | ||||
-rw-r--r-- | modules/contact/contact.pages.inc | 28 |
2 files changed, 21 insertions, 15 deletions
diff --git a/modules/contact/contact.module b/modules/contact/contact.module index 22338dbb8..a93f7836f 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -101,10 +101,10 @@ function contact_menu() { ); $items['user/%user/contact'] = array( 'title' => 'Contact', - 'page callback' => 'contact_user_page', + 'page callback' => 'contact_personal_page', 'page arguments' => array(1), 'type' => MENU_LOCAL_TASK, - 'access callback' => '_contact_user_tab_access', + 'access callback' => '_contact_personal_tab_access', 'access arguments' => array(1), 'weight' => 2, ); @@ -112,9 +112,9 @@ function contact_menu() { } /** - * Determine if a user can access to the contact tab. + * Determine permission to a user's personal contact form. */ -function _contact_user_tab_access($account) { +function _contact_personal_tab_access($account) { global $user; if (!isset($account->contact)) { $account->contact = FALSE; diff --git a/modules/contact/contact.pages.inc b/modules/contact/contact.pages.inc index 65ac85a4f..3f3e5a1d1 100644 --- a/modules/contact/contact.pages.inc +++ b/modules/contact/contact.pages.inc @@ -23,13 +23,16 @@ function contact_site_page() { } } else { - $output = drupal_get_form('contact_mail_page'); + $output = drupal_get_form('contact_site_form'); } return $output; } -function contact_mail_page() { +/* + * Form builder; the site-wide contact form. + */ +function contact_site_form() { global $user; $categories = db_query("SELECT cid, category FROM {contact} ORDER BY weight, category")->fetchAllKeyed(); @@ -96,9 +99,9 @@ function contact_mail_page() { } /** - * Validate the site-wide contact page form submission. + * Form validation handler for contact_site_form(). */ -function contact_mail_page_validate($form, &$form_state) { +function contact_site_form_validate($form, &$form_state) { if (!$form_state['values']['cid']) { form_set_error('cid', t('You must select a valid category.')); } @@ -108,9 +111,9 @@ function contact_mail_page_validate($form, &$form_state) { } /** - * Process the site-wide contact page form submission. + * Form submission handler for contact_site_form(). */ -function contact_mail_page_submit($form, &$form_state) { +function contact_site_form_submit($form, &$form_state) { global $language; $values = $form_state['values']; @@ -148,7 +151,7 @@ function contact_mail_page_submit($form, &$form_state) { /** * Personal contact page. */ -function contact_user_page($account) { +function contact_personal_page($account) { global $user; if (!valid_email_address($user->mail)) { @@ -159,13 +162,16 @@ function contact_user_page($account) { } else { drupal_set_title($account->name); - $output = drupal_get_form('contact_mail_user', $account); + $output = drupal_get_form('contact_personal_form', $account); } return $output; } -function contact_mail_user(&$form_state, $recipient) { +/* + * Form builder; the personal contact form. + */ +function contact_personal_form(&$form_state, $recipient) { global $user; $form['#token'] = $user->name . $user->mail; $form['recipient'] = array('#type' => 'value', '#value' => $recipient); @@ -197,9 +203,9 @@ function contact_mail_user(&$form_state, $recipient) { } /** - * Process the personal contact page form submission. + * Form submission handler for contact_personal_form(). */ -function contact_mail_user_submit($form, &$form_state) { +function contact_personal_form_submit($form, &$form_state) { global $user, $language; $account = $form_state['values']['recipient']; |