ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 infoScreen ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getCtrl ()
 
 setCtrl (\ilCtrl $ctrl)
 
 infoScreenForward ()
 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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 isVisible ($a_ref_id, $a_type)
 
 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...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 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 ()
 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...
 
 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...
 
 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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

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...
 
 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...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) 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 (ilColumnGUI $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...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 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...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. 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)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 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...
 
 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...
 
 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...
 
 getTabs ()
 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 (ilColumnGUI $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...
 
 $ctrl
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $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 41 of file class.ilObjCloudGUI.php.

42 {
43 global $DIC;
44 $lng = $DIC['lng'];
45
46 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
47 $lng->loadLanguageModule("cld");
48 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilObjectGUI\$lng, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjCloudGUI::_goto (   $a_target)
static

_goto Deep link

Parameters
string$a_target

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

210 {
211 $content = explode("_", $a_target);
212
213 $_GET["ref_id"] = $content[0];
214 $_GET["baseClass"] = "ilrepositorygUI";
215 $_GET["cmdClass"] = "ilobjcloudgui";
216 $_GET["cmd"] = "render";
217
218 if (in_array("path", $content)) {
219 // remove ref_id, "path" und "endPath"
220 unset($content[0]);
221 unset($content[1]);
222 array_pop($content);
223 // reconstruct and set path
224 $_POST["path"] = urldecode(implode('_', $content));
225 }
226
227
228 include("ilias.php");
229 }
$_GET["client_id"]
$_POST["username"]

References $_GET, and $_POST.

◆ addHeaderAction()

ilObjCloudGUI::addHeaderAction ( )
protected

Add header action menu.

Reimplemented from ilObjectGUI.

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

467 {
468 $lg = $this->initHeaderAction();
469 if ($lg) {
470 $header_action_class = ilCloudConnector::getHeaderActionGUIClass($this->plugin_service);
471 $header_action_class->addCustomHeaderAction($lg);
472 $this->insertHeaderAction($lg);
473 }
474 }
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.

References 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 480 of file class.ilObjCloudGUI.php.

481 {
482 global $DIC;
483 $ilLocator = $DIC['ilLocator'];
484
485 if (is_object($this->object)) {
486 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
487 }
488 }

References $DIC.

◆ afterServiceAuth()

ilObjCloudGUI::afterServiceAuth ( )
protected

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

437 {
438 global $DIC;
439 $ilCtrl = $DIC['ilCtrl'];
440 $lng = $DIC['lng'];
441
442 try {
443 if ($this->plugin_service->afterAuthService()) {
444 $this->object->setRootId("root", true);
445 $this->object->setAuthComplete(true);
446 $this->object->update();
447 ilUtil::sendSuccess($lng->txt("cld_object_added"), true);
448 $ilCtrl->redirectByClass("ilCloudPluginSettingsGUI", "editSettings");
449 } else {
450 include_once("./Services/Repository/classes/class.ilRepUtil.php");
451 ilRepUtil::deleteObjects($this->object->getRefId(), $this->object->getRefId());
452
453 ilUtil::sendFailure($lng->txt("cld_auth_failed_no_object_created"), true);
454 ilObjectGUI::redirectToRefId($this->parent_id);
455 }
456 } catch (Exception $e) {
457 ilUtil::sendFailure($e->getMessage(), true);
458 ilObjectGUI::redirectToRefId($this->parent_id);
459 }
460 }
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 deleteObjects($a_cur_ref_id, $a_ids)
Delete objects.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $DIC, Vendor\Package\$e, ilObjectGUI\$lng, ilRepUtil\deleteObjects(), ilObjectGUI\redirectToRefId(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ asyncGetActionListContent()

ilObjCloudGUI::asyncGetActionListContent ( )

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

562 {
563 $action_list = ilCloudConnector::getActionListGUIClass($this->plugin_service);
565
566 return $action_list->asyncGetContent($this->checkPermissionBool("delete_files"), $this->checkPermissionBool("delete_folders"), $file_tree->getNodeFromId($_GET["node_id"]));
567 }
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 507 of file class.ilObjCloudGUI.php.

508 {
509 global $DIC;
510 $tpl = $DIC['tpl'];
511
512 $response = new stdClass();
513 $response->message = null;
514 $response->locator = null;
515 $response->content = null;
516 $response->success = null;
517
518 try {
520 $file_tree->updateFileTree($_POST["path"]);
521 $node = $file_tree->getNodeFromPath($_POST["path"]);
522 $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->plugin_service, $file_tree);
523 $response->content = $file_tree_gui->getFolderHtml(
524 $this,
525 $node->getId(),
526 $this->checkPermissionBool("delete_files"),
527 $this->checkPermissionBool("delete_folders"),
528 $this->checkPermissionBool("download"),
529 $this->checkPermissionBool("files_visible"),
530 $this->checkPermissionBool("folders_visible")
531 );
532
533 $response->locator = $file_tree_gui->getLocatorHtml($file_tree->getNodeFromId($node->getId()));
534 $response->success = true;
535 } catch (Exception $e) {
536 $response->message = ilUtil::getSystemMessageHTML($e->getMessage(), "failure");
537 }
538
539 header('Content-type: application/json');
541 exit;
542 }
static getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
static encode($mixed, $suppress_native=false)
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
exit
Definition: login.php:29
$response

References $_POST, $DIC, Vendor\Package\$e, $response, ilObjectGUI\$tpl, ilJsonUtil\encode(), exit, ilCloudFileTree\getFileTreeFromSession(), ilCloudConnector\getFileTreeGUIClass(), and ilUtil\getSystemMessageHTML().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjCloudGUI::executeCommand ( )
Returns
bool
Exceptions
ilCloudException

Reimplemented from ilObject2GUI.

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

65 {
66 global $DIC;
67 $ilCtrl = $DIC['ilCtrl'];
68 $ilTabs = $DIC['ilTabs'];
69 $ilNavigationHistory = $DIC['ilNavigationHistory'];
70 $lng = $DIC['lng'];
71
72 // Navigation History
73 $link = $ilCtrl->getLinkTarget($this, "render");
74
75 try {
77 } catch (Exception $e) {
78 ilUtil::sendFailure($lng->txt("cld_no_service_active"), true);
79 ilObjectGUI::redirectToRefId($this->parent_id);
80 }
81
82 if ($this->object != null) {
83 $ilNavigationHistory->addItem($this->object->getRefId(), $link, "cld");
84
85 try {
86 ilCloudConnector::checkServiceActive($this->object->getServiceName());
87 } catch (Exception $e) {
88 ilUtil::sendFailure($lng->txt("cld_plugin_not_active"), true);
89 ilObjectGUI::redirectToRefId($this->parent_id);
90 }
91
92 if ($this->object->getAuthComplete() == false && !$_GET["authMode"]) {
93 if ($this->checkPermissionBool("write")) {
94 $this->serviceAuth($this->object);
95 } else {
96 ilUtil::sendFailure($lng->txt("cld_auth_failed"), true);
97 ilObjectGUI::redirectToRefId($this->parent_id);
98 }
99 }
100 $this->plugin_service = ilCloudConnector::getServiceClass($this->object->getServiceName(), $this->object->getId(), false);
101 }
102
103 $next_class = $ilCtrl->getNextClass($this);
104
105 $cmd = $ilCtrl->getCmd($this);
106 switch ($cmd) {
107 case "editSettings":
108 $next_class = "ilcloudpluginsettingsgui";
109 break;
110 case "afterServiceAuth":
111 $this->checkPermission("write");
112 $this->$cmd();
113
114 return;
115 case "render":
116 $this->addHeaderAction();
117 break;
118 case 'infoScreen':
119 $this->ctrl->redirectByClass(ilInfoScreenGUI::class);
120 break;
121 }
122
123 switch ($next_class) {
124 case "ilinfoscreengui":
125 $this->prepareOutput();
126 $this->infoScreenForward();
127 break;
128 case "ilcommonactiondispatchergui":
129 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
131 $this->ctrl->forwardCommand($gui);
132 break;
133 case "ilpermissiongui":
134 $this->prepareOutput();
135 $ilTabs->activateTab("id_permissions");
136 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
137 $perm_gui = new ilPermissionGUI($this);
138 $this->ctrl->forwardCommand($perm_gui);
139 break;
140 case "ilcloudpluginuploadgui":
141 if ($this->checkPermissionBool("upload")) {
142 $upload_gui = ilCloudConnector::getUploadGUIClass($this->plugin_service);
143 $this->ctrl->forwardCommand($upload_gui);
144 }
145 break;
146 case "ilcloudplugincreatefoldergui":
147 if ($this->checkPermissionBool("folders_create")) {
148 $folder_gui = ilCloudConnector::getCreateFolderGUIClass($this->plugin_service);
149 $this->ctrl->forwardCommand($folder_gui);
150 }
151 break;
152 case "ilcloudplugindeletegui":
153 if ($this->checkPermissionBool("delete_files") || $this->checkPermissionBool("delete_folders")) {
154 $delete_gui = ilCloudConnector::getDeleteGUIClass($this->plugin_service);
155 $this->ctrl->forwardCommand($delete_gui);
156 }
157 break;
158 case "ilcloudpluginsettingsgui":
159 $this->prepareOutput();
160 if ($this->checkPermissionBool("write")) {
161 $settings_gui = ilCloudConnector::getSettingsGUIClass($this->plugin_service);
162 $settings_gui->setCloudObject($this->object);
163 $this->ctrl->forwardCommand($settings_gui);
164 }
165 break;
166 case "ilcloudpluginactionlistgui":
167 $action_list_gui = ilCloudConnector::getActionListGUIClass($this->plugin_service);
168 $this->ctrl->forwardCommand($action_list_gui);
169 break;
170 case "ilcloudpluginitemcreationlistgui":
171 $item_creation_gui = ilCloudConnector::getItemCreationListGUIClass($this->plugin_service);
172 $this->ctrl->forwardCommand($item_creation_gui);
173 break;
174 case "ilcloudpluginfiletreegui":
176 $this->ctrl->forwardCommand($file_tree_gui);
177 break;
178 case "ilcloudpluginheaderactiongui":
179 $header_action_gui = ilCloudConnector::getHeaderActionGUIClass($this->plugin_service);
180 $this->ctrl->forwardCommand($header_action_gui);
181 break;
182 case "ilcloudplugininitgui":
183 $init_gui = ilCloudConnector::getInitGUIClass($this->plugin_service);
184 $this->ctrl->forwardCommand($init_gui);
185 break;
186 default:
187 return parent::executeCommand();
188 }
189
190 return true;
191 }
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.
infoScreenForward()
show information screen
serviceAuth(ilObjCloud $object)
prepareOutput($a_show_subobjects=true)
prepare output
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References $_GET, $DIC, Vendor\Package\$e, 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(), infoScreenForward(), ilObject2GUI\prepareOutput(), ilObjectGUI\redirectToRefId(), ilUtil\sendFailure(), and serviceAuth().

+ Here is the call graph for this function:

◆ getCtrl()

ilObjCloudGUI::getCtrl ( )
Returns
\ilCtrl

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

268 {
269 return $this->ctrl;
270 }

References $ctrl.

◆ getFile()

ilObjCloudGUI::getFile ( )

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

546 {
547 global $DIC;
548 $ilTabs = $DIC['ilTabs'];
549 if ($this->checkPermissionBool("download")) {
550 try {
552 $file_tree->downloadFromService($_GET['id']);
553 } catch (Exception $e) {
554 $ilTabs->activateTab("content");
555 ilUtil::sendFailure($e->getMessage());
556 }
557 }
558 }

References $_GET, $DIC, Vendor\Package\$e, ilObject2GUI\checkPermissionBool(), ilCloudFileTree\getFileTreeFromSession(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getStandardCmd()

ilObjCloudGUI::getStandardCmd ( )

Get standard command.

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

198 {
199 return "render";
200 }

◆ getType()

ilObjCloudGUI::getType ( )
final

Get type.

Reimplemented from ilObject2GUI.

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

55 {
56 return "cld";
57 }

Referenced by ilCloudPluginInfoScreenGUI\getInfoScreen().

+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCloudGUI::infoScreen ( )

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

233 {
234 return false;
235 }

◆ infoScreenForward()

ilObjCloudGUI::infoScreenForward ( )

show information screen

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

286 {
287 global $DIC;
288 $ilTabs = $DIC['ilTabs'];
289 $ilErr = $DIC['ilErr'];
290
291 $ilTabs->activateTab("id_info");
292
293 if (!$this->checkPermissionBool("visible")) {
294 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
295 }
296
297 $plugin_info = ilCloudConnector::getInfoScreenGUIClass($this->plugin_service);
298 $info = $plugin_info->getInfoScreen($this);
299 $this->ctrl->forwardCommand($info);
300 }
static getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)

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

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 329 of file class.ilObjCloudGUI.php.

330 {
331 global $DIC;
332 $lng = $DIC['lng'];
333
334 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
335 $form = new ilPropertyFormGUI();
336 $form->setTarget("_top");
337 $this->ctrl->setParameter($this, 'new_type', 'cld');
338 $form->setFormAction($this->ctrl->getFormAction($this, "save"));
339 $form->setTitle($this->lng->txt($a_new_type . "_new"));
340
341 // title
342 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
343 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
344 $ti->setMaxLength(ilObject::TITLE_LENGTH);
345 $ti->setRequired(true);
346 $form->addItem($ti);
347
348 // description
349 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
350 $ta->setCols(40);
351 $ta->setRows(2);
352 $form->addItem($ta);
353
354 $services_group = new ilRadioGroupInputGUI($lng->txt("cld_service"), "service");
355 $services_group->setRequired(true);
357 $option = new ilRadioOption($service, $service);
358 $hook_object = ilCloudConnector::getPluginHookClass($option->getValue());
359 $option->setTitle($hook_object->txt($service));
360 $option->setInfo($hook_object->txt("create_info"));
361 $this->plugin_service = ilCloudConnector::getServiceClass($service, 0, false);
362 $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service);
363 if ($init_gui) {
364 $init_gui->initPluginCreationFormSection($option);
365 }
366 $services_group->addOption($option);
367 }
368
369 //Select first radio-button by default
370 $services_group->setValue(array_shift($services_group->getOptions())->getValue());
371
372 $form->addItem($services_group);
373
374 $form = $this->initDidacticTemplate($form);
375
376 $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
377 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
378
379 return $form;
380 }
static getCreationGUIClass(ilCloudPluginService $plugin_service_class)
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.
$service
Definition: result.php:17

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

Referenced by 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 312 of file class.ilObjCloudGUI.php.

313 {
314 $forms = array(
315 self::CFORM_NEW => $this->initCreateForm($a_new_type),
316 );
317
318 return $forms;
319 }
initCreateForm($a_new_type)
Init object creation form.

References initCreateForm().

+ Here is the call graph for this function:

◆ render()

ilObjCloudGUI::render ( )

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

492 {
493 $init_gui = ilCloudConnector::getInitGUIClass($this->plugin_service);
494 $init_gui->initGUI(
495 $this,
496 $this->checkPermissionBool("folders_create"),
497 $this->checkPermissionBool("upload"),
498 $this->checkPermissionBool("delete_files"),
499 $this->checkPermissionBool("delete_folders"),
500 $this->checkPermissionBool("download"),
501 $this->checkPermissionBool("files_visible"),
502 $this->checkPermissionBool("folders_visible")
503 );
504 }

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 422 of file class.ilObjCloudGUI.php.

423 {
424 global $DIC;
425 $ilCtrl = $DIC['ilCtrl'];
426 try {
427 $service = ilCloudConnector::getServiceClass($object->getServiceName(), $object->getId());
428 $service->authService($ilCtrl->getLinkTarget($this, "afterServiceAuth") . "&authMode=true");
429 } catch (Exception $e) {
430 ilUtil::sendFailure($e->getMessage(), true);
431 ilObjectGUI::redirectToRefId($this->parent_id);
432 }
433 }

