ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 21 of file class.ilCloudPluginCreateFolderGUI.php.

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

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

◆ cancel()

ilCloudPluginCreateFolderGUI::cancel ( )

Update properties.

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

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

108  {
109  $response = new stdClass();
110  $response->status = "cancel";
111 
112  echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(" . ilJsonUtil::encode($response) . ");</script>";
113  exit;
114  }
static encode($mixed, $suppress_native=false)
$response
+ Here is the call graph for this function:

◆ createFolder()

ilCloudPluginCreateFolderGUI::createFolder ( )

Update properties.

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

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

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 = $tpl->getMessageHTML($lng->txt("cld_folder_created"), "success");
97  } catch (Exception $e) {
98  $response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
99  }
100  echo "<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterCreateFolder(" . ilJsonUtil::encode($response) . ");</script>";
101  exit;
102  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static encode($mixed, $suppress_native=false)
global $lng
Definition: privfeed.php:17
$response
$_POST["username"]
+ 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.

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

Referenced by asyncCreateFolder().

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 
67  $this->form->addCommandButton("createFolder", $lng->txt("cld_create_folder"));
68  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
69 
70  $this->form->setTitle($lng->txt("cld_create_folder"));
71  $this->form->setFormAction($ilCtrl->getFormAction($this));
72  $this->form->setTarget("cld_blank_target");
73  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
if($format !==null) $name
Definition: metadata.php:146
This class represents a text property in a property form.
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the caller graph for this function:

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