ILIAS  trunk Revision v11.0_alpha-1871-gde1fee8db3d
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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
 
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 = []
 
 $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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $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 35 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().

39  {
40  global $DIC;
41  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
42 
43  $this->lng = $DIC->language();
44  $this->tabs = $DIC->tabs();
45  $this->access = $DIC->access();
46  $this->tpl = $DIC["tpl"];
47  $this->ctrl = $DIC->ctrl();
48  $this->locator = $DIC["ilLocator"];
49  $this->tree = $DIC->repositoryTree();
50  $this->help = $DIC["ilHelp"];
51  $this->gui = $DIC->itemGroup()->internal()->gui();
52  $this->ig_request = $this->gui
53  ->standardRequest();
54  }
global $DIC
Definition: shib_login.php:22
__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 335 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().

335  : void
336  {
337  global $DIC;
338  $main_tpl = $DIC->ui()->mainTemplate();
339 
340  $ilAccess = $DIC->access();
341  $lng = $DIC->language();
342  $tree = $DIC->repositoryTree();
343 
344  $targets = explode('_', $a_target);
345  $ref_id = $targets[0];
346  $par_id = $tree->getParentId($ref_id);
347 
348  if ($ilAccess->checkAccess("read", "", $par_id)) {
349  ilUtil::redirect(ilLink::_getLink($par_id));
350  exit;
351  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
352  $main_tpl->setOnScreenMessage('failure', sprintf(
353  $lng->txt("msg_no_perm_read_item"),
355  ), true);
357  }
358 
359  throw new ilPermissionException($lng->txt("msg_no_perm_read"));
360  }
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:22
getParentId(int $a_node_id)
get parent id of given node
static redirect(string $a_script)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjItemGroupGUI::addLocatorItems ( )

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

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

116  : void
117  {
118  $ilLocator = $this->locator;
119  $ilAccess = $this->access;
120 
121  if (is_object($this->object) && $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
122  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listMaterials"), "", $this->requested_ref_id);
123  }
124  }
ilLocatorGUI $locator
ilAccessHandler $access
+ Here is the call graph for this function:

◆ afterConstructor()

ilObjItemGroupGUI::afterConstructor ( )
protected

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

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

56  : void
57  {
58  $lng = $this->lng;
59 
60  $lng->loadLanguageModule("itgr");
61  $this->ctrl->saveParameter($this, array("ref_id"));
62  }
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 379 of file class.ilObjItemGroupGUI.php.

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

379  : void
380  {
381  // add new object to materials
382  $items = new ilItemGroupItems($this->object->getRefId());
383  $items->addItem($a_obj->getRefId());
384  $items->update();
385  }
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 198 of file class.ilObjItemGroupGUI.php.

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

198  : void
199  {
200  // check if template is changed
202  $this->object->getRefId()
203  );
204  $new_tpl_id = $this->getDidacticTemplateVar('dtpl');
205 
206  if ($new_tpl_id !== $current_tpl_id) {
207  $this->ctrl->setParameterByClass(ilDidacticTemplateGUI::class, "didactic_type", $new_tpl_id);
208  $this->ctrl->redirectByClass(ilDidacticTemplateGUI::class, "confirmTemplateSwitch");
209  return;
210  }
211  parent::afterUpdate();
212  }
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
+ Here is the call graph for this function:

◆ edit()

ilObjItemGroupGUI::edit ( )

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

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

178  : void
179  {
180  if (!$this->checkPermissionBool("write")) {
181  $this->error->raiseError($this->lng->txt("msg_no_perm_write"), $this->error->MESSAGE);
182  }
183 
184  $this->tabs_gui->activateTab("settings");
185 
186  $form = $this->initEditForm();
187  $values = $this->getEditFormValues();
188  if ($values) {
189  $form->setValuesByArray($values, true);
190  }
191 
192  $this->addExternalEditFormCustom($form);
193 
194  $this->tpl->setContent($form->getHTML());
195  $this->setSettingsSubTabs("general");
196  }
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 69 of file class.ilObjItemGroupGUI.php.

