You are here

function lingotek_admin_account_status_form_submit in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.3 lingotek.admin.inc \lingotek_admin_account_status_form_submit()

Account Status Submit Handler

_state

Parameters

type $form:

File

./lingotek.admin.inc, line 85

Code

function lingotek_admin_account_status_form_submit($form, &$form_state) {
  $account = LingotekAccount::instance();
  $result = $account
    ->getAccountStatus();

  // Returns false on fail.
  if ($result === FALSE) {

    // There was a problem retrieving the account status.
    drupal_set_message(t('There was an error retrieving your account status.  Please try again later.'), 'error');
  }
  else {

    // We got a valid account status.  Send the user back to the Lingotek settings page, via the second cache clearer.
    drupal_set_message(t('Your account status has been updated.'));
    menu_rebuild();
  }
}