function views_ui_preprocess_views_view

views_ui_preprocess_views_view(&$variables)

Implements hook_preprocess_HOOK() for views templates.

File

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

Code

function views_ui_preprocess_views_view(&$variables) {
  $view = $variables['view'];

  // Render title for the admin preview.
  if (!empty($view->live_preview)) {
    $variables['title']['#markup'] = $view->getTitle();
  }

  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($variables[$section])) {
        $variables[$section] = array(
          '#theme' => 'views_ui_view_preview_section',
          '#view' => $view,
          '#section' => $section,
          '#content' => $variables[$section],
          '#theme_wrappers' => array('views_ui_container'),
          '#attributes' => array('class' => array('contextual-region')),
        );
      }
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!views_ui!views_ui.module/function/views_ui_preprocess_views_view/8.1.x