Commit 1ecdebb2 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

kml template testing

parent d77238d0
......@@ -52,13 +52,13 @@ function parse_list(res){
function copy_models(){
// testing
$.ajax({
url: "select.php?cmd=copy",
success: function(response){
console.log(response);
var kmldata = $('#kml')[0].files[0];
if (kmldata!=undefined){
if(kmldata.name.substr(-3)!="kml"){
kmldata = undefined;
}
});
}
$(".chkbox").each(function(){
......@@ -66,7 +66,7 @@ function copy_models(){
$.ajax({
url: "select.php?cmd=copy&set="+$(this).attr('set')+"&model="+$(this).attr('model'),
type:'post',
data: $('#kml')[0].files[0],
data: kmldata,
processData: false,
success: function(response){
console.log(response);
......
......@@ -12,6 +12,13 @@ if (isset($_GET['showall'])){
if ($_GET['cmd']=='copy'){
$kml_template = file_get_contents('php://input');
if ($kml_template!=""){
if (!kml_test($kml_template)){
$kml_template = "";
}
}
die();
$set = $_GET['set'];
$model = $_GET['model'];
......@@ -82,6 +89,19 @@ return_xml($res);
//functions
function kml_test($data){
$result = false;
$xml = simplexml_load_string($data);
if ($xml->Document->PhotoOverlay){
$result = true;
}
return $result;
}
function selective_scandir($path,$showall){
$results = Array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment