ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjCloudGUI Class Reference

Class ilObjCloudGUI. More...

+ Inheritance diagram for ilObjCloudGUI:
+ Collaboration diagram for ilObjCloudGUI:

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 
 getType ()
 Get type. More...
 
 executeCommand ()
 
 getStandardCmd ()
 Get standard command. More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 infoScreen ()
 show information screen More...
 
 render ()
 
 asyncGetBlock ()
 
 getFile ()
 
 asyncGetActionListContent ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 isVisible ()
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 _goto Deep link More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 afterSave (ilObjCloud $a_new_object)
 
 serviceAuth (ilObjCloud $object)
 
 afterServiceAuth ()
 
 addHeaderAction ()
 Add header action menu. More...
 
 addLocatorItems ()
 addLocatorItems More...
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $plugin_service
 ilCloudPluginService More...
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjCloudGUI::__construct (   $a_id = 0,
  $a_id_type = self::REPOSITORY_NODE_ID,
  $a_parent_node_id = 0 
)
Parameters
int$a_id
int$a_id_type
int$a_parent_node_id

Reimplemented from ilObject2GUI.

Definition at line 36 of file class.ilObjCloudGUI.php.

36 {
37 global $lng;
38
39 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
40 $lng->loadLanguageModule("cld");
41 }

References ilObjectGUI\$lng.

Member Function Documentation

◆ _goto()

static ilObjCloudGUI::_goto (   $a_target)
static

_goto Deep link

Parameters
string$a_target

Definition at line 196 of file class.ilObjCloudGUI.php.

196 {
197 $content = explode("_", $a_target);
198 $_GET["ref_id"] = $content[0];
199 $_POST["path"] = $content[2];
200 $_GET["baseClass"] = "ilrepositorygUI";
201 $_GET["cmdClass"] = "ilobjcloudgui";
202 $_GET["cmd"] = "render";
203 include("ilias.php");
204 }
$_GET["client_id"]
$_POST['username']
Definition: cron.php:12

References $_GET, and $_POST.

◆ addHeaderAction()

ilObjCloudGUI::addHeaderAction ( )
protected

Add header action menu.

Reimplemented from ilObjectGUI.

Definition at line 403 of file class.ilObjCloudGUI.php.

403 {
404 $lg = $this->initHeaderAction();
405 if ($lg) {
406 $header_action_class = ilCloudConnector::getHeaderActionGUIClass($this->plugin_service);
407 $header_action_class->addCustomHeaderAction($lg);
408 $this->insertHeaderAction($lg);
409 }
410 }
static getHeaderActionGUIClass(ilCloudPluginService $plugin_service_class)
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
insertHeaderAction($a_list_gui)
Insert header action into main template.
$lg
Definition: example_018.php:62

References $lg, ilCloudConnector\getHeaderActionGUIClass(), ilObject2GUI\initHeaderAction(), and ilObjectGUI\insertHeaderAction().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjCloudGUI::addLocatorItems ( )
protected

addLocatorItems

Reimplemented from ilObject2GUI.

Definition at line 416 of file class.ilObjCloudGUI.php.

416 {
417 global $ilLocator;
418
419 if (is_object($this->object)) {
420 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
421 }
422 }

◆ afterSave()

ilObjCloudGUI::afterSave ( ilObjCloud  $a_new_object)
protected
Parameters
ilObjCloud$a_new_object

Definition at line 338 of file class.ilObjCloudGUI.php.

