Class ilCloudPluginDeleteGUI.
More...
Class ilCloudPluginDeleteGUI.
Standard GUI when deleting files or folders. Could be overwritten by the plugin if needed.
- Author
- Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
- Version
- $Id:
Definition at line 18 of file class.ilCloudPluginDeleteGUI.php.
◆ asyncDeleteItem()
ilCloudPluginDeleteGUI::asyncDeleteItem |
( |
| ) |
|
Definition at line 25 of file class.ilCloudPluginDeleteGUI.php.
References $_POST, $lng, $tpl, ilJsonUtil\encode(), exit, ilCloudFileTree\getFileTreeFromSession(), ilCloudException\ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION, and initDeleteItem().
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');
static getFileTreeFromSession()
const ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
static encode($mixed, $suppress_native=false)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
◆ cancel()
ilCloudPluginDeleteGUI::cancel |
( |
| ) |
|
Update properties.
Definition at line 132 of file class.ilCloudPluginDeleteGUI.php.
References ilJsonUtil\encode(), and exit.
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>";
static encode($mixed, $suppress_native=false)
◆ deleteItem()
ilCloudPluginDeleteGUI::deleteItem |
( |
| ) |
|
Update properties.
Definition at line 102 of file class.ilCloudPluginDeleteGUI.php.
References $_POST, $lng, $tpl, ilJsonUtil\encode(), exit, and ilCloudFileTree\getFileTreeFromSession().
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>";
static getFileTreeFromSession()
static encode($mixed, $suppress_native=false)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
◆ initDeleteItem()
ilCloudPluginDeleteGUI::initDeleteItem |
( |
| ) |
|
Definition at line 75 of file class.ilCloudPluginDeleteGUI.php.
References $ilCtrl, and $lng.
Referenced by asyncDeleteItem().
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);
◆ $id
ilCloudPluginDeleteGUI::$id = 0 |
|
protected |
◆ $is_dir
ilCloudPluginDeleteGUI::$is_dir |
|
protected |
◆ $path
ilCloudPluginDeleteGUI::$path = "/" |
|
protected |
The documentation for this class was generated from the following file: