mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
feat(php): implement delete all files method
This commit is contained in:
@ -594,6 +594,29 @@ footer table tr td:first-child {
|
|||||||
width: 4%;
|
width: 4%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.storedHeader {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storedHeaderClearAll {
|
||||||
|
padding-right: 52px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear-all {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100px;
|
||||||
|
padding: 2px;
|
||||||
|
outline: 1px solid #E5E5E5;
|
||||||
|
text-align: center;
|
||||||
|
cursor:pointer;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
.select-user {
|
.select-user {
|
||||||
color: #444444;
|
color: #444444;
|
||||||
font-family: Open Sans;
|
font-family: Open Sans;
|
||||||
|
|||||||
@ -310,6 +310,22 @@ if (typeof jQuery != "undefined") {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
jq(document).on("click", ".clear-all", function () {
|
||||||
|
if (confirm("Delete all the files?")) {
|
||||||
|
jq.ajax({
|
||||||
|
async: true,
|
||||||
|
contentType: "text/xml",
|
||||||
|
type: "delete",
|
||||||
|
url: "delete",
|
||||||
|
complete: function (data) {
|
||||||
|
if (JSON.parse(data.responseText).status == 'success') {
|
||||||
|
window.location.reload(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
jq(document).on("click", "#createSample", function () {
|
jq(document).on("click", "#createSample", function () {
|
||||||
jq(".try-editor").each(function () {
|
jq(".try-editor").each(function () {
|
||||||
var href = jq(this).attr("href");
|
var href = jq(this).attr("href");
|
||||||
|
|||||||
@ -299,12 +299,15 @@ function convert()
|
|||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$fileName = basename($_GET["fileName"]);
|
if(isset($_GET["fileName"]) && !empty($_GET["fileName"])) {
|
||||||
|
$fileName = basename($_GET["fileName"]);
|
||||||
|
$filePath = getStoragePath($fileName);
|
||||||
|
|
||||||
$filePath = getStoragePath($fileName);
|
unlink($filePath); // delete a file
|
||||||
|
delTree(getHistoryDir($filePath)); // delete all the elements from the history directory
|
||||||
unlink($filePath); // delete a file
|
} else {
|
||||||
delTree(getHistoryDir($filePath)); // delete all the elements from the history directory
|
delTree(getStoragePath('')); // delete the user's folder and all the containing files
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
sendlog("Deletion ".$e->getMessage(), "webedior-ajax.log");
|
sendlog("Deletion ".$e->getMessage(), "webedior-ajax.log");
|
||||||
$result["error"] = "error: " . $e->getMessage();
|
$result["error"] = "error: " . $e->getMessage();
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
<div class="stored-list">
|
<div class="stored-list">
|
||||||
<span class="header-list">Your documents</span>
|
<div class="storedHeader">
|
||||||
|
<div class="storedHeaderText">
|
||||||
|
<span class="header-list">Your documents</span>
|
||||||
|
</div>
|
||||||
|
<div class="storedHeaderClearAll">
|
||||||
|
<div class="clear-all">Clear all</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<table class="tableHeader" cellspacing="0" cellpadding="0" width="100%">
|
<table class="tableHeader" cellspacing="0" cellpadding="0" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user