References $DIC, Vendor\Package\$e, ilObjectGUI\$object, $service, ilCloudConnector\getServiceClass(), ilObjectGUI\redirectToRefId(), and ilUtil\sendFailure().

Referenced by executeCommand().

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

◆ setCtrl()

ilObjCloudGUI::setCtrl ( \ilCtrl  $ctrl)
Parameters
\ilCtrl$ctrl

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

277 {
278 $this->ctrl = $ctrl;
279 }

References $ctrl.

◆ 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 238 of file class.ilObjCloudGUI.php.

239 {
240 global $DIC;
241 $ilTabs = $DIC['ilTabs'];
242 $ilCtrl = $DIC['ilCtrl'];
243 $ilAccess = $DIC['ilAccess'];
244 $lng = $DIC['lng'];
245
246 // tab for the "show content" command
247 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
248 $ilTabs->addTab("content", $lng->txt("content"), $ilCtrl->getLinkTarget($this, "render"));
249 $ilTabs->addTab("id_info", $lng->txt("info_short"), $this->ctrl->getLinkTargetByClass(ilInfoScreenGUI::class, "showSummary"));
250 }
251
252 // a "properties" tab
253 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
254 $ilTabs->addTab("settings", $lng->txt("settings"), $ilCtrl->getLinkTargetByClass(ilCloudPluginSettingsGUI::class, "editSettings"));
255 }
256
257 // edit permissions
258 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
259 $ilTabs->addTab("id_permissions", $lng->txt("perm_settings"), $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, "perm"));
260 }
261 }

References $DIC, and ilObjectGUI\$lng.

Field Documentation

◆ $ctrl

ilObjCloudGUI::$ctrl
protected

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

Referenced by getCtrl(), and setCtrl().

◆ $plugin_service

ilObjCloudGUI::$plugin_service
protected

ilCloudPluginService

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


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