You are here

protected function LaunchExportForm::addDownloadIframe in Content Synchronizer 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/LaunchExportForm.php \Drupal\content_synchronizer\Form\LaunchExportForm::addDownloadIframe()
  2. 8 src/Form/LaunchExportForm.php \Drupal\content_synchronizer\Form\LaunchExportForm::addDownloadIframe()

Add a donwload hidden iframe.

Parameters

array $form: The build form array.

File

src/Form/LaunchExportForm.php, line 176

Class

LaunchExportForm
Launch Export Form.

Namespace

Drupal\content_synchronizer\Form

Code

protected function addDownloadIframe(array &$form) {
  if ($archiveUri = static::getRequestParam()) {
    if (file_exists($archiveUri)) {
      $form['archive'] = [
        '#type' => 'html_tag',
        '#tag' => 'iframe',
        '#attributes' => [
          'style' => [
            'display:none',
          ],
          'src' => file_create_url($archiveUri),
        ],
      ];
    }
  }
}