You are here

function ip_geoloc_block_save in IP Geolocation Views & Maps 7

Implements hook_block_save().

File

./ip_geoloc_blocks.inc, line 331
Blocks available in IP Geolocation Views & Maps.

Code

function ip_geoloc_block_save($delta = '', $edit = array()) {
  if ($delta == 'address_lookup') {
    return;
  }
  if ($delta == 'geocode_address') {
    foreach ($edit as $variable => $value) {
      if (strpos($variable, 'ip_geoloc') === 0) {
        variable_set($variable, $value);
      }
    }
    return;
  }

  // Save options common to all maps.
  variable_set('ip_geoloc_' . $delta . '_div_style', $edit['ip_geoloc_' . $delta . '_div_style']);
  ip_geoloc_save_map_options('ip_geoloc_' . $delta . '_options', $edit['ip_geoloc_' . $delta . '_options']);
  switch ($delta) {
    case 'recent_visitors_map':
      variable_set('ip_geoloc_recent_visitors_map_number_of_visitors', $edit['ip_geoloc_recent_visitors_map_number_of_visitors']);
      break;
  }
}