References $tabs, ilObjectGUI\addHeaderAction(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObject2GUI\prepareOutput(), and setSettingsSubTabs().

69  : void
70  {
71  $ilTabs = $this->tabs;
72  $next_class = $this->ctrl->getNextClass($this);
73 
74  switch ($next_class) {
75  case 'ilpermissiongui':
76  $this->prepareOutput();
77  $ilTabs->activateTab("perm_settings");
78  $this->addHeaderAction();
79  $perm_gui = new ilPermissionGUI($this);
80  $this->ctrl->forwardCommand($perm_gui);
81  break;
82 
83  case "ilcommonactiondispatchergui":
85  $this->ctrl->forwardCommand($gui);
86  break;
87 
88  case 'ilobjecttranslationgui':
89  $this->checkPermissionBool("write");
90  $this->prepareOutput();
91  $this->setSettingsSubTabs("settings_trans");
92  $transgui = new ilObjectTranslationGUI($this);
93  $transgui->setEnableFallbackLanguage(false);
94  $transgui->supportContentTranslation(false);
95  $transgui->hideDescription(true);
96  $this->ctrl->forwardCommand($transgui);
97  break;
98 
99  case 'ildidactictemplategui':
100  $this->checkPermissionBool("write");
101  $this->prepareOutput();
102  $this->ctrl->setReturn($this, 'edit');
103  $did = new ilDidacticTemplateGUI($this, $this->ig_request->getDidactivTemplateId());
104  $this->ctrl->forwardCommand($did);
105  break;
106 
107  default:
108  $cmd = $this->ctrl->getCmd("listMaterials");
109  $this->prepareOutput();
110  $this->addHeaderAction();
111  $this->$cmd();
112  break;
113  }
114  }
ILIAS ItemGroup InternalGUIService $gui
setSettingsSubTabs(string $active_tab="general")
prepareOutput(bool $show_sub_objects=true)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for object translation handling.
+ Here is the call graph for this function:

◆ getCreatableObjectTypes()

ilObjItemGroupGUI::getCreatableObjectTypes ( )

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

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

Referenced by listMaterials().

242  : array
243  {
244  $parent_ref_id = $this->tree->getParentId($this->object->getRefId());
245  $parent_type = ilObject::_lookupType($parent_ref_id, true);
246  $parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
247  $parent_gui = new $parent_gui_class('', $parent_ref_id, true, false);
248  $types = $parent_gui->getCreatableObjectTypes();
249  foreach (array_merge(['itgr', 'sess' ], $this->obj_definition->getSideBlockTypes()) as $type_to_remove) {
250  unset($types[$type_to_remove]);
251  }
252  return $types;
253  }
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 390 of file class.ilObjItemGroupGUI.php.

390  : void
391  {
392  $a_values["show_title"] = !$this->object->getHideTitle();
393  $a_values["behaviour"] = $this->object->getBehaviour();
394  $a_values["list_presentation"] = $this->object->getListPresentation();
395  $a_values["tile_size"] = $this->object->getTileSize();
396  }

◆ getTemplate()

ilObjItemGroupGUI::getTemplate ( )

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

270  : void
271  {
272  $this->tpl->loadStandardTemplate();
273  }

◆ getType()

ilObjItemGroupGUI::getType ( )
final

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

64  : string
65  {
66  return "itgr";
67  }

◆ gotoParent()

ilObjItemGroupGUI::gotoParent ( )

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

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

362  : void
363  {
364  $ilAccess = $this->access;
365  $tree = $this->tree;
366 
367  $ref_id = $this->object->getRefId();
368  $par_id = $tree->getParentId($ref_id);
369 
370  if ($ilAccess->checkAccess("read", "", $par_id)) {
371  ilUtil::redirect(ilLink::_getLink($par_id));
372  exit;
373  }
374  }
getParentId(int $a_node_id)
get parent id of given node
static redirect(string $a_script)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilAccessHandler $access
+ Here is the call graph for this function:

◆ initCreateForm()

ilObjItemGroupGUI::initCreateForm ( string  $new_type)
protected

Definition at line 409 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().

409  : \ILIAS\UI\Component\Input\Container\Form\Standard
410  {
411  $object = $this->getObject();
412  if ($object === null) {
413  $object = new ilObject();
414  }
415  $form_fields['title'] = $this->ui_factory->input()->field()->text($this->lng->txt('title'))
416  ->withMaxLength(ilObject::TITLE_LENGTH)
417  ->withRequired(true);
418 
419  $didactic_templates = $this->didacticTemplatesToForm();
420 
421  if ($didactic_templates !== null) {
422  $form_fields['didactic_templates'] = $didactic_templates;
423  }
424 
425  return $this->ui_factory->input()->container()->form()->standard(
426  $this->ctrl->getFormAction($this, 'save'),
427  $form_fields
428  )->withSubmitLabel($this->lng->txt($new_type . '_add'));
429  }
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 126 of file class.ilObjItemGroupGUI.php.

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

126  : void
127  {
128  $form->removeItemByPostVar("desc");
129 
130  // Show didactic template type
131  $this->initDidacticTemplate($form);
132 
133  // presentation
134  $pres = new ilFormSectionHeaderGUI();
135  $pres->setTitle($this->lng->txt('obj_presentation'));
136  $form->addItem($pres);
137 
138  // show title
139  $cb = new ilCheckboxInputGUI($this->lng->txt("itgr_show_title"), "show_title");
140  $cb->setInfo($this->lng->txt("itgr_show_title_info"));
141  $form->addItem($cb);
142 
143  // behaviour
144  $options = ilItemGroupBehaviour::getAll();
145  $si = new ilSelectInputGUI($this->lng->txt("itgr_behaviour"), "behaviour");
146  $si->setInfo($this->lng->txt("itgr_behaviour_info"));
147  $si->setOptions($options);
148  $cb->addSubItem($si);
149 
150  // tile/list
151  $lpres = new ilRadioGroupInputGUI($this->lng->txt('itgr_list_presentation'), "list_presentation");
152 
153  $std_list = new ilRadioOption($this->lng->txt('itgr_list_default'), "");
154  $std_list->setInfo($this->lng->txt('itgr_list_default_info'));
155  $lpres->addOption($std_list);
156 
157  $item_list = new ilRadioOption($this->lng->txt('itgr_list'), "list");
158  $lpres->addOption($item_list);
159 
160  $tile_view = new ilRadioOption($this->lng->txt('itgr_tile'), "tile");
161  $lpres->addOption($tile_view);
162 
163  // tile size
164  $si = new ilRadioGroupInputGUI($this->lng->txt("itgr_tile_size"), "tile_size");
165  $dummy_container = new ilContainer();
166  $this->lng->loadLanguageModule("cont");
167  foreach ($dummy_container->getTileSizes() as $key => $txt) {
168  $op = new ilRadioOption($txt, $key);
169  $si->addOption($op);
170  }
171  $tile_view->addSubItem($si);
172  $si->setValue($this->object->getTileSize());
173 
174  $lpres->setValue($this->object->getListPresentation());
175  $form->addItem($lpres);
176  }
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$txt
Definition: error.php:31
+ Here is the call graph for this function:

◆ listMaterials()

ilObjItemGroupGUI::listMaterials ( )

Definition at line 214 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().

214  : void
215  {
216  $tree = $this->tree;
217  $ilTabs = $this->tabs;
218  $tpl = $this->tpl;
219 
220  $this->checkPermission("write");
221 
222  $ilTabs->activateTab("materials");
223 
224  $parent_ref_id = $tree->getParentId($this->object->getRefId());
225  $parent_type = ilObject::_lookupType($parent_ref_id, true);
226  $parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
227  $this->ctrl->setParameterByClass($parent_gui_class, 'ref_id', $parent_ref_id);
230  $this->getCreatableObjectTypes(),
231  $parent_gui_class,
232  $this->object->getRefId()
233  )
234  );
235  $gui->render();
236  $this->ctrl->clearParameterByClass($parent_gui_class, 'ref_id');
237 
238  $tab = new ilItemGroupItemsTableGUI($this->gui, $this, "listMaterials");
239  $tpl->setContent($tab->getHTML());
240  }
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 431 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().

