You are here

function route_planner_block_save in Route Planner 8

Same name and namespace in other branches
  1. 7 route_planner.module \route_planner_block_save()

Implements hook_block_save().

File

./route_planner.module, line 49
The Route Planner module create blocks to show a route from any address to a fixed point.

Code

function route_planner_block_save($delta = '', $edit = array()) {
  switch ($delta) {
    case 'route_target':
    case 'map':
      \Drupal::config('route_planner.settings')
        ->set('route_planner_address', $edit['route_planner_address']);
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_height', $edit['route_planner_map_height']);
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_width', $edit['route_planner_map_width']);
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_zoom', intval($edit['route_planner_map_zoom']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_zoomcontrol', intval($edit['route_planner_map_zoomcontrol']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_scrollwheel', intval($edit['route_planner_map_scrollwheel']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_maptypecontrol', intval($edit['route_planner_map_maptypecontrol']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_scalecontrol', intval($edit['route_planner_map_scalecontrol']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_draggable', intval($edit['route_planner_map_draggable']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_doubbleclick', intval($edit['route_planner_map_doubbleclick']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_streetviewcontrol', intval($edit['route_planner_map_streetviewcontrol']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_overviewmapcontrol', intval($edit['route_planner_map_overviewmapcontrol']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_unitsystem', intval($edit['route_planner_unitsystem']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_map_defaultui', intval($edit['route_planner_map_defaultui']));
      \Drupal::config('route_planner.settings')
        ->set('route_planner_api_key', $edit['route_planner_api_key']);
      \Drupal::config('route_planner.settings')
        ->set('route_planner_api_language', $edit['route_planner_api_language']);
      break;
  }
}