You are here

function sms_user_settings in SMS Framework 5

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

Menu callback; provides the forms for adding and confirming a user's mobile number.

1 string reference to 'sms_user_settings'
sms_user_menu in modules/sms_user/sms_user.module
Implementation of hook_menu().

File

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

Code

function sms_user_settings($register = FALSE) {
  $account = user_load(array(
    'uid' => arg(1),
  ));
  switch (isset($account->sms_user) ? $account->sms_user[0]['status'] : 0) {
    case 0:
      $output = drupal_get_form('sms_user_settings_add_form', $account);
      break;
    case SMS_USER_PENDING:
      $output = drupal_get_form('sms_user_settings_confirm_form', $account);
      break;
    case SMS_USER_CONFIRMED:
      $output = drupal_get_form('sms_user_settings_reset_form', $account);
      break;
  }
  if (variable_get('sms_user_sleep', 1)) {
    $output .= drupal_get_form('sms_user_settings_sleep_form', $account);
  }
  return $output;
}