431  : void
432  {
433  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
434  if (!$this->checkPermissionBool("create", "", $this->requested_new_type)) {
435  $this->error->raiseError($this->lng->txt("no_create_permission"), $this->error->MESSAGE);
436  }
437 
438  $this->lng->loadLanguageModule($this->requested_new_type);
439  $this->ctrl->setParameter($this, "new_type", $this->requested_new_type);
440 
441  $form = $this->initCreateForm($this->requested_new_type);
442  $data = $form->withRequest($this->request)->getData();
443  if ($data === null) {
444  $this->tpl->setContent($this->getCreationFormsHTML($form));
445  return;
446  }
447 
448  $this->ctrl->setParameter($this, 'new_type', '');
449 
450  $new_obj = new ilObjItemGroup();
451  $new_obj->setType($this->requested_new_type);
452  $new_obj->processAutoRating();
453  $new_obj->setTitle($data['title']);
454  $new_obj->create();
455 
456  $this->putObjectInTree($new_obj);
457 
458  $dtpl = $data['didactic_templates'] ?? null;
459  if ($dtpl !== null) {
460  $dtpl_id = $this->parseDidacticTemplateVar($dtpl, 'dtpl');
461  $new_obj->applyDidacticTemplate($dtpl_id);
462  }
463 
464  $this->ctrl->setParameterByClass(self::class, 'ref_id', $new_obj->getRefId());
465  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
466  $this->ctrl->redirectByClass(self::class, "listMaterials");
467  }
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseDidacticTemplateVar(string $var, string $type)
+ Here is the call graph for this function:

