ILIAS  release_8 Revision v8.24
ilObjectPluginGUI Class Reference

Object GUI class for repository plugins. More...

+ Inheritance diagram for ilObjectPluginGUI:
+ Collaboration diagram for ilObjectPluginGUI:

Public Member Functions

 executeCommand ()
 execute command More...
 
 getAfterCreationCmd ()
 Cmd that will be redirected to after creation of a new object. More...
 
 getStandardCmd ()
 
 performCommand (string $cmd)
 
 addInilPluginAdminfoTab ()
 
 addPermissionTab ()
 
 addInfoTab ()
 
 addExportTab ()
 
 infoScreen ()
 
 addInfoItems (ilInfoScreenGUI $info)
 Add items to info screen. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 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 (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 cancelDelete ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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 More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (array $a_target)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 addLocatorItems ()
 Functions to be overwritten. More...
 
 getPlugin ()
 Get plugin object. More...
 
 txt (string $a_var)
 
 getCreationFormTitle (int $a_form_type)
 Use custom creation form titles. More...
 
 initCreationForms (string $new_type)
 Init creation forms this will create the default creation forms: new, import, clone. More...
 
 supportsCloning ()
 
 initCreateForm (string $new_type)
 Init object creation form. More...
 
 initEditForm ()
 Init object update form. More...
 
 initImportForm (string $new_type)
 Init object import form. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 supportsExport ()
 
 lookupParentTitleInCreationMode ()
 
- 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 ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_varname, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 addAdminLocatorItems (bool $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 (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget (string $append=null, bool $center=false)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ilComponentRepository $component_repository
 
ilNavigationHistory $nav_history
 
ilTabsGUI $tabs
 
ilPlugin $plugin = null
 
PluginSlotGUIRequest $slot_request
 
ilComponentFactory $component_factory
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilObjectService $object_service
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = array()
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

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 ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Object GUI class for repository plugins.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilObjectPluginGUI.php.

Member Function Documentation

◆ _goto()

static ilObjectPluginGUI::_goto ( array  $a_target)
static
Parameters
list<string>$a_target

Definition at line 462 of file class.ilObjectPluginGUI.php.

462 : void
463 {
464 global $DIC;
465 $main_tpl = $DIC->ui()->mainTemplate();
466
467 $ilCtrl = $DIC->ctrl();
468 $ilAccess = $DIC->access();
469 $lng = $DIC->language();
470
471 $t = explode("_", $a_target[0]);
472 $ref_id = (int) $t[0];
473 $class_name = $a_target[1];
474
475 if ($ilAccess->checkAccess("read", "", $ref_id)) {
476 $ilCtrl->setTargetScript('ilias.php');
477 $ilCtrl->setParameterByClass($class_name, "ref_id", $ref_id);
478 $ilCtrl->redirectByClass(["ilobjplugindispatchgui", $class_name], "");
479 } elseif ($ilAccess->checkAccess("visible", "", $ref_id)) {
480 $ilCtrl->setTargetScript('ilias.php');
481 $ilCtrl->setParameterByClass($class_name, "ref_id", $ref_id);
482 $ilCtrl->redirectByClass(["ilobjplugindispatchgui", $class_name], "infoScreen");
483 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
484 $main_tpl->setOnScreenMessage('failure', sprintf(
485 $lng->txt("msg_no_perm_read_item"),
487 ));
489 }
490 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
global $DIC
Definition: feed.php:28

References $DIC, ilObject2GUI\$lng, ilObjectGUI\$ref_id, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\int(), ROOT_FOLDER_ID, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ addExportTab()

ilObjectPluginGUI::addExportTab ( )

Definition at line 417 of file class.ilObjectPluginGUI.php.

417 : void
418 {
419 // write
420 if ($this->access->checkAccess('write', "", $this->object->getRefId())) {
421 $this->tabs->addTarget(
422 'export',
423 $this->ctrl->getLinkTargetByClass("ilexportgui", ''),
424 'export',
425 'ilexportgui'
426 );
427 }
428 }

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ addInfoItems()

ilObjectPluginGUI::addInfoItems ( ilInfoScreenGUI  $info)

Add items to info screen.

Definition at line 455 of file class.ilObjectPluginGUI.php.

455 : void
456 {
457 }

Referenced by infoScreen().

+ Here is the caller graph for this function:

◆ addInfoTab()

ilObjectPluginGUI::addInfoTab ( )

Definition at line 399 of file class.ilObjectPluginGUI.php.

399 : void
400 {
401 $ilAccess = $this->access;
402 $ilTabs = $this->tabs;
403
404 // info screen
405 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId())) {
406 $ilTabs->addTarget(
407 "info_short",
408 $this->ctrl->getLinkTargetByClass(
409 "ilinfoscreengui",
410 "showSummary"
411 ),
412 "showSummary"
413 );
414 }
415 }
ilAccessHandler $access
addTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)

References ilObject2GUI\$access, $tabs, ilTabsGUI\addTarget(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ addInilPluginAdminfoTab()

ilObjectPluginGUI::addInilPluginAdminfoTab ( )

Definition at line 364 of file class.ilObjectPluginGUI.php.

364 : void
365 {
366 $ilAccess = $this->access;
367 $ilTabs = $this->tabs;
368
369 // info screen
370 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId())) {
371 $ilTabs->addTarget(
372 "info_short",
373 $this->ctrl->getLinkTargetByClass(
374 "ilinfoscreengui",
375 "showSummary"
376 ),
377 "showSummary"
378 );
379 }
380 }

