function views_ui_preprocess_views_view

Implements hook_preprocess_HOOK() for views-view.html.twig.

File

drupal/core/modules/views_ui/views_ui.module, line 233
Provide structure for the administrative interface to Views.

Code

function views_ui_preprocess_views_view(&$vars) {
  $view = $vars['view'];
  if (!empty($view->live_preview) && Drupal::moduleHandler()
    ->moduleExists('contextual')) {
    $view
      ->setShowAdminLinks(FALSE);
    foreach (array(
      'title',
      'header',
      'exposed',
      'rows',
      'pager',
      'more',
      'footer',
      'empty',
      'attachment_after',
      'attachment_before',
    ) as $section) {
      if (!empty($vars[$section])) {
        $vars[$section] = array(
          '#theme' => 'views_ui_view_preview_section',
          '#view' => $view,
          '#section' => $section,
          '#content' => $vars[$section],
          '#theme_wrappers' => array(
            'views_ui_container',
          ),
          '#attributes' => array(
            'class' => 'contextual-region',
          ),
        );
        $vars[$section] = $vars[$section];
      }
    }
  }
}