diff --git a/mimemail.module b/mimemail.module index 16cc00e..c38dd09 100644 --- a/mimemail.module +++ b/mimemail.module @@ -38,6 +38,54 @@ function mimemail_incoming_access() { } /** + * Implements hook_field_extra_fields(). + */ +/*function mimemail_field_extra_fields() { + $return = array(); + $extra = mimemail_user_field_extra(); + $info = entity_get_info('user'); + foreach (array_keys($info['bundles']) as $bundle) { + $return['user'][$bundle] = $extra; + } + return $return; +}*/ + +function mimemail_user_field_extra() { + return array( + 'form' => array( + 'mimemail' => array( + 'label' => t('Email settings'), + 'description' => t('Email settings'), + 'weight' => 0, + ), + ), + 'display' => array( + 'mimemail' => array( + 'label' => t('Email settings'), + 'description' => t('Email settings'), + 'weight' => 0, + ), + ), + ); +} + +/** + * Implements hook_user_view(). + */ +function mimemail_user_view($account, $view_mode, $langcode) { + $account->content['mimemail'] = array( + '#type' => 'user_profile_category', + '#title' => t('Email settings'), + ); + + $account->content['mimemail']['textonly'] = array( + '#type' => 'user_profile_item', + '#title' => t('Plaintext email only'), + '#markup' => empty($account->data['mimemail_textonly']) ? t('No') : t('Yes'), + ); +} + +/** * Implements hook_form_FORM_ID_alter(). * * Adds the Mime Mail settings on the user settings page.