ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilObjItemGroupGUI Class Reference

User Interface class for item groups. More...

+ Inheritance diagram for ilObjItemGroupGUI:
+ Collaboration diagram for ilObjItemGroupGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 addLocatorItems ()
 
 edit ()
 
 listMaterials ()
 
 getCreatableObjectTypes ()
 
 saveItemAssignment ()
 
 getTemplate ()
 
 gotoParent ()
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent container) More...
 
 save ()
 
- 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)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 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] does belong to the parent 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 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)
 
 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 (string $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

 afterConstructor ()
 
 initEditCustomForm (ilPropertyFormGUI $form)
 
 afterUpdate ()
 
 setTabs ()
 
 setSettingsSubTabs (string $active_tab="general")
 
 getEditFormCustomValues (array &$a_values)
 Get edit form values (custom part) More...
 
 updateCustom (ilPropertyFormGUI $form)
 
 initCreateForm (string $new_type)
 
- 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="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. 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...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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 ()
 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...
 
 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS ItemGroup InternalGUIService $gui
 
StandardGUIRequest $ig_request
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
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 = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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 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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 37 of file class.ilObjItemGroupGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\locator(), and ILIAS\Repository\tabs().

41  {
42  global $DIC;
43  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
44 
45  $this->lng = $DIC->language();
46  $this->tabs = $DIC->tabs();
47  $this->access = $DIC->access();
48  $this->tpl = $DIC["tpl"];
49  $this->ctrl = $DIC->ctrl();
50  $this->locator = $DIC["ilLocator"];
51  $this->tree = $DIC->repositoryTree();
52  $this->help = $DIC["ilHelp"];
53  $this->gui = $DIC->itemGroup()->internal()->gui();
54  $this->ig_request = $this->gui
55  ->standardRequest();
56  }
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjItemGroupGUI::_goto ( string  $a_target)
static

Definition at line 347 of file class.ilObjItemGroupGUI.php.

References $DIC, ilObject2GUI\$lng, ilObjectGUI\$ref_id, ilObjectGUI\$tree, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilTree\getParentId(), ilUtil\redirect(), ROOT_FOLDER_ID, and ilLanguage\txt().

347  : void
348  {
349  global $DIC;
350  $main_tpl = $DIC->ui()->mainTemplate();
351 
352  $ilAccess = $DIC->access();
353  $lng = $DIC->language();
354  $tree = $DIC->repositoryTree();
355 
356  $targets = explode('_', $a_target);
357  $ref_id = $targets[0];
358  $par_id = $tree->getParentId($ref_id);
359 
360  if ($ilAccess->checkAccess("read", "", $par_id)) {
361  ilUtil::redirect(ilLink::_getLink($par_id));
362  exit;
363  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
364  $main_tpl->setOnScreenMessage('failure', sprintf(
365  $lng->txt("msg_no_perm_read_item"),
367  ), true);
369  }
370 
371  throw new ilPermissionException($lng->txt("msg_no_perm_read"));
372  }
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:26
getParentId(int $a_node_id)
get parent id of given node
exit
static redirect(string $a_script)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjItemGroupGUI::addLocatorItems ( )

Definition at line 128 of file class.ilObjItemGroupGUI.php.

References ilObject2GUI\$access, ilObject2GUI\$locator, ilObjectGUI\$requested_ref_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

128  : void
129  {
130  $ilLocator = $this->locator;
131  $ilAccess = $this->access;
132 
133  if (is_object($this->object) && $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
134  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listMaterials"), "", $this->requested_ref_id);
135  }
136  }
ilLocatorGUI $locator
ilAccessHandler $access
+ Here is the call graph for this function:

◆ afterConstructor()

ilObjItemGroupGUI::afterConstructor ( )
protected

Definition at line 58 of file class.ilObjItemGroupGUI.php.

References ilObject2GUI\$lng, ILIAS\Repository\ctrl(), and ilLanguage\loadLanguageModule().

58  : void
59  {
60  $lng = $this->lng;
61 
62  $lng->loadLanguageModule("itgr");
63  $this->ctrl->saveParameter($this, array("ref_id"));
64  }
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:

◆ afterSaveCallback()

ilObjItemGroupGUI::afterSaveCallback ( ilObject  $a_obj)

Custom callback after object is created (in parent container)

Definition at line 391 of file class.ilObjItemGroupGUI.php.

References ilItemGroupItems\addItem(), ilObject\getRefId(), and ILIAS\Repository\object().

391  : void
392  {
393  // add new object to materials
394  $items = new ilItemGroupItems($this->object->getRefId());
395  $items->addItem($a_obj->getRefId());
396  $items->update();
397  }
addItem(int $a_item_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ afterUpdate()

ilObjItemGroupGUI::afterUpdate ( )
protected

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

References ILIAS\Repository\ctrl(), ilObjectGUI\getDidacticTemplateVar(), ilDidacticTemplateObjSettings\lookupTemplateId(), and ILIAS\Repository\object().

210  : void
211  {
212  // check if template is changed
214  $this->object->getRefId()
215  );
216  $new_tpl_id = $this->getDidacticTemplateVar('dtpl');
217 
218  if ($new_tpl_id !== $current_tpl_id) {
219  $this->ctrl->setParameterByClass(ilDidacticTemplateGUI::class, "didactic_type", $new_tpl_id);
220  $this->ctrl->redirectByClass(ilDidacticTemplateGUI::class, "confirmTemplateSwitch");
221  return;
222  }
223  parent::afterUpdate();
224  }
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
+ Here is the call graph for this function:

◆ edit()

ilObjItemGroupGUI::edit ( )

Definition at line 190 of file class.ilObjItemGroupGUI.php.

References ilObjectGUI\addExternalEditFormCustom(), ilObject2GUI\checkPermissionBool(), ilObjectGUI\getEditFormValues(), ilObjectGUI\initEditForm(), ILIAS\Repository\lng(), and setSettingsSubTabs().

190  : void
191  {
192  if (!$this->checkPermissionBool("write")) {
193  $this->error->raiseError($this->lng->txt("msg_no_perm_write"), $this->error->MESSAGE);
194  }
195 
196  $this->tabs_gui->activateTab("settings");
197 
198  $form = $this->initEditForm();
199  $values = $this->getEditFormValues();
200  if ($values) {
201  $form->setValuesByArray($values, true);
202  }
203 
204  $this->addExternalEditFormCustom($form);
205 
206  $this->tpl->setContent($form->getHTML());
207  $this->setSettingsSubTabs("general");
208  }
setSettingsSubTabs(string $active_tab="general")
addExternalEditFormCustom(ilPropertyFormGUI $form)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjItemGroupGUI::executeCommand ( )

Definition at line 71 of file class.ilObjItemGroupGUI.php.

References $tabs, ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObjectGUI\getObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilObject2GUI\prepareOutput(), ILIAS\Repository\refinery(), setSettingsSubTabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

71  : void
72  {
73  $ilTabs = $this->tabs;
74  $next_class = $this->ctrl->getNextClass($this);
75 
76  switch ($next_class) {
77  case 'ilpermissiongui':
78  $this->prepareOutput();
79  $ilTabs->activateTab("perm_settings");
80  $this->addHeaderAction();
81  $perm_gui = new ilPermissionGUI($this);
82  $this->ctrl->forwardCommand($perm_gui);
83  break;
84 
85  case "ilcommonactiondispatchergui":
87  $this->ctrl->forwardCommand($gui);
88  break;
89 
90  case strtolower(TranslationGUI::class):
91  $this->checkPermissionBool("write");
92  $this->prepareOutput();
93  $this->setSettingsSubTabs("settings_trans");
94  $transgui = new TranslationGUI(
95  $this->getObject(),
96  $this->lng,
97  $this->access,
98  $this->user,
99  $this->ctrl,
100  $this->tpl,
101  $this->ui_factory,
102  $this->ui_renderer,
103  $this->http,
104  $this->refinery,
105  $this->toolbar
106  );
107  $transgui->supportContentTranslation(false);
108  $this->ctrl->forwardCommand($transgui);
109  break;
110 
111  case 'ildidactictemplategui':
112  $this->checkPermissionBool("write");
113  $this->prepareOutput();
114  $this->ctrl->setReturn($this, 'edit');
115  $did = new ilDidacticTemplateGUI($this, $this->ig_request->getDidactivTemplateId());
116  $this->ctrl->forwardCommand($did);
117  break;
118 
119  default:
120  $cmd = $this->ctrl->getCmd("listMaterials");
121  $this->prepareOutput();
122  $this->addHeaderAction();
123  $this->$cmd();
124  break;
125  }
126  }
ILIAS ItemGroup InternalGUIService $gui
setSettingsSubTabs(string $active_tab="general")
prepareOutput(bool $show_sub_objects=true)
static http()
Fetches the global http state from ILIAS.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getCreatableObjectTypes()

ilObjItemGroupGUI::getCreatableObjectTypes ( )

Definition at line 254 of file class.ilObjItemGroupGUI.php.

References ilObject\_lookupType(), and ILIAS\Repository\object().

Referenced by listMaterials().

254  : array
255  {
256  $parent_ref_id = $this->tree->getParentId($this->object->getRefId());
257  $parent_type = ilObject::_lookupType($parent_ref_id, true);
258  $parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
259  $parent_gui = new $parent_gui_class('', $parent_ref_id, true, false);
260  $types = $parent_gui->getCreatableObjectTypes();
261  foreach (array_merge(['itgr', 'sess' ], $this->obj_definition->getSideBlockTypes()) as $type_to_remove) {
262  unset($types[$type_to_remove]);
263  }
264  return $types;
265  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjItemGroupGUI::getEditFormCustomValues ( array &  $a_values)
protected

Get edit form values (custom part)

Definition at line 402 of file class.ilObjItemGroupGUI.php.

402  : void
403  {
404  $a_values["show_title"] = !$this->object->getHideTitle();
405  $a_values["behaviour"] = $this->object->getBehaviour();
406  $a_values["list_presentation"] = $this->object->getListPresentation();
407  $a_values["tile_size"] = $this->object->getTileSize();
408  }

◆ getTemplate()

ilObjItemGroupGUI::getTemplate ( )

Definition at line 282 of file class.ilObjItemGroupGUI.php.

282  : void
283  {
284  $this->tpl->loadStandardTemplate();
285  }

◆ getType()

ilObjItemGroupGUI::getType ( )
final

Definition at line 66 of file class.ilObjItemGroupGUI.php.

66  : string
67  {
68  return "itgr";
69  }

◆ gotoParent()

ilObjItemGroupGUI::gotoParent ( )

Definition at line 374 of file class.ilObjItemGroupGUI.php.

References ilObject2GUI\$access, ilObjectGUI\$ref_id, ilObjectGUI\$tree, exit, ilTree\getParentId(), and ilUtil\redirect().

374  : void
375  {
376  $ilAccess = $this->access;
377  $tree = $this->tree;
378 
379  $ref_id = $this->object->getRefId();
380  $par_id = $tree->getParentId($ref_id);
381 
382  if ($ilAccess->checkAccess("read", "", $par_id)) {
383  ilUtil::redirect(ilLink::_getLink($par_id));
384  exit;
385  }
386  }
getParentId(int $a_node_id)
get parent id of given node
exit
static redirect(string $a_script)
ilAccessHandler $access
+ Here is the call graph for this function:

◆ initCreateForm()

ilObjItemGroupGUI::initCreateForm ( string  $new_type)
protected

Definition at line 421 of file class.ilObjItemGroupGUI.php.

References ilObjectGUI\$object, ILIAS\Repository\ctrl(), ilObjectGUI\didacticTemplatesToForm(), ilObjectGUI\getObject(), ILIAS\Repository\lng(), null, and ilObject\TITLE_LENGTH.

Referenced by save().

421  : \ILIAS\UI\Component\Input\Container\Form\Standard
422  {
423  $object = $this->getObject();
424  if ($object === null) {
425  $object = new ilObject();
426  }
427  $form_fields['title'] = $this->ui_factory->input()->field()->text($this->lng->txt('title'))
428  ->withMaxLength(ilObject::TITLE_LENGTH)
429  ->withRequired(true);
430 
431  $didactic_templates = $this->didacticTemplatesToForm();
432 
433  if ($didactic_templates !== null) {
434  $form_fields['didactic_templates'] = $didactic_templates;
435  }
436 
437  return $this->ui_factory->input()->container()->form()->standard(
438  $this->ctrl->getFormAction($this, 'save'),
439  $form_fields
440  )->withSubmitLabel($this->lng->txt($new_type . '_add'));
441  }
const TITLE_LENGTH
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditCustomForm()

ilObjItemGroupGUI::initEditCustomForm ( ilPropertyFormGUI  $form)
protected

Definition at line 138 of file class.ilObjItemGroupGUI.php.

References $txt, ilPropertyFormGUI\addItem(), ilItemGroupBehaviour\getAll(), ilObjectGUI\initDidacticTemplate(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilPropertyFormGUI\removeItemByPostVar(), and ilFormPropertyGUI\setInfo().

138  : void
139  {
140  $form->removeItemByPostVar("desc");
141 
142  // Show didactic template type
143  $this->initDidacticTemplate($form);
144 
145  // presentation
146  $pres = new ilFormSectionHeaderGUI();
147  $pres->setTitle($this->lng->txt('obj_presentation'));
148  $form->addItem($pres);
149 
150  // show title
151  $cb = new ilCheckboxInputGUI($this->lng->txt("itgr_show_title"), "show_title");
152  $cb->setInfo($this->lng->txt("itgr_show_title_info"));
153  $form->addItem($cb);
154 
155  // behaviour
156  $options = ilItemGroupBehaviour::getAll();
157  $si = new ilSelectInputGUI($this->lng->txt("itgr_behaviour"), "behaviour");
158  $si->setInfo($this->lng->txt("itgr_behaviour_info"));
159  $si->setOptions($options);
160  $cb->addSubItem($si);
161 
162  // tile/list
163  $lpres = new ilRadioGroupInputGUI($this->lng->txt('itgr_list_presentation'), "list_presentation");
164 
165  $std_list = new ilRadioOption($this->lng->txt('itgr_list_default'), "");
166  $std_list->setInfo($this->lng->txt('itgr_list_default_info'));
167  $lpres->addOption($std_list);
168 
169  $item_list = new ilRadioOption($this->lng->txt('itgr_list'), "list");
170  $lpres->addOption($item_list);
171 
172  $tile_view = new ilRadioOption($this->lng->txt('itgr_tile'), "tile");
173  $lpres->addOption($tile_view);
174 
175  // tile size
176  $si = new ilRadioGroupInputGUI($this->lng->txt("itgr_tile_size"), "tile_size");
177  $dummy_container = new ilContainer();
178  $this->lng->loadLanguageModule("cont");
179  foreach ($dummy_container->getTileSizes() as $key => $txt) {
180  $op = new ilRadioOption($txt, $key);
181  $si->addOption($op);
182  }
183  $tile_view->addSubItem($si);
184  $si->setValue($this->object->getTileSize());
185 
186  $lpres->setValue($this->object->getListPresentation());
187  $form->addItem($lpres);
188  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
removeItemByPostVar(string $a_post_var, bool $a_remove_unused_headers=false)
This class represents a property in a property form.
initDidacticTemplate(ilPropertyFormGUI $form)
static getAll()
Get all behaviours.
Class ilContainer.
$txt
Definition: error.php:31
+ Here is the call graph for this function:

◆ listMaterials()

ilObjItemGroupGUI::listMaterials ( )

Definition at line 226 of file class.ilObjItemGroupGUI.php.

References $tabs, ilObject2GUI\$tpl, ilObjectGUI\$tree, ilObject\_lookupType(), ilObjectGUI\buildAddNewItemElements(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getCreatableObjectTypes(), ilTree\getParentId(), ILIAS\Repository\object(), and ILIAS\UICore\GlobalTemplate\setContent().

226  : void
227  {
228  $tree = $this->tree;
229  $ilTabs = $this->tabs;
230  $tpl = $this->tpl;
231 
232  $this->checkPermission("write");
233 
234  $ilTabs->activateTab("materials");
235 
236  $parent_ref_id = $tree->getParentId($this->object->getRefId());
237  $parent_type = ilObject::_lookupType($parent_ref_id, true);
238  $parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
239  $this->ctrl->setParameterByClass($parent_gui_class, 'ref_id', $parent_ref_id);
242  $this->getCreatableObjectTypes(),
243  $parent_gui_class,
244  $this->object->getRefId()
245  )
246  );
247  $gui->render();
248  $this->ctrl->clearParameterByClass($parent_gui_class, 'ref_id');
249 
250  $tab = new ilItemGroupItemsTableGUI($this->gui, $this, "listMaterials");
251  $tpl->setContent($tab->getHTML());
252  }
ILIAS ItemGroup InternalGUIService $gui
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
getParentId(int $a_node_id)
get parent id of given node
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
buildAddNewItemElements(array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
Render add new item selector.
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ save()

ilObjItemGroupGUI::save ( )

Definition at line 443 of file class.ilObjItemGroupGUI.php.

References ilObjectGUI\$data, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectGUI\getCreationFormsHTML(), initCreateForm(), ILIAS\Repository\lng(), null, ilObjectGUI\parseDidacticTemplateVar(), and ilObject2GUI\putObjectInTree().

443  : void
444  {
445  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
446  if (!$this->checkPermissionBool("create", "", $this->requested_new_type)) {
447  $this->error->raiseError($this->lng->txt("no_create_permission"), $this->error->MESSAGE);
448  }
449 
450  $this->lng->loadLanguageModule($this->requested_new_type);
451  $this->ctrl->setParameter($this, "new_type", $this->requested_new_type);
452 
453  $form = $this->initCreateForm($this->requested_new_type);
454  $data = $form->withRequest($this->request)->getData();
455  if ($data === null) {
456  $this->tpl->setContent($this->getCreationFormsHTML($form));
457  return;
458  }
459 
460  $this->ctrl->setParameter($this, 'new_type', '');
461 
462  $new_obj = new ilObjItemGroup();
463  $new_obj->setType($this->requested_new_type);
464  $new_obj->processAutoRating();
465  $new_obj->setTitle($data['title']);
466  $new_obj->create();
467 
468  $this->putObjectInTree($new_obj);
469 
470  $dtpl = $data['didactic_templates'] ?? null;
471  if ($dtpl !== null) {
472  $dtpl_id = $this->parseDidacticTemplateVar($dtpl, 'dtpl');
473  $new_obj->applyDidacticTemplate($dtpl_id);
474  }
475 
476  $this->ctrl->setParameterByClass(self::class, 'ref_id', $new_obj->getRefId());
477  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
478  $this->ctrl->redirectByClass(self::class, "listMaterials");
479  }
getCreationFormsHTML(StandardForm|ilPropertyFormGUI|array $form)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
initCreateForm(string $new_type)
Class ilObjItemGroup.
parseDidacticTemplateVar(string $var, string $type)
+ Here is the call graph for this function:

◆ saveItemAssignment()

ilObjItemGroupGUI::saveItemAssignment ( )

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

References ilObject2GUI\$ctrl, ilObject2GUI\checkPermission(), ilItemGroupItems\getItems(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

267  : void
268  {
269  $ilCtrl = $this->ctrl;
270 
271  $this->checkPermission("write");
272 
273  $item_group_items = new ilItemGroupItems($this->object->getRefId());
274  $items = $this->ig_request->getItems();
275  $item_group_items->setItems($items);
276  $item_group_items->update();
277 
278  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
279  $ilCtrl->redirect($this, "listMaterials");
280  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjItemGroupGUI::setSettingsSubTabs ( string  $active_tab = "general")
protected

Definition at line 330 of file class.ilObjItemGroupGUI.php.

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

Referenced by edit(), and executeCommand().

330  : void
331  {
332  $this->tabs_gui->addSubTab(
333  "general",
334  $this->lng->txt("settings"),
335  $this->ctrl->getLinkTarget($this, "edit")
336  );
337 
338  $this->tabs_gui->addSubTab(
339  "settings_trans",
340  $this->lng->txt("obj_multilinguality"),
341  $this->ctrl->getLinkTargetByClass(TranslationGUI::class, "")
342  );
343  $this->tabs_gui->activateTab("settings");
344  $this->tabs_gui->activateSubTab($active_tab);
345  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjItemGroupGUI::setTabs ( )
protected

Definition at line 287 of file class.ilObjItemGroupGUI.php.

References ilObject2GUI\$access, $help, ilObject2GUI\$lng, $tabs, ilObjectGUI\$tree, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), ilTree\getParentId(), ILIAS\Repository\object(), and ilLanguage\txt().

287  : void
288  {
289  $ilAccess = $this->access;
290  $ilTabs = $this->tabs;
291  $ilHelp = $this->help;
292  $lng = $this->lng;
293  $tree = $this->tree;
294 
295  $ilHelp->setScreenIdComponent("itgr");
296 
297  $parent_ref_id = $tree->getParentId($this->object->getRefId());
298  $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
299  $parent_type = ilObject::_lookupType($parent_obj_id);
300 
301  $ilTabs->setBackTarget(
302  $lng->txt('obj_' . $parent_type),
303  ilLink::_getLink($parent_ref_id),
304  "_top"
305  );
306 
307  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
308  $ilTabs->addTab(
309  'materials',
310  $lng->txt('itgr_materials'),
311  $this->ctrl->getLinkTarget($this, 'listMaterials')
312  );
313 
314  $ilTabs->addTab(
315  'settings',
316  $lng->txt('settings'),
317  $this->ctrl->getLinkTarget($this, 'edit')
318  );
319  }
320 
321  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId())) {
322  $ilTabs->addTab(
323  "perm_settings",
324  $lng->txt('perm_settings'),
325  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
326  );
327  }
328  }
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 _lookupObjId(int $ref_id)
getParentId(int $a_node_id)
get parent id of given node
static _lookupType(int $id, bool $reference=false)
ilAccessHandler $access
+ Here is the call graph for this function:

◆ updateCustom()

ilObjItemGroupGUI::updateCustom ( ilPropertyFormGUI  $form)
protected

Definition at line 410 of file class.ilObjItemGroupGUI.php.

References ilItemGroupBehaviour\ALWAYS_OPEN, and ilPropertyFormGUI\getInput().

410  : void
411  {
412  $this->object->setHideTitle(!$form->getInput("show_title"));
413  $behaviour = ($form->getInput("show_title"))
414  ? $form->getInput("behaviour")
416  $this->object->setBehaviour($behaviour);
417  $this->object->setListPresentation($form->getInput("list_presentation"));
418  $this->object->setTileSize($form->getInput("tile_size"));
419  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

Field Documentation

◆ $gui

ILIAS ItemGroup InternalGUIService ilObjItemGroupGUI::$gui
protected

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

◆ $help

ilHelpGUI ilObjItemGroupGUI::$help
protected

Definition at line 35 of file class.ilObjItemGroupGUI.php.

Referenced by setTabs().

◆ $ig_request

StandardGUIRequest ilObjItemGroupGUI::$ig_request
protected

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

◆ $tabs

ilTabsGUI ilObjItemGroupGUI::$tabs
protected

Definition at line 34 of file class.ilObjItemGroupGUI.php.

Referenced by executeCommand(), listMaterials(), and setTabs().


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