References ilObject2GUI\$access, $tabs, ilTabsGUI\addTarget(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjectPluginGUI::addLocatorItems ( )
protected

Functions to be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 184 of file class.ilObjectPluginGUI.php.

184 : void
185 {
186 $ilLocator = $this->locator;
187
188 if (!$this->getCreationMode()) {
189 $ilLocator->addItem(
190 $this->object->getTitle(),
191 $this->ctrl->getLinkTarget($this, $this->getStandardCmd()),
192 "",
193 $this->slot_request->getRefId()
194 );
195 }
196 }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator

References ilObject2GUI\$locator, ilLocatorGUI\addItem(), ilObject2GUI\getCreationMode(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addPermissionTab()

ilObjectPluginGUI::addPermissionTab ( )

Definition at line 382 of file class.ilObjectPluginGUI.php.

382 : void
383 {
384 $ilAccess = $this->access;
385 $ilTabs = $this->tabs;
386 $ilCtrl = $this->ctrl;
387
388 // edit permissions
389 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
390 $ilTabs->addTarget(
391 "perm_settings",
392 $ilCtrl->getLinkTargetByClass("ilpermissiongui", "perm"),
393 ["perm", "info", "owner"],
394 'ilpermissiongui'
395 );
396 }
397 }

References ilObject2GUI\$access, ilObject2GUI\$ctrl, and $tabs.

◆ afterSave()

ilObjectPluginGUI::afterSave ( ilObject  $new_object)
protected

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

Definition at line 344 of file class.ilObjectPluginGUI.php.

344 : void
345 {
346 $ilCtrl = $this->ctrl;
347 // always send a message
348 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
349
350 $ilCtrl->setTargetScript('ilias.php');
351 $ilCtrl->setParameterByClass(get_class($this), "ref_id", $new_object->getRefId());
352 $ilCtrl->redirectByClass(["ilobjplugindispatchgui", get_class($this)], $this->getAfterCreationCmd());
353 }
setTargetScript(string $a_target_script)
@inheritDoc
getAfterCreationCmd()
Cmd that will be redirected to after creation of a new object.

References ilObject2GUI\$ctrl, getAfterCreationCmd(), ilObject\getRefId(), ILIAS\Repository\lng(), and ilCtrl\setTargetScript().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjectPluginGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

Definition at line 62 of file class.ilObjectPluginGUI.php.

62 : void
63 {
64 $ilCtrl = $this->ctrl;
66 $ilAccess = $this->access;
68 $ilNavigationHistory = $this->nav_history;
69 $ilTabs = $this->tabs;
70
71 // get standard template (includes main menu and general layout)
73
74 // set title
75 if (!$this->getCreationMode()) {
76 $tpl->setTitle($this->object->getTitle());
77 $tpl->setTitleIcon(ilObject::_getIcon($this->object->getId()));
78
79 // set tabs
80 if (strtolower($this->slot_request->getBaseClass()) !== "iladministrationgui") {
81 $this->setTabs();
82 $this->setLocator();
83 } else {
84 $this->addAdminLocatorItems();
86 $this->setAdminTabs();
87 }
88
89 if ($ilAccess->checkAccess('read', '', $this->object->getRefId())) {
90 $ilNavigationHistory->addItem(
91 $this->object->getRefId(),
92 ilLink::_getLink($this->object->getRefId(), $this->object->getType()),
93 $this->object->getType()
94 );
95 }
96 } else {
97 // show info of parent
101 $this->slot_request->getRefId()
102 ), "big"),
104 $this->slot_request->getRefId(),
105 true
106 ))
107 );
108 $this->setLocator();
109 }
110
111 $next_class = $this->ctrl->getNextClass($this);
112 $cmd = $this->ctrl->getCmd();
113
114 switch ($next_class) {
115 case "ilinfoscreengui":
116 $this->checkPermission("visible");
117 $this->infoScreen(); // forwards command
118 break;
119
120 case 'ilpermissiongui':
121 $perm_gui = new ilPermissionGUI($this);
122 $ilTabs->setTabActive("perm_settings");
123 $ilCtrl->forwardCommand($perm_gui);
124 break;
125
126 case 'ilobjectcopygui':
127 $cp = new ilObjectCopyGUI($this);
128 $cp->setType($this->getType());
129 $this->ctrl->forwardCommand($cp);
130 break;
131
132 case 'ilexportgui':
133 // only if plugin supports it?
134 $this->tabs->setTabActive("export");
135 $exp = new ilExportGUI($this);
136 $exp->addFormat('xml');
137 $this->ctrl->forwardCommand($exp);
138 break;
139
140 case 'illearningprogressgui':
141 $user_id = $this->user->getId();
142 if ($this->slot_request->getUserId() > 0 && $this->access->checkAccess(
143 'write',
144 "",
145 $this->object->getRefId()
146 )) {
147 $user_id = $this->slot_request->getUserId();
148 }
149 $ilTabs->setTabActive("learning_progress");
150 $new_gui = new ilLearningProgressGUI(
152 $this->object->getRefId(),
153 $user_id
154 );
155 $this->ctrl->forwardCommand($new_gui);
156 break;
157 case 'ilcommonactiondispatchergui':
159 $this->ctrl->forwardCommand($gui);
160 break;
161 default:
162 if ($cmd === "save" || $this->getCreationMode()) {
163 $this->$cmd();
164 return;
165 }
166 if (!$cmd) {
167 $cmd = $this->getStandardCmd();
168 }
169 if ($cmd === "infoScreen") {
170 $ilCtrl->setCmd("showSummary");
171 $ilCtrl->setCmdClass("ilinfoscreengui");
172 $this->infoScreen();
173 } else {
174 $this->performCommand($cmd);
175 }
176 break;
177 }
178
179 if (!$this->getCreationMode()) {
181 }
182 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getType()
Functions that must be overwritten.
setTabs()
create tabs (repository/workspace switch)
ilGlobalTemplateInterface $tpl
addAdminLocatorItems(bool $do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded)
setLocator()
set Locator
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
GUI class for the workflow of copying objects.
setAdminTabs()
set admin tabs
ilNavigationHistory $nav_history
performCommand(string $cmd)
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
setLocator()
Insert locator.

