function responsive_menu_preprocess_html in Responsive and off-canvas menu 4.3.x
Same name and namespace in other branches
- 8.3 responsive_menu.module \responsive_menu_preprocess_html()
- 8.2 responsive_menu.module \responsive_menu_preprocess_html()
- 4.4.x responsive_menu.module \responsive_menu_preprocess_html()
- 4.0.x responsive_menu.module \responsive_menu_preprocess_html()
- 4.1.x responsive_menu.module \responsive_menu_preprocess_html()
Implements hook_preprocess_html().
Used to add an optional page wrapper.
File
- ./
responsive_menu.module, line 89 - Contains procedural code.
Code
function responsive_menu_preprocess_html(&$variables) {
// Get the configuration.
$config = \Drupal::config('responsive_menu.settings');
// If this is the admin theme then add the wrapper if requested.
if (_current_theme_is_admin()) {
if ($config
->get('allow_admin') && $config
->get('wrapper_admin')) {
$variables['page']['#theme_wrappers'][] = 'responsive_menu_page_wrapper';
}
}
else {
// If this not the admin theme then only add the wrapper when
// the config is enabled.
if ($config
->get('wrapper_theme') == TRUE) {
$variables['page']['#theme_wrappers'][] = 'responsive_menu_page_wrapper';
}
}
}