You are here

splashify.module in Splashify 8.2

Same filename and directory in other branches
  1. 6 splashify.module
  2. 7 splashify.module

File

splashify.module
View source
<?php

/**
 * Implements hook_preprocess_HOOK().
 */
function splashify_preprocess_html(&$variables) {
  $route = \Drupal::routeMatch()
    ->getRouteObject();
  $is_admin = \Drupal::service('router.admin_context')
    ->isAdminRoute($route);
  if ($is_admin) {
    return;
  }
  $splash = \Drupal::service('splashify.injection')
    ->getAttach();
  if (!empty($splash)) {
    array_unshift($variables['page_top'], $splash);
  }
}

/**
 * Implements hook_theme().
 */
function splashify_theme($existing, $type, $theme, $path) {
  return [
    'splashify' => [
      'variables' => [
        'splashify_content' => NULL,
      ],
    ],
  ];
}

Functions