You are here

function restrict_ip_preprocess_page in Restrict IP 7

Same name and namespace in other branches
  1. 8.2 restrict_ip.module \restrict_ip_preprocess_page()
  2. 8 restrict_ip.module \restrict_ip_preprocess_page()
  3. 6 restrict_ip.module \restrict_ip_preprocess_page()
  4. 7.2 restrict_ip.module \restrict_ip_preprocess_page()
  5. 3.x restrict_ip.module \restrict_ip_preprocess_page()

Override of template_preprocess_page()

This function removes the data from various areas of the page for users whose accounts have been blocked, preventing the areas from being rendered

File

./restrict_ip.module, line 259

Code

function restrict_ip_preprocess_page(&$items) {
  if (restrict_ip_value()) {
    global $theme;
    $regions = system_region_list($theme, REGIONS_ALL);
    foreach (array_keys($regions) as $region) {
      if (isset($items['page'][$region])) {
        $items['page'][$region] = '';
      }
    }
    if (isset($items['tabs'])) {
      if (isset($items['tabs']['#primary'])) {
        $items['tabs']['#primary'] = array();
      }
      if (isset($items['tabs']['#secondary'])) {
        $items['tabs']['#primary'] = array();
      }
    }
    $items['title_prefix'] = array();
    $items['title_suffix'] = array();
    $items['main_menu'] = array();
    $items['secondary_menu'] = array();
    $items['action_links'] = array();
  }
}