<?php
// $Id$

/**
 * @file
 *
 */

function bcd_views_pre_render(&$view) {
  if ($view->name == 'nearby_map' && $view->current_display == 'local_communities') {
    $country = variable_get('bcd_country', FALSE);
    if (empty($view->result) || (!empty($country) && $_SESSION['smart_ip']['location']['country_code'] != $country) ) {
      $text = t('Please choose a state or use the search form to find local communities.');
      drupal_add_css('.openlayers-container.openlayers-container-map-nearby{display:none;}
        .view-nearby-map:after{
          content:"' . $text . '";
          display:block;
        }', array('type' => 'inline'));
    }
  }
}
