You are here

function lingotek_notify_url_update in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.3 lingotek.sync.inc \lingotek_notify_url_update()
  2. 7.4 lingotek.sync.inc \lingotek_notify_url_update()
  3. 7.5 lingotek.sync.inc \lingotek_notify_url_update()
  4. 7.6 lingotek.sync.inc \lingotek_notify_url_update()

Update the Notify URL (via API)

1 call to lingotek_notify_url_update()
lingotek_notify_url_check in ./lingotek.sync.inc
Notify URL Check - call lingotek_notify_url_update when lingotek_notify_url no longer matches lingotek_notify_url_generate()
1 string reference to 'lingotek_notify_url_update'
lingotek_admin_utilities_form in ./lingotek.admin.inc
Utilities Form

File

./lingotek.sync.inc, line 22
Sync and management

Code

function lingotek_notify_url_update($show_messages = TRUE) {
  $integration_id = variable_get('lingotek_integration_id', NULL);
  $success = LingotekSync::updateNotifyUrl();
  if ($show_messages) {
    if ($success) {
      if ($success === 'success') {
        drupal_set_message(t("Notification callback URL successfully updated."));
      }
      elseif ($success === 'localhost_url') {
        drupal_set_message(t("Lingotek will not be able to notify Drupal, since the callback URL contains <i>localhost</i>."), 'warning');
      }
    }
    else {
      drupal_set_message(t("Notification callback URL was not successfully updated."), 'error');
    }
  }
  return $success;
}