32 protected \ILIAS\ItemGroup\InternalGUIService
$gui;
39 int $a_id_type = self::REPOSITORY_NODE_ID,
40 int $a_parent_node_id = 0
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
63 $this->
ctrl->saveParameter($this, array(
"ref_id"));
74 $next_class = $this->
ctrl->getNextClass($this);
76 switch ($next_class) {
77 case 'ilpermissiongui':
79 $ilTabs->activateTab(
"perm_settings");
82 $this->
ctrl->forwardCommand($perm_gui);
85 case "ilcommonactiondispatchergui":
87 $this->
ctrl->forwardCommand($gui);
90 case strtolower(TranslationGUI::class):
107 $transgui->supportContentTranslation(
false);
108 $this->
ctrl->forwardCommand($transgui);
111 case 'ildidactictemplategui':
114 $this->
ctrl->setReturn($this,
'edit');
116 $this->
ctrl->forwardCommand($did);
120 $cmd = $this->
ctrl->getCmd(
"listMaterials");
133 if (is_object($this->
object) && $ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
147 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
152 $cb->setInfo($this->
lng->txt(
"itgr_show_title_info"));
158 $si->
setInfo($this->
lng->txt(
"itgr_behaviour_info"));
159 $si->setOptions($options);
160 $cb->addSubItem($si);
166 $std_list->
setInfo($this->
lng->txt(
'itgr_list_default_info'));
167 $lpres->addOption($std_list);
170 $lpres->addOption($item_list);
173 $lpres->addOption($tile_view);
178 $this->
lng->loadLanguageModule(
"cont");
179 foreach ($dummy_container->getTileSizes() as $key =>
$txt) {
183 $tile_view->addSubItem($si);
184 $si->setValue($this->
object->getTileSize());
186 $lpres->setValue($this->
object->getListPresentation());
193 $this->error->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->error->MESSAGE);
196 $this->tabs_gui->activateTab(
"settings");
201 $form->setValuesByArray($values,
true);
206 $this->tpl->setContent($form->getHTML());
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");
223 parent::afterUpdate();
234 $ilTabs->activateTab(
"materials");
238 $parent_gui_class =
'ilObj' . $this->obj_definition->getClassName($parent_type) .
'GUI';
239 $this->
ctrl->setParameterByClass($parent_gui_class,
'ref_id', $parent_ref_id);
248 $this->
ctrl->clearParameterByClass($parent_gui_class,
'ref_id');
256 $parent_ref_id = $this->tree->getParentId($this->
object->getRefId());
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]);
274 $items = $this->ig_request->
getItems();
275 $item_group_items->setItems($items);
276 $item_group_items->update();
278 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
279 $ilCtrl->redirect($this,
"listMaterials");
284 $this->tpl->loadStandardTemplate();
295 $ilHelp->setScreenIdComponent(
"itgr");
301 $ilTabs->setBackTarget(
302 $lng->
txt(
'obj_' . $parent_type),
303 ilLink::_getLink($parent_ref_id),
307 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
311 $this->
ctrl->getLinkTarget($this,
'listMaterials')
317 $this->
ctrl->getLinkTarget($this,
'edit')
321 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
325 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
332 $this->tabs_gui->addSubTab(
334 $this->
lng->txt(
"settings"),
335 $this->
ctrl->getLinkTarget($this,
"edit")
338 $this->tabs_gui->addSubTab(
340 $this->
lng->txt(
"obj_multilinguality"),
341 $this->
ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
343 $this->tabs_gui->activateTab(
"settings");
344 $this->tabs_gui->activateSubTab($active_tab);
347 public static function _goto(
string $a_target): void
350 $main_tpl = $DIC->ui()->mainTemplate();
352 $ilAccess = $DIC->access();
353 $lng = $DIC->language();
354 $tree = $DIC->repositoryTree();
356 $targets = explode(
'_', $a_target);
360 if ($ilAccess->checkAccess(
"read",
"", $par_id)) {
364 $main_tpl->setOnScreenMessage(
'failure', sprintf(
365 $lng->
txt(
"msg_no_perm_read_item"),
379 $ref_id = $this->
object->getRefId();
382 if ($ilAccess->checkAccess(
"read",
"", $par_id)) {
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();
412 $this->
object->setHideTitle(!$form->
getInput(
"show_title"));
413 $behaviour = ($form->
getInput(
"show_title"))
416 $this->
object->setBehaviour($behaviour);
417 $this->
object->setListPresentation($form->
getInput(
"list_presentation"));
418 $this->
object->setTileSize($form->
getInput(
"tile_size"));
427 $form_fields[
'title'] = $this->ui_factory->input()->field()->text($this->
lng->txt(
'title'))
429 ->withRequired(
true);
433 if ($didactic_templates !==
null) {
434 $form_fields[
'didactic_templates'] = $didactic_templates;
437 return $this->ui_factory->input()->container()->form()->standard(
438 $this->
ctrl->getFormAction($this,
'save'),
440 )->withSubmitLabel($this->
lng->txt($new_type .
'_add'));
447 $this->error->raiseError($this->
lng->txt(
"no_create_permission"), $this->error->MESSAGE);
450 $this->
lng->loadLanguageModule($this->requested_new_type);
451 $this->
ctrl->setParameter($this,
"new_type", $this->requested_new_type);
454 $data = $form->withRequest($this->request)->getData();
460 $this->
ctrl->setParameter($this,
'new_type',
'');
463 $new_obj->setType($this->requested_new_type);
464 $new_obj->processAutoRating();
465 $new_obj->setTitle(
$data[
'title']);
470 $dtpl =
$data[
'didactic_templates'] ??
null;
471 if ($dtpl !== null) {
473 $new_obj->applyDidacticTemplate($dtpl_id);
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");
This class represents an option in a radio group.
ILIAS ItemGroup InternalGUIService $gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
New implementation of ilObjectGUI.
getCreationFormsHTML(StandardForm|ilPropertyFormGUI|array $form)
getCreatableObjectTypes()
Interface Observer Contains several chained tasks and infos about them.
GUI class for object translation handling.
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
setContent(string $a_html)
Sets content for standard template.
initEditCustomForm(ilPropertyFormGUI $form)
setSettingsSubTabs(string $active_tab="general")
prepareOutput(bool $show_sub_objects=true)
loadLanguageModule(string $a_module)
Load language module.
getEditFormCustomValues(array &$a_values)
Get edit form values (custom part)
addExternalEditFormCustom(ilPropertyFormGUI $form)
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static lookupTemplateId(int $a_ref_id)
addItem(int $a_item_ref_id)
static http()
Fetches the global http state from ILIAS.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initDidacticTemplate(ilPropertyFormGUI $form)
ilGlobalTemplateInterface $tpl
static getAll()
Get all behaviours.
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initCreateForm(string $new_type)
getParentId(int $a_node_id)
get parent id of given node
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
buildAddNewItemElements(array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
Render add new item selector.
User Interface class for item groups.
__construct(Container $dic, ilPlugin $plugin)
updateCustom(ilPropertyFormGUI $form)
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
didacticTemplatesToForm()
static _lookupType(int $id, bool $reference=false)
static _goto(string $a_target)
parseDidacticTemplateVar(string $var, string $type)
addHeaderAction()
Add header action menu.
afterSaveCallback(ilObject $a_obj)
Custom callback after object is created (in parent container)
StandardGUIRequest $ig_request
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.