You are here

protected function LingotekConfigManagementForm::getSourceActionUrl in Lingotek Translation 3.3.x

Same name and namespace in other branches
  1. 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceActionUrl()
  2. 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceActionUrl()
  3. 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceActionUrl()
  4. 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceActionUrl()
  5. 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceActionUrl()
  6. 3.2.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 1646

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 || $source_status == Lingotek::STATUS_CANCELLED) {
    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;
}