◆ saveItemAssignment()

ilObjItemGroupGUI::saveItemAssignment ( )

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

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

255  : void
256  {
257  $ilCtrl = $this->ctrl;
258 
259  $this->checkPermission("write");
260 
261  $item_group_items = new ilItemGroupItems($this->object->getRefId());
262  $items = $this->ig_request->getItems();
263  $item_group_items->setItems($items);
264  $item_group_items->update();
265 
266  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
267  $ilCtrl->redirect($this, "listMaterials");
268  }
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 318 of file class.ilObjItemGroupGUI.php.

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

Referenced by edit(), and executeCommand().

318  : void
319  {
320  $this->tabs_gui->addSubTab(
321  "general",
322  $this->lng->txt("settings"),
323  $this->ctrl->getLinkTarget($this, "edit")
324  );
325 
326  $this->tabs_gui->addSubTab(
327  "settings_trans",
328  $this->lng->txt("obj_multilinguality"),
329  $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
330  );
331  $this->tabs_gui->activateTab("settings");
332  $this->tabs_gui->activateSubTab($active_tab);
333  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjItemGroupGUI::setTabs ( )
protected

Definition at line 275 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().

275  : void
276  {
277  $ilAccess = $this->access;
278  $ilTabs = $this->tabs;
279  $ilHelp = $this->help;
280  $lng = $this->lng;
281  $tree = $this->tree;
282 
283  $ilHelp->setScreenIdComponent("itgr");
284 
285  $parent_ref_id = $tree->getParentId($this->object->getRefId());
286  $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
287  $parent_type = ilObject::_lookupType($parent_obj_id);
288 
289  $ilTabs->setBackTarget(
290  $lng->txt('obj_' . $parent_type),
291  ilLink::_getLink($parent_ref_id),
292  "_top"
293  );
294 
295  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
296  $ilTabs->addTab(
297  'materials',
298  $lng->txt('itgr_materials'),
299  $this->ctrl->getLinkTarget($this, 'listMaterials')
300  );
301 
302  $ilTabs->addTab(
303  'settings',
304  $lng->txt('settings'),
305  $this->ctrl->getLinkTarget($this, 'edit')
306  );
307  }
308 
309  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId())) {
310  $ilTabs->addTab(
311  "perm_settings",
312  $lng->txt('perm_settings'),
313  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
314  );
315  }
316  }
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 398 of file class.ilObjItemGroupGUI.php.

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

398  : void
399  {
400  $this->object->setHideTitle(!$form->getInput("show_title"));
401  $behaviour = ($form->getInput("show_title"))
402  ? $form->getInput("behaviour")
404  $this->object->setBehaviour($behaviour);
405  $this->object->setListPresentation($form->getInput("list_presentation"));
406  $this->object->setTileSize($form->getInput("tile_size"));
407  }
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 30 of file class.ilObjItemGroupGUI.php.

◆ $help

ilHelpGUI ilObjItemGroupGUI::$help
protected

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

Referenced by setTabs().

◆ $ig_request

StandardGUIRequest ilObjItemGroupGUI::$ig_request
protected

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

◆ $tabs

ilTabsGUI ilObjItemGroupGUI::$tabs
protected

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

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


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