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

Class ilCloudPluginCreateFolderGUI. More...

+ Inheritance diagram for ilCloudPluginCreateFolderGUI:
+ Collaboration diagram for ilCloudPluginCreateFolderGUI:

Public Member Functions

 asyncCreateFolder ()
 initCreateFolder ()
 Init form.
 createFolder ()
 Update properties.
 cancel ()
 Update properties.
- Public Member Functions inherited from ilCloudPluginGUI
 __construct ($plugin_service_class)
 getPluginObject ()
 getPluginHookObject ()
 getAdminConfigObject ()
 getService ()
 txt ($var="")
 executeCommand ()

Additional Inherited Members

- Protected Attributes inherited from ilCloudPluginGUI
 $service = null

Detailed Description

Class ilCloudPluginCreateFolderGUI.

Standard GUI when creating a new folder. 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 19 of file class.ilCloudPluginCreateFolderGUI.php.

Member Function Documentation

ilCloudPluginCreateFolderGUI::asyncCreateFolder ( )

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

References $tpl, ilJsonUtil\encode(), exit, and initCreateFolder().

{
global $tpl;
$response = new stdClass();
$response->success = null;
$response->error = null;
$response->message = null;
try
{
$this->initCreateFolder();
$response->content = $this->form->getHTML();
$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:

ilCloudPluginCreateFolderGUI::cancel ( )

Update properties.

Definition at line 110 of file class.ilCloudPluginCreateFolderGUI.php.

References exit.

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

Update properties.

Definition at line 80 of file class.ilCloudPluginCreateFolderGUI.php.

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

{
global $tpl, $lng;
$response = new stdClass();
$response->success = null;
$response->message = null;
$response->folder_id = null;
try
{
$response->status = "done";
include_once("class.ilCloudFileTree.php");
$new_node = $file_tree->addFolderToService($_POST["parent_folder_id"], $_POST["folder_name"]);
$response->folder_id = $new_node->getId();
$response->folder_path = $new_node->getPath();
$response->success = true;
$response->message = $tpl->getMessageHTML($lng->txt("cld_folder_created"), "success");
} catch(Exception $e)
{
$response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
}
echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(" . ilJsonUtil::encode($response) . ");</script>";
}

+ Here is the call graph for this function:

ilCloudPluginCreateFolderGUI::initCreateFolder ( )

Init form.

Parameters
int$a_modeEdit Mode

Definition at line 50 of file class.ilCloudPluginCreateFolderGUI.php.

References $_POST, $ilCtrl, $lng, and ilFormPropertyGUI\setRequired().

Referenced by asyncCreateFolder().

{
global $ilCtrl, $lng;
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setId("cld_create_folder");
$name = new ilTextInputGUI($lng->txt("cld_folder_name"), "folder_name");
$name->setRequired(true);
$this->form->addItem($name);
// folder id
$id = new ilHiddenInputGUI("parent_folder_id");
$id->setValue($_POST["id"]);
$this->form->addItem($id);
$this->form->addCommandButton("createFolder", $lng->txt("cld_create_folder"));
$this->form->addCommandButton("cancel", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("cld_create_folder"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
$this->form->setTarget("cld_blank_target");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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