4 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
5 include_once(
"./Modules/Cloud/exceptions/class.ilCloudException.php");
42 $response =
new stdClass();
43 $response->success = null;
44 $response->message = null;
45 $response->content = null;
48 $node = $file_tree->getNodeFromId(
$_POST[
"id"]);
52 $this->is_dir = $node->getIsDir();
55 $this->path = $node->getPath();
56 $this->
id = $node->getId();
58 $this->path = rtrim($this->path,
"/");
61 $response->content =
"<div id = 'cld_delete_item' >";
63 $response->content .= $tpl->getMessageHTML($lng->txt(
"cld_confirm_delete_folder"),
"question");
65 $response->content .= $tpl->getMessageHTML($lng->txt(
"cld_confirm_delete_file"),
"question");
67 $response->content .= $this->gui->getHTML();
68 $response->content .=
"</div >";
69 $response->success =
true;
71 $response->message = $tpl->getMessageHTML($e->getMessage(),
"failure");
73 header(
'Content-type: application/json');
82 include_once(
"Services/Utilities/classes/class.ilConfirmationTableGUI.php");
84 $this->gui->setFormName(
"cld_delete_item");
85 $this->gui->getTemplateObject()->setVariable(
"ACTIONTARGET",
"cld_blank_target");
87 $this->gui->addCommandButton(
'deleteItem', $lng->txt(
'confirm'));
88 $this->gui->addCommandButton(
'cancel', $lng->txt(
'cancel'));
89 $this->gui->setFormAction($ilCtrl->getFormAction($this));
95 "text" => basename($this->path),
102 "text" => basename($this->path),
106 $this->gui->setData($item);
116 $response =
new stdClass();
117 $response->success = null;
118 $response->message = null;
123 $node = $file_tree->getNodeFromId(
$_POST[
"id"]);
124 $file_tree->deleteFromService($node->getId());
125 $response->message = $tpl->getMessageHTML($lng->txt(
"cld_file_deleted"),
"success");
126 $response->success =
true;
128 $response->message = $tpl->getMessageHTML($e->getMessage(),
"failure");
131 echo
"<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterDeleteItem(" .
ilJsonUtil::encode($response)
141 $response =
new stdClass();
142 $response->status =
"cancel";
144 echo
"<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterDeleteItem(" .
ilJsonUtil::encode($response)