You are here

function template_preprocess_responsive_menu_block_wrapper in Responsive and off-canvas menu 7.2

Same name and namespace in other branches
  1. 7.3 responsive_menu.module \template_preprocess_responsive_menu_block_wrapper()
  2. 7 responsive_menu.module \template_preprocess_responsive_menu_block_wrapper()

Preprocess variables for responsive-menu-block-wrapper.tpl.php.

See also

responsive-menu-block-wrapper.tpl.php

File

./responsive_menu.module, line 152

Code

function template_preprocess_responsive_menu_block_wrapper(&$variables) {
  $variables['classes_array'][] = 'responsive-menu-block';
  $variables['classes_array'][] = 'menu-name-' . variable_get('responsive_menu_menu', 'main-menu');
  $variables['element_type'] = variable_get('responsive_menu_element', 'nav');
  $variables['content']['#attached']['css'] = array(
    array(
      'data' => '@media screen and ' . variable_get('responsive_menu_media_query', '(min-width: 960px)') . '{ .responsive-menu-block-wrapper.responsive-menu-block { display: block; } #block-responsive-menu-toggle { display: none; } }',
      'type' => 'inline',
    ),
  );

  // Add the module's css file if the user does not want to disable it.
  if (variable_get('responsive_menu_css', TRUE)) {
    $variables['content']['#attached']['css'][drupal_get_path('module', 'responsive_menu') . '/css/responsive_menu.css'] = array();
  }
  $variables['content']['#attached']['js'][] = array(
    'data' => array(
      'responsive_menu' => array(
        'position' => variable_get('responsive_menu_position', 'left'),
        'theme' => variable_get('responsive_menu_theme', 'theme-dark'),
        'breakpoint' => variable_get('responsive_menu_breakpoint', FALSE),
        'superfish' => array(
          'delay' => variable_get('responsive_menu_superfish_delay', 300),
          'speed' => variable_get('responsive_menu_superfish_speed', 100),
          'speedOut' => variable_get('responsive_menu_superfish_speed_out', 100),
        ),
      ),
    ),
    'type' => 'setting',
  );
}