Settings';
// add the link to the list
array_unshift($links, $settings_link);
}
return $links;
}
function enqueue_WP_GPX_Maps_scripts()
{
?>
$points_maps,
"points_graph" => $points_graph,
"waypoints" => $waypoints)
),
LOCK_EX);
@chmod($gpxcache,0755);
}
$output = '
';
return $output;
}
function downloadRemoteFile($remoteFile)
{
try
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $remoteFile);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
$resp = curl_exec($ch);
curl_close($ch);
$tmpfname = tempnam ( '/tmp', 'gpx' );
$fp = fopen($tmpfname, "w");
fwrite($fp, $resp);
fclose($fp);
return $tmpfname;
} catch (Exception $e) {
return '';
}
}
function unescape($value)
{
$value = str_replace("'", "\'", $value);
$value = str_replace(array("\n","\r"), "", $value);
return $value;
}
function WP_GPX_Maps_install() {
add_option("wpgpxmaps_width", '100%', '', 'yes');
add_option("wpgpxmaps_graph_height", '200px', '', 'yes');
add_option("wpgpxmaps_height", '450px', '', 'yes');
add_option('wpgpxmaps_map_type','HYBRID','','yes');
add_option('wpgpxmaps_show_waypoint','','','yes');
add_option('wpgpxmaps_show_speed','','','yes');
add_option('wpgpxmaps_pointsoffset','10','','yes');
add_option('wpgpxmaps_donotreducegpx','true','','yes');
add_option("wpgpxmaps_unit_of_measure", '0', '', 'yes');
add_option("wpgpxmaps_unit_of_measure_speed", '0', '', 'yes');
add_option("wpgpxmaps_graph_line_color", '#3366cc', '', 'yes');
add_option("wpgpxmaps_graph_line_color_speed", '#ff0000', '', 'yes');
add_option("wpgpxmaps_map_line_color", '#3366cc', '', 'yes');
}
function WP_GPX_Maps_remove() {
delete_option('wpgpxmaps_width');
delete_option('wpgpxmaps_graph_height');
delete_option('wpgpxmaps_height');
delete_option('wpgpxmaps_map_type');
delete_option('wpgpxmaps_show_waypoint');
delete_option('wpgpxmaps_show_speed');
delete_option('wpgpxmaps_pointsoffset');
delete_option('wpgpxmaps_donotreducegpx');
delete_option('wpgpxmaps_unit_of_measure');
delete_option('wpgpxmaps_unit_of_measure_speed');
delete_option('wpgpxmaps_graph_line_color');
delete_option('wpgpxmaps_map_line_color');
delete_option('wpgpxmaps_graph_line_color_speed');
}
?>