References ilObject2GUI\$access, ilObject2GUI\$ctrl, ilObject2GUI\$lng, $nav_history, $tabs, ilObject2GUI\$tpl, ilObject\_getIcon(), ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObject2GUI\addAdminLocatorItems(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilObject2GUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getStandardCmd(), ilObject2GUI\getType(), infoScreen(), ilGlobalTemplateInterface\loadStandardTemplate(), lookupParentTitleInCreationMode(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), performCommand(), ilGlobalTemplateInterface\printToStdout(), ilObjectGUI\setAdminTabs(), ilObject2GUI\setLocator(), ilGlobalTemplateInterface\setLocator(), ilObject2GUI\setTabs(), ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), ILIAS\Repository\tabs(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getAfterCreationCmd()

ilObjectPluginGUI::getAfterCreationCmd ( )
abstract

Cmd that will be redirected to after creation of a new object.

Referenced by afterSave().

+ Here is the caller graph for this function:

◆ getCreationFormTitle()

ilObjectPluginGUI::getCreationFormTitle ( int  $a_form_type)
protected

Use custom creation form titles.

Definition at line 218 of file class.ilObjectPluginGUI.php.

218 : string
219 {
220 switch ($a_form_type) {
221 case self::CFORM_NEW:
222 return $this->txt($this->getType() . "_new");
223
225 return $this->lng->txt("import");
226
228 return $this->txt("objs_" . $this->getType() . "_duplicate");
229 }
230 return "";
231 }

References ilObjectGUI\CFORM_CLONE, ilObjectGUI\CFORM_IMPORT, ilObjectGUI\CFORM_NEW, ilObject2GUI\getType(), ILIAS\Repository\lng(), and txt().

+ Here is the call graph for this function:

◆ getPlugin()

ilObjectPluginGUI::getPlugin ( )
protected

Get plugin object.

Exceptions
ilPluginException

Definition at line 202 of file class.ilObjectPluginGUI.php.

202 : ilPlugin
203 {
204 if (!$this->plugin) {
205 $this->plugin = $this->component_factory->getPlugin($this->getType());
206 }
207 return $this->plugin;
208 }

References $plugin, and ilObject2GUI\getType().

Referenced by supportsExport(), and txt().

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

◆ getStandardCmd()

ilObjectPluginGUI::getStandardCmd ( )
abstract

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ infoScreen()

ilObjectPluginGUI::infoScreen ( )

Definition at line 430 of file class.ilObjectPluginGUI.php.

430 : void
431 {
433 $ilCtrl = $this->ctrl;
434 $ilTabs = $this->tabs;
435
436 $ilTabs->activateTab("info_short");
437
438 $this->checkPermission("visible");
439
440 $info = new ilInfoScreenGUI($this);
441 $info->enablePrivateNotes();
442
443 // general information
444 $lng->loadLanguageModule("meta");
445
446 $this->addInfoItems($info);
447
448 // forward the command
449 $ilCtrl->forwardCommand($info);
450 }
Class ilInfoScreenGUI.
loadLanguageModule(string $a_module)
Load language module.
addInfoItems(ilInfoScreenGUI $info)
Add items to info screen.
activateTab(string $a_id)

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, $tabs, ilTabsGUI\activateTab(), addInfoItems(), ilObject2GUI\checkPermission(), and ilLanguage\loadLanguageModule().

Referenced by executeCommand().

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

◆ initCreateForm()

ilObjectPluginGUI::initCreateForm ( string  $new_type)
protected

Init object creation form.

Reimplemented from ilObjectGUI.

Definition at line 263 of file class.ilObjectPluginGUI.php.

264 {
265 $form = new ilPropertyFormGUI();
266 $form->setTarget("_top");
267 $form->setFormAction($this->ctrl->getFormAction($this, "save"));
268 $form->setTitle($this->txt($new_type . "_new"));
269
270 // title
271 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
272 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
273 $ti->setMaxLength(ilObject::TITLE_LENGTH);
274 $ti->setRequired(true);
275 $form->addItem($ti);
276
277 // description
278 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
279 $ta->setCols(40);
280 $ta->setRows(2);
281 $form->addItem($ta);
282
283 $form->addCommandButton("save", $this->txt($new_type . "_add"));
284 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
285
286 return $form;
287 }
const TITLE_LENGTH
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObject\TITLE_LENGTH, and txt().

Referenced by initCreationForms().

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

◆ initCreationForms()

ilObjectPluginGUI::initCreationForms ( string  $new_type)
protected

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

Reimplemented from ilObject2GUI.

Definition at line 237 of file class.ilObjectPluginGUI.php.

237 : array
238 {
239 $forms = [];
240 $forms[self::CFORM_NEW] = $this->initCreateForm($new_type);
241
242 if ($this->supportsExport()) {
243 $forms[self::CFORM_IMPORT] = $this->initImportForm($new_type);
244 }
245 if ($this->supportsCloning()) {
246 $forms[self::CFORM_CLONE] = $this->fillCloneTemplate(null, $new_type);
247 }
248
249 return $forms;
250 }
fillCloneTemplate(?string $tpl_varname, string $type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
initCreateForm(string $new_type)
Init object creation form.
initImportForm(string $new_type)
Init object import form.

References ilObjectGUI\CFORM_CLONE, ilObjectGUI\CFORM_IMPORT, ilObjectGUI\CFORM_NEW, ilObject2GUI\fillCloneTemplate(), initCreateForm(), initImportForm(), supportsCloning(), and supportsExport().

+ Here is the call graph for this function:

◆ initEditForm()

ilObjectPluginGUI::initEditForm ( )
protected

Init object update form.

Reimplemented from ilObjectGUI.

Definition at line 292 of file class.ilObjectPluginGUI.php.

293 {
295 $ilCtrl = $this->ctrl;
296
297 $form = new ilPropertyFormGUI();
298 $form->setTarget("_top");
299 $form->setFormAction($ilCtrl->getFormAction($this, "update"));
300 $form->setTitle($lng->txt("edit"));
301
302 // title
303 $ti = new ilTextInputGUI($lng->txt("title"), "title");
304 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
305 $ti->setMaxLength(ilObject::TITLE_LENGTH);
306 $ti->setRequired(true);
307 $form->addItem($ti);
308
309 // description
310 $ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
311 $ta->setCols(40);
312 $ta->setRows(2);
313 $form->addItem($ta);
314
315 $form->addCommandButton("update", $lng->txt("save"));
316 // $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
317
318 return $form;
319 }

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject\TITLE_LENGTH, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ initImportForm()

ilObjectPluginGUI::initImportForm ( string  $new_type)
protected

Init object import form.

Parameters
stringnew type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

Definition at line 326 of file class.ilObjectPluginGUI.php.

327 {
328 $form = new ilPropertyFormGUI();
329 $form->setTarget("_top");
330 $form->setFormAction($this->ctrl->getFormAction($this, "importFile"));
331 $form->setTitle($this->lng->txt("import"));
332
333 $fi = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
334 $fi->setSuffixes(["zip"]);
335 $fi->setRequired(true);
336 $form->addItem($fi);
337
338 $form->addCommandButton("importFile", $this->lng->txt("import"));
339 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
340
341 return $form;
342 }
This class represents a file property in a property form.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by initCreationForms().

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

◆ lookupParentTitleInCreationMode()

ilObjectPluginGUI::lookupParentTitleInCreationMode ( )
protected

Reimplemented in ilOrgUnitExtensionGUI.

Definition at line 499 of file class.ilObjectPluginGUI.php.

499 : string
500 {
502 $this->slot_request->getRefId()
503 ));
504 }

