From 3f700f047e18f973d9c636ea6cb89e06da95e503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20Gyllensv=C3=A4rd?= Date: Thu, 30 Aug 2012 09:26:09 +0200 Subject: [PATCH] Issue #967566 by DocuAnt, mariusz.slonina, tsvensson, xjm, tim.plunkett, joestewart, oriol_e9g, letharion. Implement hook_field_extra_fields() to provide user settings for several core modules. --- core/modules/block/block.module | 2 +- core/modules/contact/contact.module | 13 +++++++++++++ core/modules/locale/locale.module | 13 +++++++++++++ core/modules/overlay/overlay.module | 13 +++++++++++++ core/modules/user/user.module | 20 ++++++++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 2592137..57e6689 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -631,7 +631,7 @@ function block_form_user_profile_form_alter(&$form, &$form_state) { function block_field_extra_fields() { $extra['user']['user']['form']['block'] = array( 'label' => t('Personalize blocks'), - 'description' => t('Block module form element.'), + 'description' => t('Block module form element. This element will not be present on all user account pages.'), 'weight' => 3, ); diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 1ba70b9..74303c6 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -270,3 +270,16 @@ function contact_form_user_admin_settings_submit($form, &$form_state) { ->set('user_default_enabled', $form_state['values']['contact_default_status']) ->save(); } + +/** + * Implements hook_field_extra_fields(). + */ +function contact_field_extra_fields() { + $extra['user']['user']['form']['contact'] = array( + 'label' => t('Contact'), + 'description' => t('Contact module form element. This element will not be present on all user account pages.'), + 'weight' => 5, + ); + + return $extra; +} diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index aec8978..f57b943 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -888,3 +888,16 @@ function locale_language_init() { // Add locale helper to configuration subscribers. drupal_container()->get('dispatcher')->addSubscriber(new LocaleConfigSubscriber()); } + +/** + * Implements hook_field_extra_fields(). + */ +function locale_field_extra_fields() { + $extra['user']['user']['form']['locale'] = array( + 'label' => t('Language settings'), + 'description' => t('Locale module form element. This element will not be present on all user account pages.'), + 'weight' => 1, + ); + + return $extra; +} diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 3aaed7d..80501b3 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -103,6 +103,19 @@ function overlay_form_user_profile_form_alter(&$form, &$form_state) { } /** + * Implements hook_field_extra_fields(). + */ +function overlay_field_extra_fields() { + $extra['user']['user']['form']['overlay_control'] = array( + 'label' => t('Administrative overlay'), + 'description' => t('Overlay module form element. This element will not be present on all user account pages.'), + 'weight' => 4, + ); + + return $extra; +} + +/** * Implements hook_user_presave(). */ function overlay_user_presave($account) { diff --git a/core/modules/user/user.module b/core/modules/user/user.module index e90c907..ce07760 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -248,6 +248,26 @@ function user_field_extra_fields() { ), ); + if (variable_get('user_pictures', 1) == 1) { + $return['user']['user']['form'] += array( + 'picture' => array( + 'label' => 'User picture', + 'description' => t('User module picture form element. This element will not be present on all user account pages.'), + 'weight' => 2, + ), + ); + } + + if (variable_get('user_signatures', 1) == 1) { + $return['user']['user']['form'] += array( + 'signature_settings' => array( + 'label' => 'User signature', + 'description' => t('User module signature form element. This element will not be present on all user account pages.This element will not be present on all user account pages.'), + 'weight' => 1, + ), + ); + } + return $return; } -- 1.7.9.5