ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilCloudPluginCreateFolderGUI Class Reference

Class ilCloudPluginCreateFolderGUI. More...

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

Public Member Functions

 asyncCreateFolder ()
 
 initCreateFolder ()
 Init form. More...
 
 createFolder ()
 Update properties. More...
 
 cancel ()
 Update properties. More...
 
- 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 18 of file class.ilCloudPluginCreateFolderGUI.php.

Member Function Documentation

◆ asyncCreateFolder()

ilCloudPluginCreateFolderGUI::asyncCreateFolder ( )

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

21 {
22 global $DIC;
23 $tpl = $DIC['tpl'];
24 $response = new stdClass();
25 $response->success = null;
26 $response->error = null;
27 $response->message = null;
28
29 try {
30 $this->initCreateFolder();
31 $response->content = $this->form->getHTML();
32 $response->success = true;
33 } catch (Exception $e) {
34 $response->message = ilUtil::getSystemMessageHTML($e->getMessage(), "failure");
35 }
36 header('Content-type: application/json');
38 exit;
39 }
static encode($mixed, $suppress_native=false)
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
exit
Definition: login.php:29
$response
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$DIC
Definition: xapitoken.php:46

References $DIC, Vendor\Package\$e, $response, $tpl, ilJsonUtil\encode(), exit, ilUtil\getSystemMessageHTML(), and initCreateFolder().

+ Here is the call graph for this function:

◆ cancel()

ilCloudPluginCreateFolderGUI::cancel ( )

Update properties.

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

109 {
110 $response = new stdClass();
111 $response->status = "cancel";
112
113 echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(" . ilJsonUtil::encode($response) . ");</script>";
114 exit;
115 }

References $response, ilJsonUtil\encode(), and exit.

+ Here is the call graph for this function:

◆ createFolder()

ilCloudPluginCreateFolderGUI::createFolder ( )

Update properties.

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

79 {
80 global $DIC;
81 $tpl = $DIC['tpl'];
82 $lng = $DIC['lng'];
83
84 $response = new stdClass();
85 $response->success = null;
86 $response->message = null;
87 $response->folder_id = null;
88 try {
89 $response->status = "done";
90 include_once("class.ilCloudFileTree.php");
92 $new_node = $file_tree->addFolderToService($_POST["parent_folder_id"], $_POST["folder_name"]);
93 $response->folder_id = $new_node->getId();
94 $response->folder_path = $new_node->getPath();
95 $response->success = true;
96 $response->message = ilUtil::getSystemMessageHTML($lng->txt("cld_folder_created"), "success");
97 } catch (Exception $e) {
98 $response->message = ilUtil::getSystemMessageHTML($e->getMessage(), "failure");
99 }
100 echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(" . ilJsonUtil::encode($response) . ");</script>";
101 exit;
102 }
$_POST["username"]
$lng

References $_POST, $DIC, Vendor\Package\$e, $lng, $response, $tpl, ilJsonUtil\encode(), exit, ilCloudFileTree\getFileTreeFromSession(), and ilUtil\getSystemMessageHTML().

+ Here is the call graph for this function:

◆ initCreateFolder()

ilCloudPluginCreateFolderGUI::initCreateFolder ( )

Init form.

Parameters
int$a_modeEdit Mode

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

48 {
49 global $DIC;
50 $ilCtrl = $DIC['ilCtrl'];
51 $lng = $DIC['lng'];
52
53 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
54 $this->form = new ilPropertyFormGUI();
55 $this->form->setId("cld_create_folder");
56
57 $name = new ilTextInputGUI($lng->txt("cld_folder_name"), "folder_name");
58 $name->setRequired(true);
59 $this->form->addItem($name);
60
61 // folder id
62 $id = new ilHiddenInputGUI("parent_folder_id");
63 $id->setValue($_POST["id"]);
64 $this->form->addItem($id);
65
66 $this->form->addCommandButton("createFolder", $lng->txt("cld_create_folder"));
67 $this->form->addCommandButton("cancel", $lng->txt("cancel"));
68
69 $this->form->setTitle($lng->txt("cld_create_folder"));
70 $this->form->setFormAction($ilCtrl->getFormAction($this));
71 $this->form->setTarget("cld_blank_target");
72 }
This class represents a hidden form property in a property form.
This class represents a property form user interface.
This class represents a text property in a property form.
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:230

References $_POST, $DIC, $ilCtrl, $lng, and $name.

Referenced by asyncCreateFolder().

+ Here is the caller graph for this function:

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