You are here

function hosting_site_block_view_alter in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 site/hosting_site.module \hosting_site_block_view_alter()

Implements hook_block_view_alter().

@see: hosting_site_views_pre_build().

File

site/hosting_site.module, line 798
Contains hook implementations for Hosting site module.

Code

function hosting_site_block_view_alter(&$data, $block) {
  if ($block->delta == 'hosting_site_list-block_sites') {
    if ($node = menu_get_object()) {

      // We only want to show a list of sites on a server with a database,
      // or on install profile package pages.
      if ($node->type == 'server' && !array_key_exists('db', $node->services) || $node->type == 'package' && $node->package_type != 'profile') {
        unset($data['subject']);
        unset($data['content']);
      }
    }
  }
}