You are here

function template_preprocess_views_view_list in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 theme/theme.inc \template_preprocess_views_view_list()
  2. 6.3 theme/theme.inc \template_preprocess_views_view_list()
  3. 6.2 theme/theme.inc \template_preprocess_views_view_list()

Display the view as an HTML list element.

File

theme/theme.inc, line 875
Preprocessors and helper functions to make theming easier.

Code

function template_preprocess_views_view_list(&$vars) {
  $handler = $vars['view']->style_plugin;
  $class = explode(' ', $handler->options['class']);
  $class = array_map('views_clean_css_identifier', $class);
  $wrapper_class = explode(' ', $handler->options['wrapper_class']);
  $wrapper_class = array_map('views_clean_css_identifier', $wrapper_class);
  $vars['class'] = implode(' ', $class);
  $vars['wrapper_class'] = implode(' ', $wrapper_class);
  $vars['wrapper_prefix'] = '';
  $vars['wrapper_suffix'] = '';
  $vars['list_type_prefix'] = '<' . $handler->options['type'] . '>';
  $vars['list_type_suffix'] = '</' . $handler->options['type'] . '>';
  if ($vars['wrapper_class']) {
    $vars['wrapper_prefix'] = '<div class="' . $vars['wrapper_class'] . '">';
    $vars['wrapper_suffix'] = '</div>';
  }
  if ($vars['class']) {
    $vars['list_type_prefix'] = '<' . $handler->options['type'] . ' class="' . $vars['class'] . '">';
  }
  template_preprocess_views_view_unformatted($vars);
}