You are here

protected function CopyRemoteFlow::getCurrentFormStep in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Form/CopyRemoteFlow.php \Drupal\cms_content_sync\Form\CopyRemoteFlow::getCurrentFormStep()
  2. 2.0.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 383

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 (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;
}