ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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 $tpl, ilJsonUtil\encode(), exit, and initCreateFolder().

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

◆ cancel()

ilCloudPluginCreateFolderGUI::cancel ( )

Update properties.

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

References exit.

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

◆ createFolder()

ilCloudPluginCreateFolderGUI::createFolder ( )

Update properties.

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

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

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

◆ initCreateFolder()

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

51  {
52  global $ilCtrl, $lng;
53 
54  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
55  $this->form = new ilPropertyFormGUI();
56  $this->form->setId("cld_create_folder");
57 
58  $name = new ilTextInputGUI($lng->txt("cld_folder_name"), "folder_name");
59  $name->setRequired(true);
60  $this->form->addItem($name);
61 
62  // folder id
63  $id = new ilHiddenInputGUI("parent_folder_id");
64  $id->setValue($_POST["id"]);
65  $this->form->addItem($id);
66 
67 
68  $this->form->addCommandButton("createFolder", $lng->txt("cld_create_folder"));
69  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
70 
71  $this->form->setTitle($lng->txt("cld_create_folder"));
72  $this->form->setFormAction($ilCtrl->getFormAction($this));
73  $this->form->setTarget("cld_blank_target");
74 
75  }
$_POST['username']
Definition: cron.php:12
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:40
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: