You are here

protected function LingotekConfigManagementForm::getSourceActionUrl in Lingotek Translation 8

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

Parameters

\Drupal\config_translation\ConfigMapperInterface $mapper: The mapper.

String $source_status:

Return value

\Drupal\Core\Url

1 call to LingotekConfigManagementForm::getSourceActionUrl()
LingotekConfigManagementForm::getSourceStatus in src/Form/LingotekConfigManagementForm.php
Gets the source status of an config in a format ready to display.

File

src/Form/LingotekConfigManagementForm.php, line 1245
Contains \Drupal\Lingotek\Form\LingotekConfigManagementForm.

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getSourceActionUrl(ConfigMapperInterface &$mapper, $source_status) {
  $url = NULL;
  $args = $this
    ->getActionUrlArguments($mapper);
  $document_id = $mapper instanceof ConfigEntityMapper ? $this->translationService
    ->getDocumentId($mapper
    ->getEntity()) : $this->translationService
    ->getConfigDocumentId($mapper);
  if ($source_status == Lingotek::STATUS_IMPORTING) {
    $url = Url::fromRoute('lingotek.config.check_upload', $args, [
      'query' => $this
        ->getDestinationArray(),
    ]);
  }
  if ($source_status == Lingotek::STATUS_EDITED || $source_status == Lingotek::STATUS_UNTRACKED || $source_status == Lingotek::STATUS_ERROR) {
    if ($document_id) {
      $url = Url::fromRoute('lingotek.config.update', $args, [
        'query' => $this
          ->getDestinationArray(),
      ]);
    }
    else {
      $url = Url::fromRoute('lingotek.config.upload', $args, [
        'query' => $this
          ->getDestinationArray(),
      ]);
    }
  }
  return $url;
}