You are here

function restrict_ip_preprocess_html in Restrict IP 8

Same name and namespace in other branches
  1. 8.2 restrict_ip.module \restrict_ip_preprocess_html()
  2. 7.2 restrict_ip.module \restrict_ip_preprocess_html()
  3. 7 restrict_ip.module \restrict_ip_preprocess_html()
  4. 3.x restrict_ip.module \restrict_ip_preprocess_html()

Override of template_preprocess_html()

This function unsets $page_top and $page_bottom so that they are not passed to html.tpl.php, preventing these regions from being rendered

File

./restrict_ip.module, line 84

Code

function restrict_ip_preprocess_html(&$build) {
  if (\Drupal::service('restrict_ip.service')
    ->userIsBlocked()) {
    if (isset($build['page_top'])) {
      unset($build['page_top']);
    }
    if (isset($build['page_top'])) {
      unset($build['page_bottom']);
    }
  }
}