1.20.x views.theme.inc template_preprocess_views_view_list(&$variables)

Display the view as an HTML list element

File

modules/views/templates/views.theme.inc, line 929
Preprocessors and helper functions to make theme development easier.

Code

function template_preprocess_views_view_list(&$variables) {
  $handler = $variables['view']->style_plugin;

  $classes = explode(' ', $handler->options['class']);
  foreach ($classes as $key => $class) {
    $classes[$key] = backdrop_clean_css_identifier($class, array());
  }

  $wrapper_classes = explode(' ', $handler->options['wrapper_class']);
  foreach ($wrapper_classes as $key => $class) {
    $wrapper_classes[$key] = backdrop_clean_css_identifier($class, array());
  }

  $variables['class'] = implode(' ', $classes);
  $variables['wrapper_class'] = implode(' ', $wrapper_classes);
  $variables['wrapper_prefix'] = '';
  $variables['wrapper_suffix'] = '';
  $variables['list_type_prefix'] = '<' . $handler->options['type'] . '>';
  $variables['list_type_suffix'] = '</' . $handler->options['type'] . '>';
  if ($variables['wrapper_class']) {
    $variables['wrapper_prefix'] = '<div class="' . $variables['wrapper_class'] . '">';
    $variables['wrapper_suffix'] = '</div>';
  }

  if ($variables['class']) {
    $variables['list_type_prefix'] = '<' . $handler->options['type'] . ' class="' . $variables['class'] . '">';
  }
  template_preprocess_views_view_unformatted($variables);
}