4 include_once(
"./Services/Object/classes/class.ilObject2GUI.php");
5 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
6 include_once(
"class.ilCloudPluginFileTreeGUI.php");
7 include_once(
"class.ilCloudFileTree.php");
8 include_once(
"class.ilCloudConnector.php");
36 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0) {
40 $lng->loadLanguageModule(
"cld");
57 global
$ilCtrl, $ilTabs, $ilNavigationHistory,
$lng;
60 $link = $ilCtrl->getLinkTarget($this,
"render");
69 if ($this->
object != NULL) {
70 $ilNavigationHistory->addItem($this->object->getRefId(), $link,
"cld");
79 if ($this->object->getAuthComplete() ==
false && !
$_GET[
"authMode"]) {
90 $next_class = $ilCtrl->getNextClass($this);
92 $cmd = $ilCtrl->getCmd($this);
95 $next_class =
"ilcloudpluginsettingsgui";
97 case "afterServiceAuth" :
107 switch ($next_class) {
108 case "ilinfoscreengui":
112 case "ilcommonactiondispatchergui":
113 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
115 $this->ctrl->forwardCommand($gui);
117 case "ilpermissiongui":
119 $ilTabs->activateTab(
"id_permissions");
120 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
122 $this->ctrl->forwardCommand($perm_gui);
124 case "ilcloudpluginuploadgui":
127 $this->ctrl->forwardCommand($upload_gui);
130 case "ilcloudplugincreatefoldergui":
133 $this->ctrl->forwardCommand($folder_gui);
136 case "ilcloudplugindeletegui":
139 $this->ctrl->forwardCommand($delete_gui);
142 case "ilcloudpluginsettingsgui":
146 $settings_gui->setCloudObject($this->
object);
147 $this->ctrl->forwardCommand($settings_gui);
150 case "ilcloudpluginactionlistgui":
152 $this->ctrl->forwardCommand($action_list_gui);
154 case "ilcloudpluginitemcreationlistgui":
156 $this->ctrl->forwardCommand($item_creation_gui);
158 case "ilcloudpluginfiletreegui":
160 $this->ctrl->forwardCommand($file_tree_gui);
162 case "ilcloudpluginheaderactiongui":
164 $this->ctrl->forwardCommand($header_action_gui);
166 case "ilcloudplugininitgui":
168 $this->ctrl->forwardCommand($init_gui);
192 public static function _goto($a_target) {
193 $content = explode(
"_", $a_target);
194 $_GET[
"ref_id"] = $content[0];
195 $_POST[
"path"] = $content[2];
196 $_GET[
"baseClass"] =
"ilrepositorygUI";
197 $_GET[
"cmdClass"] =
"ilobjcloudgui";
198 $_GET[
"cmd"] =
"render";
199 include(
"ilias.php");
212 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
213 $ilTabs->addTab(
"content", $lng->txt(
"content"), $ilCtrl->getLinkTarget($this,
"render"));
214 $ilTabs->addTab(
"id_info", $lng->txt(
"info_short"), $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
218 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
219 $ilTabs->addTab(
"settings", $lng->txt(
"settings"), $ilCtrl->getLinkTargetByClass(
"ilcloudpluginsettingsgui",
"editSettings"));
223 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
224 $ilTabs->addTab(
"id_permissions", $lng->txt(
"perm_settings"), $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
235 $ilTabs->activateTab(
"id_info");
238 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
242 $info = $plugin_info->getInfoScreen($this);
243 $this->ctrl->forwardCommand($info);
275 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
277 $form->setTarget(
"_top");
278 $form->setFormAction($this->ctrl->getFormAction($this,
"save"));
279 $form->setTitle($this->lng->txt($a_new_type .
"_new"));
285 $ti->setRequired(
true);
299 $option->setTitle($hook_object->txt($service));
300 $option->setInfo($hook_object->txt(
"create_info"));
304 $init_gui->initPluginCreationFormSection($option);
306 $services_group->addOption($option);
310 $services_group->setValue(array_shift($services_group->getOptions())->getValue());
312 $form->addItem($services_group);
316 $form->addCommandButton(
"save", $this->lng->txt($a_new_type .
"_add"));
317 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
330 if ($form->checkInput()) {
338 $init_gui->afterSavePluginCreation($a_new_object, $form);
357 $service->authService($ilCtrl->getLinkTarget($this,
"afterServiceAuth") .
"&authMode=true");
368 if ($this->plugin_service->afterAuthService()) {
369 $this->
object->setRootId(
"root",
true);
370 $this->
object->setAuthComplete(
true);
371 $this->
object->update();
373 $ilCtrl->redirectByClass(
"ilCloudPluginSettingsGUI",
"editSettings");
375 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
395 $header_action_class->addCustomHeaderAction($lg);
407 if (is_object($this->
object)) {
408 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
422 $response =
new stdClass();
423 $response->message = NULL;
424 $response->locator = NULL;
425 $response->content = NULL;
426 $response->success = NULL;
430 $file_tree->updateFileTree(
$_POST[
"path"]);
431 $node = $file_tree->getNodeFromPath(
$_POST[
"path"]);
435 $response->locator = $file_tree_gui->getLocatorHtml($file_tree->getNodeFromId($node->getId()));
436 $response->success =
true;
438 $response->message = $tpl->getMessageHTML($e->getMessage(),
"failure");
441 header(
'Content-type: application/json');
452 $file_tree->downloadFromService(
$_GET[
'id']);
454 $ilTabs->activateTab(
"content");