You are here

function template_preprocess_uikit_view_list in UIkit Components 7.3

Same name and namespace in other branches
  1. 8.3 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_list()
  2. 8 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_list()
  3. 8.2 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_list()
  4. 7.2 uikit_views/templates/uikit_views.theme.inc \template_preprocess_uikit_view_list()

Prepares variables for UIkit List templates.

Default template: uikit-view-list.tpl.php.

Parameters

array $variables: An associative array containing:

  • view: A ViewExecutable object.
  • rows: The raw row data.
1 string reference to 'template_preprocess_uikit_view_list'
uikit_views_theme in uikit_views/uikit_views.module
Implements hook_theme().

File

uikit_views/templates/uikit_views.theme.inc, line 134
Preprocessors and helper functions to make theming easier.

Code

function template_preprocess_uikit_view_list(&$variables) {
  $handler = $variables['view']->style_plugin;
  $options = $handler->options;
  $variables['list_attributes_array']['class'] = array(
    'uk-list',
  );
  if ($options['modifier'] != 'default') {
    $variables['list_attributes_array']['class'][] = $options['modifier'];
  }
  if ($options['large_modifier']) {
    $variables['list_attributes_array']['class'][] = 'uk-list-large';
  }
  $variables['wrapper_attributes_array'] = array();
  if ($options['wrapper_class']) {
    $wrapper_classes = explode(' ', $options['wrapper_class']);
    foreach ($wrapper_classes as $wrapper_class) {
      $variables['wrapper_attributes_array']['class'][] = $wrapper_class;
    }
  }
}