You are here

function theme_getdirections_show_locations_via in Get Directions 6.2

Same name and namespace in other branches
  1. 6 getdirections.theme.inc \theme_getdirections_show_locations_via()
  2. 7.3 getdirections.module \theme_getdirections_show_locations_via()
  3. 7.2 getdirections.module \theme_getdirections_show_locations_via()

Theme to use for when both locations are supplied with waypoints.

1 theme call to theme_getdirections_show_locations_via()
getdirections_locations_via in ./getdirections.module
Function to setup the map

File

./getdirections.theme.inc, line 182
getdirections module theming

Code

function theme_getdirections_show_locations_via($width, $height, $locs) {
  $output = "";
  foreach ($locs as $key => $loc) {
    if ($key == 0) {
      $label = t('From');
    }
    elseif ($key == count($locs) - 1) {
      $label = t('To');
    }
    else {
      $label = t('Via');
    }
    $output .= "<div class='getdirections_display'><label>" . $label . ":</label> " . $loc . "</div>";
  }
  $getdirections_misc = getdirections_misc_defaults();
  if ($getdirections_misc['show_distance']) {
    $output .= '<div id="getdirections_show_distance"></div>';
  }
  if ($getdirections_misc['show_duration']) {
    $output .= '<div id="getdirections_show_duration"></div>';
  }
  $header = array();
  $rows[] = array(
    array(
      'data' => '<div id="getdirections_map_canvas" style="width: ' . $width . '; height: ' . $height . '" ></div>',
      'valign' => 'top',
      'align' => 'center',
      'class' => 'getdirections-map',
    ),
    array(
      'data' => '<div id="getdirections_directions"></div>',
      'valign' => 'top',
      'align' => 'left',
      'class' => 'getdirections-list',
    ),
  );
  $output .= '<div class="getdirections">' . theme('table', $header, $rows) . '</div>';
  return $output;
}