function getlocations_get_markerfile in Get Locations 6
Same name and namespace in other branches
- 6.2 getlocations.module \getlocations_get_markerfile()
- 7.2 getlocations.module \getlocations_get_markerfile()
- 7 getlocations.module \getlocations_get_markerfile()
3 calls to getlocations_get_markerfile()
- getlocations_regenerate_markers in ./
getlocations.module - Regenerate the markerdata file.
- getlocations_settings_form in ./
getlocations.admin.inc - Function to display the getlocations admin settings form
- getlocations_setup_js in ./
getlocations.module - Function to setup the map scripts
File
- ./
getlocations.module, line 929 - Displays locations on a map. for Drupal 6 using version 3 googlemaps API
Code
function getlocations_get_markerfile($dir = FALSE, $check = TRUE) {
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
// private
$markerpath = '';
$markerfile = variable_get('getlocations_private_markerfile', '');
if ($markerfile && preg_match("~^(.*)/getlocations_markers.js~", $markerfile, $matches)) {
$markerpath = $matches[1];
}
}
else {
$markerpath = file_create_path('getlocations');
$markerfile = '';
if ($markerpath) {
$markerfile = $markerpath . '/getlocations_markers.js';
}
}
if ($dir && $markerpath) {
if ($check) {
if (file_exists($markerpath)) {
return $markerpath;
}
}
else {
return $markerpath;
}
}
elseif ($markerfile) {
if ($check) {
if (file_exists($markerfile)) {
return $markerfile;
}
}
else {
return $markerfile;
}
}
return FALSE;
}