You are here

function hosting_package_views_pre_build in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 package/includes/views/hosting_package.views.inc \hosting_package_views_pre_build()

Implements hook_views_pre_build().

File

package/includes/views/hosting_package.views.inc, line 300
Hosting package views integration.

Code

function hosting_package_views_pre_build(&$view) {

  // The site_count field doesn't make sense for sites.
  if ($view->name == 'hosting_package_list' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
    if ($node->type == 'site') {
      unset($view->field['site_count']);
      unset($view->display_handler->handlers['field']['site_count']);
    }
  }
}