You are here

function getdirections_direction_box in Get Directions 7.3

Same name and namespace in other branches
  1. 6.2 getdirections.module \getdirections_direction_box()
  2. 7.2 getdirections.module \getdirections_direction_box()

for colorbox and suchlike

1 string reference to 'getdirections_direction_box'
getdirections_menu in ./getdirections.module
Implement hook_menu().

File

./getdirections.module, line 1611
Fetches google map directions.

Code

function getdirections_direction_box() {
  $a1 = FALSE;
  $a2 = FALSE;
  $a3 = FALSE;
  $a4 = FALSE;
  if (arg(1)) {
    $a1 = arg(1);
  }
  if (arg(2)) {
    $a2 = arg(2);
  }
  if (arg(3)) {
    $a3 = arg(3);
  }
  if (arg(4)) {
    $a4 = arg(4);
  }
  if ($a1 == 'location' && ($a2 == 'from' || $a2 == 'to') && is_numeric($a3)) {
    $content = getdirections_node_setlocation($a2, $a3);
  }
  elseif ($a1 == 'locations' && is_numeric($a2) && is_numeric($a3)) {
    $content = getdirections_node_setlocations($a2, $a3);
  }
  elseif ($a1 == 'locations_via' && $a2) {
    $content = getdirections_node_setlocations_via($a2);
  }
  elseif ($a1 == 'locations_user_via' && $a2) {
    $content = getdirections_user_setlocations_via($a2);
  }
  elseif ($a1 == 'location_user' && ($a2 == 'from' || $a2 == 'to') && is_numeric($a3)) {
    $content = getdirections_user_setlocation($a2, $a3);
  }
  elseif ($a1 == 'locations_users' && is_numeric($a2) && is_numeric($a3)) {
    $content = getdirections_user_setlocations($a2, $a3);
  }
  elseif ($a1 == 'location_n2u' && is_numeric($a2) && is_numeric($a3)) {
    $content = getdirections_n2u_setlocation($a2, $a3);
  }
  elseif ($a1 == 'location_u2n' && is_numeric($a2) && is_numeric($a3)) {
    $content = getdirections_u2n_setlocation($a2, $a3);
  }
  elseif ($a1 == 'latlon' && ($a2 == 'from' || $a2 == 'to')) {
    $content = getdirections_latlon($a2, $a3, $a4);
  }
  elseif ($a1 == 'latlons' && $a2) {
    $content = getdirections_latlons($a2);
  }
  elseif ($a1 == 'location_id' && ($a2 == 'from' || $a2 == 'to')) {
    $content = getdirections_setlocation_id($a2, $a3);
  }
  elseif ($a1 == 'location_term' && ($a2 == 'from' || $a2 == 'to')) {
    $content = getdirections_term_setlocation($a2, $a3);
  }
  elseif ($a1 == 'location_comment' && ($a2 == 'from' || $a2 == 'to')) {
    $content = getdirections_comment_setlocation($a2, $a3);
  }
  elseif (getdirections_check_entity_type($a1) && ($a2 == 'from' || $a2 == 'to') && is_numeric($a3)) {
    $content = getdirections_entity_setlocation($a1, $a2, $a3);
  }
  elseif (getdirections_check_entity_type($a1) && is_numeric($a2) && getdirections_check_entity_type($a3) && is_numeric($a4)) {
    $content = getdirections_entity_setlocations($a1, $a2, $a3, $a4);
  }
  else {
    $content = getdirections_direction();
  }
  $output = theme('getdirections_box', array(
    'content' => $content,
  ));
  print $output;
  exit;
}