You are here

function template_preprocess_dxpr_gridstack_gridstack_row in DXPR GridStack 8

Same name and namespace in other branches
  1. 1.0.x theme.inc \template_preprocess_dxpr_gridstack_gridstack_row()

Implementation of template preprocess for the view row.

File

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

Code

function template_preprocess_dxpr_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;
    }
  }
}