You are here

protected function CopyRemoteFlow::getCurrentFormStep in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/CopyRemoteFlow.php \Drupal\cms_content_sync\Form\CopyRemoteFlow::getCurrentFormStep()
  2. 2.1.x src/Form/CopyRemoteFlow.php \Drupal\cms_content_sync\Form\CopyRemoteFlow::getCurrentFormStep()

Return the current step of our multi-step form.

Return value

string

1 call to CopyRemoteFlow::getCurrentFormStep()
CopyRemoteFlow::form in src/Form/CopyRemoteFlow.php
Gets the actual form array to be built.

File

src/Form/CopyRemoteFlow.php, line 385

Class

CopyRemoteFlow
Form handler for the Pool add and edit forms.

Namespace

Drupal\cms_content_sync\Form

Code

protected function getCurrentFormStep(FormStateInterface $form_state) {
  if (!Migration::alwaysUseV2()) {
    if (empty($_GET['url'])) {
      return self::STEP_SYNC_CORE;
    }
    try {
      $client = SyncCoreFactory::getSyncCore($_GET['url']);
      $client
        ->getReportingService()
        ->getStatus();
    } catch (SyncCoreException $e) {
      $this->syncCoreError = $e;
      return self::STEP_SYNC_CORE;
    }
  }
  if (empty($form_state
    ->getValue('pools'))) {
    return self::STEP_POOLS;
  }
  if (empty($form_state
    ->getValue('flow'))) {
    return self::STEP_FLOW_LIST;
  }
  return self::STEP_FLOW_IMPORT;
}