ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 19 of file class.ilCloudPluginCreateFolderGUI.php.

Member Function Documentation

◆ asyncCreateFolder()

ilCloudPluginCreateFolderGUI::asyncCreateFolder ( )

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

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

23  {
24  global $DIC;
25  $tpl = $DIC['tpl'];
26  $response = new stdClass();
27  $response->success = null;
28  $response->error = null;
29  $response->message = null;
30 
31  try
32  {
33  $this->initCreateFolder();
34  $response->content = $this->form->getHTML();
35  $response->success = true;
36 
37  } catch (Exception $e)
38  {
39  $response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
40  }
41  header('Content-type: application/json');
42  echo ilJsonUtil::encode($response);
43  exit;
44  }
global $tpl
Definition: ilias.php:8
static encode($mixed, $suppress_native=false)
Add a drawing to the header
Definition: 04printing.php:69
global $DIC
+ Here is the call graph for this function:

◆ cancel()

ilCloudPluginCreateFolderGUI::cancel ( )

Update properties.

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

References exit.

116  {
117  $response = new stdClass();
118  $response->status = "cancel";
119 
120  echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(".ilJsonUtil::encode($response).");</script>";
121  exit;
122 
123  }

◆ createFolder()

ilCloudPluginCreateFolderGUI::createFolder ( )

Update properties.

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

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

84  {
85  global $DIC;
86  $tpl = $DIC['tpl'];
87  $lng = $DIC['lng'];
88 
89  $response = new stdClass();
90  $response->success = null;
91  $response->message = null;
92  $response->folder_id = null;
93  try
94  {
95  $response->status = "done";
96  include_once("class.ilCloudFileTree.php");
98  $new_node = $file_tree->addFolderToService($_POST["parent_folder_id"], $_POST["folder_name"]);
99  $response->folder_id = $new_node->getId();
100  $response->folder_path = $new_node->getPath();
101  $response->success = true;
102  $response->message = $tpl->getMessageHTML($lng->txt("cld_folder_created"), "success");
103  } catch(Exception $e)
104  {
105  $response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
106  }
107  echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(" . ilJsonUtil::encode($response) . ");</script>";
108  exit;
109 
110  }
global $tpl
Definition: ilias.php:8
static encode($mixed, $suppress_native=false)
global $lng
Definition: privfeed.php:17
global $DIC
$_POST["username"]
+ Here is the call graph for this function:

◆ initCreateFolder()

ilCloudPluginCreateFolderGUI::initCreateFolder ( )

Init form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by asyncCreateFolder().

52  {
53  global $DIC;
54  $ilCtrl = $DIC['ilCtrl'];
55  $lng = $DIC['lng'];
56 
57  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
58  $this->form = new ilPropertyFormGUI();
59  $this->form->setId("cld_create_folder");
60 
61  $name = new ilTextInputGUI($lng->txt("cld_folder_name"), "folder_name");
62  $name->setRequired(true);
63  $this->form->addItem($name);
64 
65  // folder id
66  $id = new ilHiddenInputGUI("parent_folder_id");
67  $id->setValue($_POST["id"]);
68  $this->form->addItem($id);
69 
70 
71  $this->form->addCommandButton("createFolder", $lng->txt("cld_create_folder"));
72  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
73 
74  $this->form->setTitle($lng->txt("cld_create_folder"));
75  $this->form->setFormAction($ilCtrl->getFormAction($this));
76  $this->form->setTarget("cld_blank_target");
77 
78  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a text property in a property form.
global $lng
Definition: privfeed.php:17
global $DIC
$_POST["username"]
setRequired($a_required)
Set Required.
+ 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: