annotate vendor/chi-teck/drupal-code-generator/templates/d7/hook/batch_alter.twig @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
rev   line source
Chris@0 1 /**
Chris@0 2 * Implements hook_batch_alter().
Chris@0 3 */
Chris@0 4 function {{ machine_name }}_batch_alter(&$batch) {
Chris@0 5 // If the current page request is inside the overlay, add ?render=overlay to
Chris@0 6 // the success callback URL, so that it appears correctly within the overlay.
Chris@0 7 if (overlay_get_mode() == 'child') {
Chris@0 8 if (isset($batch['url_options']['query'])) {
Chris@0 9 $batch['url_options']['query']['render'] = 'overlay';
Chris@0 10 }
Chris@0 11 else {
Chris@0 12 $batch['url_options']['query'] = array('render' => 'overlay');
Chris@0 13 }
Chris@0 14 }
Chris@0 15 }