You are here

function theme_getdirections_show_locations in Get Directions 7.3

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

Theme to use for when both locations are supplied.

1 theme call to theme_getdirections_show_locations()
getdirections_locations in ./getdirections.module
Function to setup the map

File

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

Code

function theme_getdirections_show_locations($variables) {
  $width = $variables['width'];
  $height = $variables['height'];
  $fromlocs = $variables['fromlocs'];
  $tolocs = $variables['tolocs'];
  $mapid = $variables['mapid'];
  $output = "";
  $output .= "<div class='getdirections_display'><label>" . t('From') . ":</label> " . $fromlocs . "</div>";
  $output .= "<div class='getdirections_display'><label>" . t('To') . ":</label> " . $tolocs . "</div>";
  $getdirections_misc = getdirections_misc_defaults();
  if ($getdirections_misc['show_distance']) {
    $output .= '<div id="getdirections_show_distance_' . $mapid . '"></div>';
  }
  if ($getdirections_misc['show_duration']) {
    $output .= '<div id="getdirections_show_duration_' . $mapid . '"></div>';
  }
  $header = array();
  $rows[] = array(
    array(
      'data' => '<div id="getdirections_map_canvas_' . $mapid . '" style="width: ' . $width . '; height: ' . $height . '" ></div>',
      'valign' => 'top',
      'align' => 'center',
      'class' => array(
        'getdirections-map',
      ),
    ),
    array(
      'data' => '<div id="getdirections_directions_' . $mapid . '"></div>',
      'valign' => 'top',
      'align' => 'left',
      'class' => array(
        'getdirections-list',
      ),
    ),
  );
  $output .= '<div class="getdirections">' . theme('table', array(
    'header' => $header,
    'rows' => $rows,
  )) . '</div>';
  return $output;
}