You are here

function sms_user_settings in SMS Framework 7

Same name and namespace in other branches
  1. 5 modules/sms_user/sms_user.module \sms_user_settings()
  2. 6.2 modules/sms_user/sms_user.module \sms_user_settings()
  3. 6 modules/sms_user/sms_user.module \sms_user_settings()

Menu callback for user profile settings form.

Provides the forms for adding and confirming a user's mobile number.

Parameters

object $account: The user's account object.

Return value

string Rendered HTML for the account settings form.

1 string reference to 'sms_user_settings'
sms_user_menu_alter in modules/sms_user/sms_user.module
Implements hook_menu_alter().

File

modules/sms_user/sms_user.module, line 250
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_settings($account) {
  $output = array();
  switch (isset($account->sms_user) ? $account->sms_user['status'] : 0) {
    case 0:
      $output['number_form'] = drupal_get_form('sms_user_settings_add_form', $account);
      break;
    case SMS_USER_PENDING:
      $output['number_form'] = drupal_get_form('sms_user_settings_confirm_form', $account);
      break;
    case SMS_USER_CONFIRMED:
    case SMS_USER_SMS_REGISTERED:
      $output['number_form'] = drupal_get_form('sms_user_settings_reset_form', $account);
      break;
  }
  if (variable_get('sms_user_sleep', 1) && $account->sms_user['number'] && $account->sms_user['status'] == SMS_USER_CONFIRMED) {
    $output['sleep_form'] = drupal_get_form('sms_user_settings_sleep_form', $account);
  }
  if (variable_get('sms_user_allow_opt_out', 1) && $account->sms_user['number'] && $account->sms_user['status'] == SMS_USER_CONFIRMED) {
    $output['opt_out_form'] = drupal_get_form('sms_user_opt_out_form', $account);
  }
  return drupal_render($output);
}