You are here

function views_ui_preprocess_views_view in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 views_ui/views_ui.module \views_ui_preprocess_views_view()

Theme preprocess for views-view.tpl.php.

File

./views_ui.module, line 401
Provide structure for the administrative interface to Views.

Code

function views_ui_preprocess_views_view(&$vars) {
  $view = $vars['view'];
  if (!empty($view->views_ui_context) && module_exists('contextual')) {
    $view->hide_admin_links = TRUE;
    $sections = array(
      'title',
      'header',
      'exposed',
      'rows',
      'pager',
      'more',
      'footer',
      'empty',
      'attachment_after',
      'attachment_before',
    );
    foreach ($sections as $section) {
      if (!empty($vars[$section])) {
        $vars[$section] = array(
          '#theme' => 'views_ui_view_preview_section',
          '#view' => $view,
          '#section' => $section,
          '#content' => is_array($vars[$section]) ? drupal_render($vars[$section]) : $vars[$section],
          '#theme_wrappers' => array(
            'views_container',
          ),
          '#attributes' => array(
            'class' => 'contextual-links-region',
          ),
        );
        $vars[$section] = drupal_render($vars[$section]);
      }
    }
  }
}