// If _batch_page() returns a response object (likely a JsonResponse for
// JavaScript-based batch processing), send it immediately.
if ($content instanceof Response
) { $content->
send();
exit;
} } else { if (!
$request->
getSession()->
has('authorize_operation'
) || !
$request->
getSession()->
has('authorize_filetransfer_info'
)) { $content =
['#markup' =>
t('It appears you have reached this page in error.'
)];
} elseif (!
$batch =
batch_get()) { // We have a batch to process, show the filetransfer form.
try { $content = \Drupal::
formBuilder()->
getForm('Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm'
);
} catch (EnforcedResponseException
$e) { $e->
getResponse()->
send();
exit;
} } } // We defer the display of messages until all operations are done.