You are here

function theme_getlocations_lidinfo in Get Locations 7

Same name and namespace in other branches
  1. 7.2 getlocations.module \theme_getlocations_lidinfo()

Returns HTML of a url, requested by ajax.

Parameters

array $variables: An associative array containing:

  • lid: The location identifier or glid.
  • lidkey: The entity identifier type

Return value

string $output

1 theme call to theme_getlocations_lidinfo()
getlocations_getlidinfo in ./getlocations.module

File

./getlocations.module, line 7852
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function theme_getlocations_lidinfo($variables) {
  $lid = $variables['lid'];
  $lidkey = $variables['lidkey'];
  $output = FALSE;
  if ($lid > 0) {
    if (module_exists('getlocations_fields') || module_exists('location')) {
      $path = getlocations_get_path_from_lid($lid);
      if ($path) {
        $output = $path;
      }
    }
    elseif (module_exists('geofield') || module_exists('geolocation')) {
      if ($lidkey == 'nid') {
        $path = url('node/' . $lid);
      }
      elseif ($lidkey == 'vid') {
        $nid = getlocations_get_nid($lid);
        $path = url('node/' . $nid);
      }
      elseif ($lidkey == 'uid') {
        $path = url('user/' . $lid);
      }
      elseif ($lidkey == 'tid' && module_exists('taxonomy')) {
        $path = url('taxonomy/term/' . $lid);
      }
      elseif ($lidkey == 'cid' && module_exists('comment')) {
        $path = url('comment/' . $lid);
      }
      if ($path) {
        $output = $path;
      }
    }
  }
  return $output;
}