public function LingotekSettingsTabUtilitiesForm::updateCallbackUrl in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8 src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 8.2 src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 4.0.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.0.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.1.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.2.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.3.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.4.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.5.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.7.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
- 3.8.x src/Form/LingotekSettingsTabUtilitiesForm.php \Drupal\lingotek\Form\LingotekSettingsTabUtilitiesForm::updateCallbackUrl()
File
- src/
Form/ LingotekSettingsTabUtilitiesForm.php, line 172
Class
- LingotekSettingsTabUtilitiesForm
- Tab for running Lingotek utilities in the settings page.
Namespace
Drupal\lingotek\FormCode
public function updateCallbackUrl() {
$new_callback_url = \Drupal::urlGenerator()
->generateFromRoute('lingotek.notify', [], [
'absolute' => TRUE,
]);
$config = $this
->configFactory()
->get('lingotek.settings');
$configEditable = $this
->configFactory()
->getEditable('lingotek.settings');
$configEditable
->set('account.callback_url', $new_callback_url);
$configEditable
->save();
$defaultProject = $config
->get('default.project');
$new_response = $this->lingotek
->setProjectCallBackUrl($defaultProject, $new_callback_url);
if ($new_response) {
$this
->messenger()
->addStatus($this
->t('The callback URL has been updated.'));
}
}