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");
35 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");
71 if ($this->
object != NULL)
73 $ilNavigationHistory->addItem($this->object->getRefId(), $link,
"cld");
85 if($this->object->getAuthComplete() ==
false && !
$_GET[
"authMode"])
100 $next_class = $ilCtrl->getNextClass($this);
102 $cmd = $ilCtrl->getCmd($this);
105 case "editSettings" :
106 $next_class =
"ilcloudpluginsettingsgui";
108 case "afterServiceAuth" :
119 case "ilinfoscreengui":
123 case "ilcommonactiondispatchergui":
124 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
126 $this->ctrl->forwardCommand($gui);
128 case "ilpermissiongui":
130 $ilTabs->activateTab(
"id_permissions");
131 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
133 $this->ctrl->forwardCommand($perm_gui);
135 case "ilcloudpluginuploadgui":
139 $this->ctrl->forwardCommand($upload_gui);
142 case "ilcloudplugincreatefoldergui":
146 $this->ctrl->forwardCommand($folder_gui);
149 case "ilcloudplugindeletegui":
153 $this->ctrl->forwardCommand($delete_gui);
156 case "ilcloudpluginsettingsgui":
161 $settings_gui->setCloudObject($this->
object);
162 $this->ctrl->forwardCommand($settings_gui);
165 case "ilcloudpluginactionlistgui":
167 $this->ctrl->forwardCommand($action_list_gui);
169 case "ilcloudpluginitemcreationlistgui":
171 $this->ctrl->forwardCommand($item_creation_gui);
173 case "ilcloudpluginfiletreegui":
175 $this->ctrl->forwardCommand($file_tree_gui);
177 case "ilcloudpluginheaderactiongui":
179 $this->ctrl->forwardCommand($header_action_gui);
181 case "ilcloudplugininitgui":
183 $this->ctrl->forwardCommand($init_gui);
208 $content = explode(
"_", $a_target);
209 $_GET[
"ref_id"] = $content[0];
210 $_POST[
"path"] = $content[2];
211 $_GET[
"baseClass"] =
"ilrepositorygUI";
212 $_GET[
"cmdClass"] =
"ilobjcloudgui";
213 $_GET[
"cmd"] =
"render";
214 include(
"ilias.php");
230 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
232 $ilTabs->addTab(
"content", $lng->txt(
"content"), $ilCtrl->getLinkTarget($this,
"render"));
233 $ilTabs->addTab(
"id_info", $lng->txt(
"info"), $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
237 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
239 $ilTabs->addTab(
"settings", $lng->txt(
"settings"), $ilCtrl->getLinkTargetByClass(
"ilcloudpluginsettingsgui",
"editSettings"));
243 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
245 $ilTabs->addTab(
"id_permissions", $lng->txt(
"perm_settings"), $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
256 $ilTabs->activateTab(
"id_info");
260 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
264 $info = $plugin_info->getInfoScreen($this);
265 $this->ctrl->forwardCommand($info);
296 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
298 $form->setTarget(
"_top");
299 $form->setFormAction($this->ctrl->getFormAction($this,
"save"));
300 $form->setTitle($this->lng->txt($a_new_type .
"_new"));
306 $ti->setRequired(
true);
307 $ti->setValidationRegexp(
'/^[ a-zA-Z0-9\-]+$/i');
322 $option->setTitle($hook_object->txt($service));
323 $option->setInfo($hook_object->txt(
"create_info"));
328 $init_gui->initPluginCreationFormSection($option);
330 $services_group->addOption($option);
333 $form->addItem($services_group);
337 $form->addCommandButton(
"save", $this->lng->txt($a_new_type .
"_add"));
338 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
352 if ($form->checkInput())
362 $init_gui->afterSavePluginCreation($a_new_object, $form);
380 $service->authService($ilCtrl->getLinkTarget($this,
"afterServiceAuth") .
"&authMode=true");
395 if($this->plugin_service->afterAuthService())
397 $this->
object->setRootId(
"root",
true);
398 $this->
object->setAuthComplete(
true);
399 $this->
object->update();
401 $ilCtrl->redirectByClass(
"ilCloudPluginSettingsGUI",
"editSettings");
405 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
427 $header_action_class->addCustomHeaderAction($lg);
439 if (is_object($this->
object))
441 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
463 $response =
new stdClass();
464 $response->message = null;
465 $response->locator = null;
466 $response->content = null;
467 $response->success = null;
471 $file_tree->updateFileTree(
$_POST[
"path"]);
472 $node = $file_tree->getNodeFromPath(
$_POST[
"path"]);
474 $response->content = $file_tree_gui->getFolderHtml($this,
482 $response->locator = $file_tree_gui->getLocatorHtml($file_tree->getNodeFromId($node->getId()));
483 $response->success =
true;
487 $response->message = $tpl->getMessageHTML($e->getMessage(),
"failure");
490 header(
'Content-type: application/json');
502 $file_tree->downloadFromService(
$_GET[
'id']);
505 $ilTabs->activateTab(
"content");