ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCloudPluginDeleteGUI Class Reference

Class ilCloudPluginDeleteGUI. More...

+ Inheritance diagram for ilCloudPluginDeleteGUI:
+ Collaboration diagram for ilCloudPluginDeleteGUI:

Public Member Functions

 asyncDeleteItem ()
 initDeleteItem ()
 deleteItem ()
 Update properties.
 cancel ()
 Update properties.
- Public Member Functions inherited from ilCloudPluginGUI
 __construct ($plugin_service_class)
 getPluginObject ()
 getPluginHookObject ()
 getAdminConfigObject ()
 getService ()
 txt ($var="")
 executeCommand ()

Protected Attributes

 $path = "/"
 $id = 0
 $is_dir
- Protected Attributes inherited from ilCloudPluginGUI
 $service = null

Detailed Description

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.

Member Function Documentation

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().

{
global $tpl, $lng;
$response = new stdClass();
$response->success = null;
$response->message = null;
$response->content = null;
try
{
$node = $file_tree->getNodeFromId($_POST["id"]);
if(!$node)
{
}
else
{
$this->is_dir = $node->getIsDir();
}
$this->path = $node->getPath();
$this->id = $node->getId();
if(!$this->is_dir)
{
$this->path = rtrim($this->path, "/");
}
$this->initDeleteItem();
$response->content = "<div id = 'cld_delete_item' >";
if($this->is_dir)
{
$response->content .= $tpl->getMessageHTML($lng->txt("cld_confirm_delete_folder"), "question");
}
else
{
$response->content .= $tpl->getMessageHTML($lng->txt("cld_confirm_delete_file"), "question");
}
$response->content .= $this->gui->getHTML();
$response->content .= "</div >";
$response->success = true;
} catch (Exception $e)
{
$response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
}
header('Content-type: application/json');
echo ilJsonUtil::encode($response);
}

+ Here is the call graph for this function:

ilCloudPluginDeleteGUI::cancel ( )

Update properties.

Definition at line 132 of file class.ilCloudPluginDeleteGUI.php.

References ilJsonUtil\encode(), and exit.

{
$response = new stdClass();
$response->status = "cancel";
echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterDeleteItem(" . ilJsonUtil::encode($response) . ");</script>";
}

+ Here is the call graph for this function:

ilCloudPluginDeleteGUI::deleteItem ( )

Update properties.

Definition at line 102 of file class.ilCloudPluginDeleteGUI.php.

References $_POST, $lng, $tpl, ilJsonUtil\encode(), exit, and ilCloudFileTree\getFileTreeFromSession().

{
global $tpl, $lng;
$response = new stdClass();
$response->success = null;
$response->message = null;
if (true)
{
try
{
$node = $file_tree->getNodeFromId($_POST["id"]);
$file_tree->deleteFromService($node->getId());
$response->message = $tpl->getMessageHTML($lng->txt("cld_file_deleted"), "success");
$response->success = true;
} catch (Exception $e)
{
$response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
}
}
echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterDeleteItem(" . ilJsonUtil::encode($response) . ");</script>";
}

+ Here is the call graph for this function:

ilCloudPluginDeleteGUI::initDeleteItem ( )

Definition at line 75 of file class.ilCloudPluginDeleteGUI.php.

References $ilCtrl, and $lng.

Referenced by asyncDeleteItem().

{
global $ilCtrl, $lng;
include_once("Services/Utilities/classes/class.ilConfirmationTableGUI.php");
$this->gui = new ilConfirmationTableGUI(true);
$this->gui->setFormName("cld_delete_item");
$this->gui->getTemplateObject()->setVariable("ACTIONTARGET","cld_blank_target");
$this->gui->addCommandButton('deleteItem', $lng->txt('confirm'));
$this->gui->addCommandButton('cancel', $lng->txt('cancel'));
$this->gui->setFormAction($ilCtrl->getFormAction($this));
if($this->is_dir)
{
$item[] = array("var" => 'id', "id" => $this->id, "text" => basename($this->path), "img" => "/Modules/Cloud/templates/images/icon_folder.png");
}
else
{
$item[] = array("var" => 'id', "id" => $this->id, "text" => basename($this->path), "img" => "/Modules/Cloud/templates/images/icon_file.png");
}
$this->gui->setData($item);
}

+ Here is the caller graph for this function:

Field Documentation

ilCloudPluginDeleteGUI::$id = 0
protected

Definition at line 21 of file class.ilCloudPluginDeleteGUI.php.

ilCloudPluginDeleteGUI::$is_dir
protected

Definition at line 22 of file class.ilCloudPluginDeleteGUI.php.

ilCloudPluginDeleteGUI::$path = "/"
protected

Definition at line 20 of file class.ilCloudPluginDeleteGUI.php.


The documentation for this class was generated from the following file: