You are here

function messaging_user in Messaging 6.3

Same name and namespace in other branches
  1. 5 messaging.module \messaging_user()
  2. 6.4 messaging.module \messaging_user()
  3. 6 messaging.module \messaging_user()
  4. 6.2 messaging.module \messaging_user()

Implementation of hook_user().

Adds fieldset and default sending method setting.

File

./messaging.module, line 132

Code

function messaging_user($type, $edit, &$user, $category = NULL) {
  switch ($type) {
    case 'form':
      if ($category == 'account' && ($list = messaging_method_list($user))) {
        $form['messaging'] = array(
          '#type' => 'fieldset',
          '#title' => t('Messaging settings'),
          '#weight' => 5,
          '#collapsible' => TRUE,
        );
        $form['messaging']['messaging_default'] = array(
          '#type' => 'select',
          '#title' => t('Default send method'),
          '#default_value' => messaging_method_default($user),
          '#options' => $list,
          '#description' => t('Default sending method for getting messages from this system.'),
          '#disabled' => count($list) == 1,
        );
        return $form;
      }
      break;
  }
}