338 {
339 try {
340 $form = $this->initCreateForm("cld");
341
342 if ($form->checkInput()) {
343 $a_new_object->setServiceName($form->getInput("service"));
344 $a_new_object->setRootFolder("/");
345 $a_new_object->setOnline(false);
346 $a_new_object->setAuthComplete(false);
347 $this->plugin_service = new ilCloudPluginService($a_new_object->getServiceName(), $a_new_object->getId());
348 $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service);
349 if ($init_gui) {
350 $init_gui->afterSavePluginCreation($a_new_object, $form);
351 }
352 $a_new_object->update();
353 $this->serviceAuth($a_new_object);
354 }
355 } catch (Exception $e) {
356 ilUtil::sendFailure($e->getMessage(), true);
357 ilObjectGUI::redirectToRefId($this->parent_id);
358 }
359 }
static getCreationGUIClass(ilCloudPluginService $plugin_service_class)
Class ilCloudPluginService.
serviceAuth(ilObjCloud $object)
initCreateForm($a_new_type)
Init object creation form.
setServiceName($a_val)
Set service.
getServiceName()
Get service.
setAuthComplete($auth_complete)
setRootFolder($a_val, $no_check=false)
Set root_folder, this may only be changed by the owner of the object.
setOnline($a_val)
Set online.
update()
update object in db
getId()
get object id @access public
redirectToRefId($a_ref_id, $a_cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References ilCloudConnector\getCreationGUIClass(), ilObject2\getId(), ilObjCloud\getServiceName(), initCreateForm(), ilObjectGUI\redirectToRefId(), ilUtil\sendFailure(), serviceAuth(), ilObjCloud\setAuthComplete(), ilObjCloud\setOnline(), ilObjCloud\setRootFolder(), ilObjCloud\setServiceName(), and ilObject2\update().

+ Here is the call graph for this function:

◆ afterServiceAuth()

ilObjCloudGUI::afterServiceAuth ( )
protected

Definition at line 376 of file class.ilObjCloudGUI.php.

376 {
377 global $ilCtrl, $lng;
378
379 try {
380 if ($this->plugin_service->afterAuthService()) {
381 $this->object->setRootId("root", true);
382 $this->object->setAuthComplete(true);
383 $this->object->update();
384 ilUtil::sendSuccess($lng->txt("cld_object_added"), true);
385 $ilCtrl->redirectByClass("ilCloudPluginSettingsGUI", "editSettings");
386 } else {
387 include_once("./Services/Repository/classes/class.ilRepUtil.php");
388 ilRepUtil::deleteObjects($this->object->getRefId(), $this->object->getRefId());
389
390 ilUtil::sendFailure($lng->txt("cld_auth_failed_no_object_created"), true);
391 ilObjectGUI::redirectToRefId($this->parent_id);
392 }
393 } catch (Exception $e) {
394 ilUtil::sendFailure($e->getMessage(), true);
395 ilObjectGUI::redirectToRefId($this->parent_id);
396 }
397 }
static deleteObjects($a_cur_ref_id, $a_ids)
Delete objects.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, ilObjectGUI\$lng, ilRepUtil\deleteObjects(), ilObjectGUI\redirectToRefId(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ asyncGetActionListContent()

ilObjCloudGUI::asyncGetActionListContent ( )

Definition at line 473 of file class.ilObjCloudGUI.php.

473 {
474 $action_list = ilCloudConnector::getActionListGUIClass($this->plugin_service);
476
477 return $action_list->asyncGetContent($this->checkPermissionBool("delete_files"), $this->checkPermissionBool("delete_folders"), $file_tree->getNodeFromId($_GET["node_id"]));
478 }
static getActionListGUIClass(ilCloudPluginService $plugin_service_class)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.

References $_GET, ilObject2GUI\checkPermissionBool(), ilCloudConnector\getActionListGUIClass(), and ilCloudFileTree\getFileTreeFromSession().

+ Here is the call graph for this function:

◆ asyncGetBlock()

ilObjCloudGUI::asyncGetBlock ( )

Definition at line 431 of file class.ilObjCloudGUI.php.

431 {
432 global $tpl;
433
434 $response = new stdClass();
435 $response->message = NULL;
436 $response->locator = NULL;
437 $response->content = NULL;
438 $response->success = NULL;
439
440 try {
442 $file_tree->updateFileTree($_POST["path"]);
443 $node = $file_tree->getNodeFromPath($_POST["path"]);
444 $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->plugin_service, $file_tree);
445 $response->content = $file_tree_gui->getFolderHtml($this, $node->getId(), $this->checkPermissionBool("delete_files"), $this->checkPermissionBool("delete_folders"), $this->checkPermissionBool("download"), $this->checkPermissionBool("files_visible"), $this->checkPermissionBool("folders_visible"));
446
447 $response->locator = $file_tree_gui->getLocatorHtml($file_tree->getNodeFromId($node->getId()));
448 $response->success = true;
449 } catch (Exception $e) {
450 $response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
451 }
452
453 header('Content-type: application/json');
454 echo ilJsonUtil::encode($response);
455 exit;
456 }
static getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
static encode($mixed, $suppress_native=false)
exit
Definition: login.php:54

References $_POST, ilObjectGUI\$tpl, ilJsonUtil\encode(), exit, ilCloudFileTree\getFileTreeFromSession(), and ilCloudConnector\getFileTreeGUIClass().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjCloudGUI::executeCommand ( )
Returns
bool
Exceptions
ilCloudException

Reimplemented from ilObject2GUI.

Definition at line 56 of file class.ilObjCloudGUI.php.

56 {
57 global $ilCtrl, $ilTabs, $ilNavigationHistory, $lng;
58
59 // Navigation History
60 $link = $ilCtrl->getLinkTarget($this, "render");
61
62 try {
64 } catch (Exception $e) {
65 ilUtil::sendFailure($lng->txt("cld_no_service_active"), true);
66 ilObjectGUI::redirectToRefId($this->parent_id);
67 }
68
69 if ($this->object != NULL) {
70 $ilNavigationHistory->addItem($this->object->getRefId(), $link, "cld");
71
72 try {
73 ilCloudConnector::checkServiceActive($this->object->getServiceName());
74 } catch (Exception $e) {
75 ilUtil::sendFailure($lng->txt("cld_plugin_not_active"), true);
76 ilObjectGUI::redirectToRefId($this->parent_id);
77 }
78
79 if ($this->object->getAuthComplete() == false && !$_GET["authMode"]) {
80 if ($this->checkPermissionBool("write")) {
81 $this->serviceAuth($this->object);
82 } else {
83 ilUtil::sendFailure($lng->txt("cld_auth_failed"), true);
84 ilObjectGUI::redirectToRefId($this->parent_id);
85 }
86 }
87 $this->plugin_service = ilCloudConnector::getServiceClass($this->object->getServiceName(), $this->object->getId(), false);
88 }
89
90 $next_class = $ilCtrl->getNextClass($this);
91
92 $cmd = $ilCtrl->getCmd($this);
93 switch ($cmd) {
94 case "editSettings" :
95 $next_class = "ilcloudpluginsettingsgui";
96 break;
97 case "afterServiceAuth" :
98 $this->checkPermission("write");
99 $this->$cmd();
100
101 return;
102 case "infoScreen":
103 $this->prepareOutput();
104 $this->infoScreenObject();
105 return;
106 case "render" :
107 $this->addHeaderAction();
108 break;
109 }
110
111 switch ($next_class) {
112 case "ilinfoscreengui":
113 $this->prepareOutput();
114 $this->infoScreen();
115 break;
116 case "ilcommonactiondispatchergui":
117 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
119 $this->ctrl->forwardCommand($gui);
120 break;
121 case "ilpermissiongui":
122 $this->prepareOutput();
123 $ilTabs->activateTab("id_permissions");
124 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
125 $perm_gui = new ilPermissionGUI($this);
126 $this->ctrl->forwardCommand($perm_gui);
127 break;
128 case "ilcloudpluginuploadgui":
129 if ($this->checkPermissionBool("upload")) {
130 $upload_gui = ilCloudConnector::getUploadGUIClass($this->plugin_service);
131 $this->ctrl->forwardCommand($upload_gui);
132 }
133 break;
134 case "ilcloudplugincreatefoldergui":
135 if ($this->checkPermissionBool("folders_create")) {
136 $folder_gui = ilCloudConnector::getCreateFolderGUIClass($this->plugin_service);
137 $this->ctrl->forwardCommand($folder_gui);
138 }
139 break;
140 case "ilcloudplugindeletegui":
141 if ($this->checkPermissionBool("delete_files") || $this->checkPermissionBool("delete_folders")) {
142 $delete_gui = ilCloudConnector::getDeleteGUIClass($this->plugin_service);
143 $this->ctrl->forwardCommand($delete_gui);
144 }
145 break;
146 case "ilcloudpluginsettingsgui":
147 $this->prepareOutput();
148 if ($this->checkPermissionBool("write")) {
149 $settings_gui = ilCloudConnector::getSettingsGUIClass($this->plugin_service);
150 $settings_gui->setCloudObject($this->object);
151 $this->ctrl->forwardCommand($settings_gui);
152 }
153 break;
154 case "ilcloudpluginactionlistgui":
155 $action_list_gui = ilCloudConnector::getActionListGUIClass($this->plugin_service);
156 $this->ctrl->forwardCommand($action_list_gui);
157 break;
158 case "ilcloudpluginitemcreationlistgui":
159 $item_creation_gui = ilCloudConnector::getItemCreationListGUIClass($this->plugin_service);
160 $this->ctrl->forwardCommand($item_creation_gui);
161 break;
162 case "ilcloudpluginfiletreegui":
164 $this->ctrl->forwardCommand($file_tree_gui);
165 break;
166 case "ilcloudpluginheaderactiongui":
167 $header_action_gui = ilCloudConnector::getHeaderActionGUIClass($this->plugin_service);
168 $this->ctrl->forwardCommand($header_action_gui);
169 break;
170 case "ilcloudplugininitgui":
171 $init_gui = ilCloudConnector::getInitGUIClass($this->plugin_service);
172 $this->ctrl->forwardCommand($init_gui);
173 break;
174 default:
175 return parent::executeCommand();
176 }
177
178 return true;
179 }
static checkServiceActive($name)
static getServiceClass($service_name, $obj_id, $connect=true)
static getInitGUIClass(ilCloudPluginService $plugin_service_class)
static getCreateFolderGUIClass(ilCloudPluginService $plugin_service_class)
static getUploadGUIClass(ilCloudPluginService $plugin_service_class)
static getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
static getSettingsGUIClass(ilCloudPluginService $plugin_service_class)
static getDeleteGUIClass(ilCloudPluginService $plugin_service_class)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
addHeaderAction()
Add header action menu.
infoScreen()
show information screen
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
prepareOutput()
prepare output
checkPermission($a_perm, $a_cmd="")
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ilCtrl, ilObjectGUI\$lng, addHeaderAction(), ilObject2GUI\checkPermission(), ilObject2GUI\checkPermissionBool(), ilCloudConnector\checkServiceActive(), ilCloudConnector\getActionListGUIClass(), ilCloudConnector\getActiveServices(), ilCloudConnector\getCreateFolderGUIClass(), ilCloudConnector\getDeleteGUIClass(), ilCloudFileTree\getFileTreeFromSession(), ilCloudConnector\getFileTreeGUIClass(), ilCloudConnector\getHeaderActionGUIClass(), ilCloudConnector\getInitGUIClass(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilCloudConnector\getItemCreationListGUIClass(), ilCloudConnector\getServiceClass(), ilCloudConnector\getSettingsGUIClass(), ilCloudConnector\getUploadGUIClass(), infoScreen(), infoScreenObject(), ilObject2GUI\prepareOutput(), ilObjectGUI\redirectToRefId(), ilUtil\sendFailure(), and serviceAuth().

+ Here is the call graph for this function:

◆ getFile()

ilObjCloudGUI::getFile ( )

Definition at line 459 of file class.ilObjCloudGUI.php.

459 {
460 global $ilTabs;
461 if ($this->checkPermissionBool("download")) {
462 try {
464 $file_tree->downloadFromService($_GET['id']);
465 } catch (Exception $e) {
466 $ilTabs->activateTab("content");
467 ilUtil::sendFailure($e->getMessage());
468 }
469 }
470 }

References $_GET, ilObject2GUI\checkPermissionBool(), ilCloudFileTree\getFileTreeFromSession(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getStandardCmd()

ilObjCloudGUI::getStandardCmd ( )

Get standard command.

Definition at line 185 of file class.ilObjCloudGUI.php.

185 {
186 return "render";
187 }

◆ getType()

ilObjCloudGUI::getType ( )
final

Get type.

Reimplemented from ilObject2GUI.

Definition at line 47 of file class.ilObjCloudGUI.php.

47 {
48 return "cld";
49 }

Referenced by ilCloudPluginInfoScreenGUI\getInfoScreen().

+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCloudGUI::infoScreen ( )

show information screen

Definition at line 244 of file class.ilObjCloudGUI.php.

244 {
245 global $ilTabs, $ilErr;
246
247 $ilTabs->activateTab("id_info");
248
249 if (!$this->checkPermissionBool("visible")) {
250 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
251 }
252
253 $plugin_info = ilCloudConnector::getInfoScreenGUIClass($this->plugin_service);
254 $info = $plugin_info->getInfoScreen($this);
255 $this->ctrl->forwardCommand($info);
256 }
static getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)
$info
Definition: example_052.php:80

References $ilErr, $info, ilObject2GUI\checkPermissionBool(), and ilCloudConnector\getInfoScreenGUIClass().

Referenced by executeCommand(), and infoScreenObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjCloudGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 211 of file class.ilObjCloudGUI.php.

212 {
213 $this->ctrl->setCmd("showSummary");
214 $this->ctrl->setCmdClass("ilinfoscreengui");
215 $this->infoScreen();
216 }

References infoScreen().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjCloudGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

Definition at line 284 of file class.ilObjCloudGUI.php.

284 {
285 global $lng;
286
287 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
288 $form = new ilPropertyFormGUI();
289 $form->setTarget("_top");
290 $form->setFormAction($this->ctrl->getFormAction($this, "save"));
291 $form->setTitle($this->lng->txt($a_new_type . "_new"));
292
293 // title
294 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
295 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
296 $ti->setMaxLength(ilObject::TITLE_LENGTH);
297 $ti->setRequired(true);
298 $form->addItem($ti);
299
300 // description
301 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
302 $ta->setCols(40);
303 $ta->setRows(2);
304 $form->addItem($ta);
305
306 $services_group = new ilRadioGroupInputGUI($lng->txt("cld_service"), "service");
307 $services_group->setRequired(true);
308 foreach (ilCloudConnector::getActiveServices() as $service) {
309 $option = new ilRadioOption($service, $service);
310 $hook_object = ilCloudConnector::getPluginHookClass($option->getValue());
311 $option->setTitle($hook_object->txt($service));
312 $option->setInfo($hook_object->txt("create_info"));
313 $this->plugin_service = ilCloudConnector::getServiceClass($service, 0, false);
314 $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service);
315 if ($init_gui) {
316 $init_gui->initPluginCreationFormSection($option);
317 }
318 $services_group->addOption($option);
319 }
320
321 //Select first radio-button by default
322 $services_group->setValue(array_shift($services_group->getOptions())->getValue());
323
324 $form->addItem($services_group);
325
326 $form = $this->initDidacticTemplate($form);
327
328 $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
329 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
330
331 return $form;
332 }
static getPluginHookClass($service_name)
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
const TITLE_LENGTH
max length of object title
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References ilObjectGUI\$lng, ilCloudConnector\getActiveServices(), ilCloudConnector\getCreationGUIClass(), ilCloudConnector\getPluginHookClass(), ilCloudConnector\getServiceClass(), ilObjectGUI\initDidacticTemplate(), and ilObject\TITLE_LENGTH.

Referenced by afterSave(), and initCreationForms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjCloudGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

Definition at line 268 of file class.ilObjCloudGUI.php.

268 {
269 $forms = array(
270 self::CFORM_NEW => $this->initCreateForm($a_new_type)
271 );
272
273 return $forms;
274 }

References initCreateForm().

+ Here is the call graph for this function:

◆ render()

ilObjCloudGUI::render ( )

Definition at line 425 of file class.ilObjCloudGUI.php.

425 {
426 $init_gui = ilCloudConnector::getInitGUIClass($this->plugin_service);
427 $init_gui->initGUI($this, $this->checkPermissionBool("folders_create"), $this->checkPermissionBool("upload"), $this->checkPermissionBool("delete_files"), $this->checkPermissionBool("delete_folders"), $this->checkPermissionBool("download"), $this->checkPermissionBool("files_visible"), $this->checkPermissionBool("folders_visible"));
428 }

References ilObject2GUI\checkPermissionBool(), and ilCloudConnector\getInitGUIClass().

+ Here is the call graph for this function:

◆ serviceAuth()

ilObjCloudGUI::serviceAuth ( ilObjCloud  $object)
protected
Parameters
$object

Definition at line 365 of file class.ilObjCloudGUI.php.

365 {
366 global $ilCtrl;
367 try {
368 $service = ilCloudConnector::getServiceClass($object->getServiceName(), $object->getId());
369 $service->authService($ilCtrl->getLinkTarget($this, "afterServiceAuth") . "&authMode=true");
370 } catch (Exception $e) {
371 ilUtil::sendFailure($e->getMessage(), true);
372 ilObjectGUI::redirectToRefId($this->parent_id);
373 }
374 }

References $ilCtrl, ilObjectGUI\$object, ilCloudConnector\getServiceClass(), ilObjectGUI\redirectToRefId(), and ilUtil\sendFailure().

Referenced by afterSave(), and executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjCloudGUI::setTabs ( )

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 220 of file class.ilObjCloudGUI.php.

220 {
221 global $ilTabs, $ilCtrl, $ilAccess, $lng;
222
223 // tab for the "show content" command
224 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
225 $ilTabs->addTab("content", $lng->txt("content"), $ilCtrl->getLinkTarget($this, "render"));
226 $ilTabs->addTab("id_info", $lng->txt("info_short"), $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
227 }
228
229 // a "properties" tab
230 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
231 $ilTabs->addTab("settings", $lng->txt("settings"), $ilCtrl->getLinkTargetByClass("ilcloudpluginsettingsgui", "editSettings"));
232 }
233
234 // edit permissions
235 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
236 $ilTabs->addTab("id_permissions", $lng->txt("perm_settings"), $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
237 }
238 }

References $ilCtrl, and ilObjectGUI\$lng.

Field Documentation

◆ $plugin_service

ilObjCloudGUI::$plugin_service
protected

ilCloudPluginService

Definition at line 28 of file class.ilObjCloudGUI.php.


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