You are here

function template_preprocess_sooperthemes_gridstack_gridstack_row in Sooperthemes GridStack 8

Implementation of template preprocess for the view row.

File

./theme.inc, line 63
Preprocess functions for SooperThemes GridStack module.

Code

function template_preprocess_sooperthemes_gridstack_gridstack_row(&$vars) {

  /** @var \Drupal\views\ViewExecutable $view */
  $view =& $vars['view'];
  $fields =& drupal_static(__FUNCTION__);
  if (!$fields) {
    $fields = $view->display_handler
      ->getOption('fields');
  }
  foreach ($vars['options'] as $id => $field) {
    switch ($id) {
      case 'image':
      case 'title':
      case 'category':
        if (isset($fields[$field]) && !$fields[$field]['exclude']) {
          $vars[$id] = $view->style_plugin
            ->getField($vars['row']->index, $field);
        }
        break;
    }
  }
}