You are here

function lingotek_admin_account_status_form_submit in Lingotek Translation 7.3

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

Account Status Submit Handler

_state

Parameters

type $form:

1 string reference to 'lingotek_admin_account_status_form_submit'
lingotek_admin_account_status_form in ./lingotek.admin.inc
Form constructor for the administration form.

File

./lingotek.admin.inc, line 78

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();
  }
}