You are here

function template_preprocess_tb_megamenu_row in The Better Mega Menu 8

Same name and namespace in other branches
  1. 7 tb_megamenu.themes.inc \template_preprocess_tb_megamenu_row()
  2. 2.x tb_megamenu.module \template_preprocess_tb_megamenu_row()

Prepare variables for tb_megamenu_row.

Parameters

array $vars: Variables are declared in theme.

File

./tb_megamenu.module, line 164
TB Mega Menu.

Code

function template_preprocess_tb_megamenu_row(array &$vars) {
  $row = $vars['row'];
  $vars['columns'] = [];
  foreach ($row as $col) {
    $vars['columns'][] = [
      '#theme' => 'tb_megamenu_column',
      '#menu_name' => $vars['menu_name'],
      '#col' => $col,
      '#parent' => $vars['parent'],
      '#level' => $vars['level'],
      '#menu_config' => $vars['menu_config'],
      '#block_config' => $vars['block_config'],
      '#trail' => $vars['trail'],
      '#section' => $vars['section'],
    ];
  }
  $vars['attributes'] = new Attribute();
  $vars['attributes']['class'] = [];
  $theme_name = str_replace('_', '-', $vars['theme_hook_original']);
  $vars['attributes']['class'][] = $theme_name;
  $vars['attributes']['class'][] = 'row-fluid';
}