You are here

function opigno_module_preprocess_html in Opigno module 3.x

Same name and namespace in other branches
  1. 8 opigno_module.module \opigno_module_preprocess_html()

Implements hook_preprocess_page().

File

./opigno_module.module, line 227
Contains opigno_module.module.

Code

function opigno_module_preprocess_html(&$variables) {

  // Remove admin bar for item form (included in iframe)
  $route_name = \Drupal::routeMatch()
    ->getRouteName();
  if ($route_name == 'opigno_module.manager.get_item_form' || $route_name == 'opigno_module.add_external_package' || $route_name == 'opigno_module.add_external_package_ppt') {
    unset($variables['page_top']);
  }
  if ($route_name == 'opigno_module.group.answer_form') {
    $variables['attributes']['class'][] = 'section-module';
    if (!empty(\Drupal::request()->cookies
      ->get('fullscreen'))) {
      $variables['attributes']['class'][] = 'fullscreen';
    }
  }
}