You are here

function getdirections_location_path in Get Directions 6

Same name and namespace in other branches
  1. 6.2 getdirections.api.inc \getdirections_location_path()
  2. 7.3 getdirections.api.inc \getdirections_location_path()
  3. 7.2 getdirections.api.inc \getdirections_location_path()

API Function to generate a url path for use by other modules/themes.

Example Usage: $path = getdirections_location_path('to', $vid); $url = l(t('Get directions'), $path);

Parameters

$direction: Required. The direction the supplied input applies to. Must be either 'to' or 'from'

$vid: Required. The vid of the location node

Return value

Returns a path relative to the drupal root.

File

./getdirections.api.inc, line 23
Get directions API

Code

function getdirections_location_path($direction, $vid) {
  if (module_exists('location') && is_numeric($vid) && ($direction == 'to' || $direction == 'from')) {
    return "getdirections/location/{$direction}/{$vid}";
  }
}