.
*
* Version 0.1
* Author: Octavio Benedi Sanchez
*/
// Predefined variables:
// $section contains the section folder name.
// echo "section=".$section."
";
// $plugin contains the plugin folder name.
// echo "plugin=".$plugin."
";
// $section and $plugin can be used to make a link to this plugin by just reference
// echo "This plugin"."
";
// $base_plugin contains the path that must be used as start to includes for
// plugin includes that need the local path.
// example: include_once $base_plugin.'php/my_include.php';
// echo "base_plugin=".$base_plugin."
";
// $url_plugin contains the url base that must be used to include html items
// such as images.
// example:
// echo "url_plugin=".$url_plugin."
";
// $API_core contains the path to the core API folder.
// example: include_once $API_core.'is_active.php';
// echo "API_core=".$API_core."
";
// Plugin server produced data will returned to the ajax call that made the
// request.
include_once $API_core.'complex_ajax_return_functions.php';
include_once $API_core.'parser_NMEA.php';
include_once $base_plugin.'php/gps_position.php';
if ($_POST['function']=="get_center")
{
$center=get_pos();
response_additem("x_pos", $center['lat']);
response_additem("y_pos", $center['lng']);
response_return();
}
elseif ($_POST['function']=="show_nmea")
{
$nmea_data=get_nmea();
response_additem("nmea_data", $nmea_data);
response_return();
}
elseif ($_POST['function']=="save_google_key")
{
if(!empty($_POST['google_key']))
{
$fp=fopen($base_plugin.'data/google_key.value','w');
fwrite($fp,$_POST['google_key']);
fclose($fp);
unset($fp);
}
else
{
$fp=fopen($base_plugin.'data/google_key.value','w');
fclose($fp);
unset($fp);
}
response_additem("return", '