You are here

public function LingotekSettingsTabUtilitiesForm::updateCallbackUrl in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 8 src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  2. 4.0.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  3. 3.0.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  4. 3.1.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  5. 3.2.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  6. 3.3.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  7. 3.4.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  8. 3.5.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  9. 3.6.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  10. 3.7.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
  11. 3.8.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()

File

src/Form/LingotekSettingsTabUtilitiesForm.php, line 168

Class

LingotekSettingsTabUtilitiesForm
Tab for running Lingotek utilities in the settings page.

Namespace

Drupal\lingotek\Form

Code

public function updateCallbackUrl() {
  $new_callback_url = \Drupal::urlGenerator()
    ->generateFromRoute('lingotek.notify', [], [
    'absolute' => TRUE,
  ]);
  $this->lingotek
    ->set('account.callback_url', $new_callback_url);
  $new_response = $this->lingotek
    ->setProjectCallBackUrl($this->lingotek
    ->get('default.project'), $new_callback_url);
  if ($new_response) {
    $this
      ->messenger()
      ->addStatus($this
      ->t('The callback URL has been updated.'));
  }
}