References ilObject\_lookupObjId(), and ilObject\_lookupTitle().

Referenced by executeCommand().

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

◆ performCommand()

ilObjectPluginGUI::performCommand ( string  $cmd)
abstract

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ supportsCloning()

ilObjectPluginGUI::supportsCloning ( )
protected
Returns
bool returns true if this plugin object supports cloning

Reimplemented in ilOrgUnitExtensionGUI.

Definition at line 255 of file class.ilObjectPluginGUI.php.

255 : bool
256 {
257 return true;
258 }

Referenced by initCreationForms().

+ Here is the caller graph for this function:

◆ supportsExport()

ilObjectPluginGUI::supportsExport ( )
protected

Reimplemented in ilOrgUnitExtensionGUI.

Definition at line 492 of file class.ilObjectPluginGUI.php.

492 : bool
493 {
495
496 return $component_repository->getPluginSlotById("robj")->getPluginByName($this->getPlugin()->getPluginName())->supportsExport();
497 }
getPlugin()
Get plugin object.
ilComponentRepository $component_repository
getPluginSlotById(string $id)
Get pluginslot by id.

References $component_repository, getPlugin(), and ilComponentRepository\getPluginSlotById().

Referenced by initCreationForms().

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

◆ txt()

ilObjectPluginGUI::txt ( string  $a_var)
finalprotected

Definition at line 210 of file class.ilObjectPluginGUI.php.

210 : string
211 {
212 return $this->getPlugin()->txt($a_var);
213 }

References getPlugin().

Referenced by getCreationFormTitle(), and initCreateForm().

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

Field Documentation

◆ $component_factory

ilComponentFactory ilObjectPluginGUI::$component_factory
protected

Definition at line 32 of file class.ilObjectPluginGUI.php.

◆ $component_repository

ilComponentRepository ilObjectPluginGUI::$component_repository
protected

Definition at line 27 of file class.ilObjectPluginGUI.php.

Referenced by supportsExport().

◆ $nav_history

ilNavigationHistory ilObjectPluginGUI::$nav_history
protected

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

Referenced by executeCommand().

◆ $plugin

ilPlugin ilObjectPluginGUI::$plugin = null
protected

Definition at line 30 of file class.ilObjectPluginGUI.php.

Referenced by getPlugin().

◆ $slot_request

PluginSlotGUIRequest ilObjectPluginGUI::$slot_request
protected

Definition at line 31 of file class.ilObjectPluginGUI.php.

◆ $tabs

ilTabsGUI ilObjectPluginGUI::$tabs
protected

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