4 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
5 include_once(
"./Modules/Cloud/exceptions/class.ilCloudException.php");
28 $response =
new stdClass();
29 $response->success = null;
30 $response->message = null;
31 $response->content = null;
35 $node = $file_tree->getNodeFromId(
$_POST[
"id"]);
42 $this->is_dir = $node->getIsDir();
45 $this->path = $node->getPath();
46 $this->
id = $node->getId();
49 $this->path = rtrim($this->path,
"/");
52 $response->content =
"<div id = 'cld_delete_item' >";
55 $response->content .= $tpl->getMessageHTML($lng->txt(
"cld_confirm_delete_folder"),
"question");
59 $response->content .= $tpl->getMessageHTML($lng->txt(
"cld_confirm_delete_file"),
"question");
61 $response->content .= $this->gui->getHTML();
62 $response->content .=
"</div >";
63 $response->success =
true;
67 $response->message = $tpl->getMessageHTML($e->getMessage(),
"failure");
69 header(
'Content-type: application/json');
79 include_once(
"Services/Utilities/classes/class.ilConfirmationTableGUI.php");
81 $this->gui->setFormName(
"cld_delete_item");
82 $this->gui->getTemplateObject()->setVariable(
"ACTIONTARGET",
"cld_blank_target");
84 $this->gui->addCommandButton(
'deleteItem', $lng->txt(
'confirm'));
85 $this->gui->addCommandButton(
'cancel', $lng->txt(
'cancel'));
86 $this->gui->setFormAction($ilCtrl->getFormAction($this));
90 $item[] = array(
"var" =>
'id',
"id" => $this->
id,
"text" => basename($this->path),
"img" =>
"/Modules/Cloud/templates/images/icon_folder.png");
94 $item[] = array(
"var" =>
'id',
"id" => $this->
id,
"text" => basename($this->path),
"img" =>
"/Modules/Cloud/templates/images/icon_file.png");
96 $this->gui->setData($item);
106 $response =
new stdClass();
107 $response->success = null;
108 $response->message = null;
115 $node = $file_tree->getNodeFromId(
$_POST[
"id"]);
116 $file_tree->deleteFromService($node->getId());
117 $response->message = $tpl->getMessageHTML($lng->txt(
"cld_file_deleted"),
"success");
118 $response->success =
true;
121 $response->message = $tpl->getMessageHTML($e->getMessage(),
"failure");
124 echo
"<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterDeleteItem(" .
ilJsonUtil::encode($response) .
");</script>";
134 $response =
new stdClass();
135 $response->status =
"cancel";
137 echo
"<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterDeleteItem(" .
ilJsonUtil::encode($response) .
");</script>";