gerarchia === 1) { $pending = getPendingTranslations(); if (!empty($pending)) { $notFound = 0; $new = 0; $over = 0; $chunkPath = $config["chunk_folder"]."/".$_SESSION["utente"]->codice."/".$_POST["filechunk"]; if (file_exists($chunkPath)) { $newTranslations = jsonToArray($chunkPath); if (!empty($newTranslations)) { $error = false; $vocabolario = jsonToArray($config["path_vocabolario"]."/vocabolario.json"); if (!file_exists($config["path_vocabolario"]."/backup/")) { mkdir($config["path_vocabolario"]."/backup/"); } if (file_put_contents($config["path_vocabolario"]."/backup/".time().".json",file_get_contents($config["path_vocabolario"]."/vocabolario.json"))) { foreach($newTranslations AS $key => $value) { unset($value["_verify"]); if (isset($vocabolario[$key])) { if (!empty($vocabolario[$key]["_verify"])) { $over++; } else { $new++; } $vocabolario[$key] = $value; } else { $notFound++; } } if (file_put_contents($config["path_vocabolario"]."/vocabolario.json",json_encode($vocabolario,JSON_PRETTY_PRINT))) { ?> swal({ title: "Risultati importazione", html: ":
:
: ", type: "info", confirmButtonText: "Ok", confirmButtonClass: 'btn btn-primary' }).then(function() { window.location.reload(); }); swal({ title: "Errore Backup!", type: "warning", confirmButtonText: "Riprova", confirmButtonClass: 'btn btn-warning' });