36 protected \ILIAS\ObjectGroup\InternalGUIService
$gui;
44 int $a_id_type = self::REPOSITORY_NODE_ID,
45 int $a_parent_node_id = 0
50 $this->
lng = $DIC->language();
51 $this->
tabs = $DIC->tabs();
52 $this->
access = $DIC->access();
53 $this->tpl =
$DIC[
"tpl"];
54 $this->
ctrl = $DIC->ctrl();
55 $this->
locator = $DIC[
"ilLocator"];
56 $this->tree =
$DIC->repositoryTree();
57 $this->
help = $DIC[
"ilHelp"];
58 $this->gui =
$DIC->objectGroup()->internal()->gui();
59 $this->og_request = $this->gui
61 $this->data_factory =
new DataFactory();
69 $this->
ctrl->saveParameter($this, array(
"ref_id"));
80 $next_class = $this->
ctrl->getNextClass($this);
82 switch ($next_class) {
83 case 'ilpermissiongui':
85 $ilTabs->activateTab(
"perm_settings");
88 $this->
ctrl->forwardCommand($perm_gui);
91 case "ilcommonactiondispatchergui":
93 $this->
ctrl->forwardCommand($gui);
96 case strtolower(TranslationGUI::class):
113 $transgui->supportContentTranslation(
false);
114 $this->
ctrl->forwardCommand($transgui);
117 case 'ildidactictemplategui':
120 $this->
ctrl->setReturn($this,
'edit');
122 $this->
ctrl->forwardCommand($did);
126 $cmd = $this->
ctrl->getCmd(
"listMaterials");
139 if (is_object($this->
object) && $ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
140 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"listMaterials"),
"", $this->requested_ref_id);
153 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
158 $display_radio_group->setRequired(
true);
159 $form->
addItem($display_radio_group);
162 $this->
lng->txt(
'obgr_display_without_title'),
165 $display_radio_group->addOption($no_title_option);
168 $this->
lng->txt(
'obgr_display_with_title'),
171 $display_radio_group->addOption($with_title_option);
174 $this->
lng->txt(
'obgr_display_with_title_and_toggleable'),
178 $this->
lng->txt(
'obgr_display_with_title_and_toggleable'),
181 $with_title_and_toggleable_option_radio_group->setRequired(
true);
182 $with_title_and_toggleable_option_radio_group->addOption(
184 $this->
lng->txt(
'obgr_display_with_title_and_toggleable_initially_closed'),
188 $with_title_and_toggleable_option_radio_group->addOption(
190 $this->
lng->txt(
'obgr_display_with_title_and_toggleable_initially_open'),
194 $with_title_and_toggleable_option->addSubItem($with_title_and_toggleable_option_radio_group);
195 $display_radio_group->addOption($with_title_and_toggleable_option);
201 $std_list->setInfo($this->
lng->txt(
'obgr_list_default_info'));
202 $lpres->addOption($std_list);
205 $lpres->addOption($item_list);
208 $lpres->addOption($tile_view);
213 $this->
lng->loadLanguageModule(
"cont");
214 foreach ($dummy_container->getTileSizes() as $key => $txt) {
218 $tile_view->addSubItem($si);
219 $si->setValue($this->
object->getTileSize());
221 $lpres->setValue($this->
object->getListPresentation());
228 $this->error->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->error->MESSAGE);
231 $this->tabs_gui->activateTab(
"settings");
236 $form->setValuesByArray($values,
true);
241 $this->tpl->setContent($form->getHTML());
253 if ($new_tpl_id !== $current_tpl_id) {
254 $this->
ctrl->setParameterByClass(ilDidacticTemplateGUI::class,
"didactic_type", $new_tpl_id);
255 $this->
ctrl->redirectByClass(ilDidacticTemplateGUI::class,
"confirmTemplateSwitch");
258 parent::afterUpdate();
265 $this->
tabs->activateTab(
"materials");
267 $parent_ref_id = $this->tree->getParentId($this->
object->getRefId());
269 $parent_gui_class =
"ilObj{$this->obj_definition->getClassName($parent_type)}GUI";
270 $this->
ctrl->setParameterByClass($parent_gui_class,
'ref_id', $parent_ref_id);
272 $add_new_item_gui->renderToolbarAction();
273 $this->
ctrl->clearParameterByClass($parent_gui_class,
'ref_id');
276 $this->tpl->setContent(
277 $this->ui_renderer->render(
278 $this->configureObjectsTable()->getComponents($this->getTableActionUrlBuilder())
285 $parent_ref_id = $this->tree->getParentId($this->
object->getRefId());
287 $parent_gui_class =
"ilObj{$this->obj_definition->getClassName($parent_type)}GUI";
314 $this->
object->getRefId(),
315 $this->object->getId()
321 return new URLBuilder($this->data_factory->uri(
322 ILIAS_HTTP_PATH .
'/' . $this->ctrl->getLinkTarget($this,
'executeTableAction')
328 $parent_ref_id = $this->tree->getParentId($this->
object->getRefId());
330 $parent_gui_class =
'ilObj' . $this->obj_definition->getClassName($parent_type) .
'GUI';
331 $parent_gui =
new $parent_gui_class(
'', $parent_ref_id,
true,
false);
332 $types = $parent_gui->getCreatableObjectTypes();
333 foreach (array_merge([
'obgr',
'sess' ], $this->obj_definition->getSideBlockTypes()) as $type_to_remove) {
334 unset($types[$type_to_remove]);
341 $this->tpl->loadStandardTemplate();
352 $ilHelp->setScreenIdComponent(
"obgr");
358 $ilTabs->setBackTarget(
359 $lng->
txt(
'obj_' . $parent_type),
360 ilLink::_getLink($parent_ref_id),
364 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
368 $this->ctrl->getLinkTarget($this,
'listMaterials')
374 $this->ctrl->getLinkTarget($this,
'edit')
378 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
382 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
389 $this->tabs_gui->addSubTab(
391 $this->
lng->txt(
"settings"),
392 $this->ctrl->getLinkTarget($this,
"edit")
395 $this->tabs_gui->addSubTab(
397 $this->
lng->txt(
"obj_multilinguality"),
398 $this->ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
400 $this->tabs_gui->activateTab(
"settings");
401 $this->tabs_gui->activateSubTab($active_tab);
404 public static function _goto(
string $a_target): void
407 $main_tpl =
$DIC->ui()->mainTemplate();
409 $ilAccess =
$DIC->access();
413 $targets = explode(
'_', $a_target);
417 if ($ilAccess->checkAccess(
"read",
"", $par_id)) {
421 $main_tpl->setOnScreenMessage(
'failure', sprintf(
422 $lng->
txt(
"msg_no_perm_read_item"),
436 $ref_id = $this->
object->getRefId();
439 if ($ilAccess->checkAccess(
"read",
"", $par_id)) {
452 $items->addItem($a_obj->
getRefId());
465 $a_values[
'list_presentation'] =
$object->getListPresentation();
466 $a_values[
'tile_size'] =
$object->getTileSize();
485 $form_fields[
'title'] = $this->ui_factory->input()->field()->text($this->
lng->txt(
'title'))
487 ->withRequired(
true);
491 if ($didactic_templates !==
null) {
492 $form_fields[
'didactic_templates'] = $didactic_templates;
495 return $this->ui_factory->input()->container()->form()->standard(
496 $this->
ctrl->getFormAction($this,
'save'),
498 )->withSubmitLabel($this->
lng->txt($new_type .
'_add'));
505 $this->error->raiseError($this->
lng->txt(
"no_create_permission"), $this->error->MESSAGE);
508 $this->
lng->loadLanguageModule($this->requested_new_type);
509 $this->
ctrl->setParameter($this,
"new_type", $this->requested_new_type);
512 $data = $form->withRequest($this->request)->getData();
513 if (
$data ===
null) {
518 $this->
ctrl->setParameter($this,
'new_type',
'');
521 $new_obj->setType($this->requested_new_type);
522 $new_obj->processAutoRating();
523 $new_obj->setTitle(
$data[
'title']);
528 $dtpl =
$data[
'didactic_templates'] ??
null;
529 if ($dtpl !==
null) {
531 $new_obj->applyDidacticTemplate($dtpl_id);
534 $this->
ctrl->setParameterByClass(self::class,
'ref_id', $new_obj->getRefId());
535 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
536 $this->
ctrl->redirectByClass(self::class,
"listMaterials");
Render add new item selector.
GUI class for object translation handling.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for didactic template settings inside repository objects.
static lookupTemplateId(int $a_ref_id)
loadLanguageModule(string $a_module)
Load language module.
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
User Interface class for object groups.
getCreatableObjectTypes()
getType()
Functions that must be overwritten.
static _goto(string $a_target)
initCreateForm(string $new_type)
readonly DataFactory $data_factory
afterUpdate()
Post (successful) object update hook.
executeCommand()
execute command
StandardGUIRequest $og_request
afterSaveCallback(ilObject $a_obj)
Custom callback after object is created (in parent container)
addLocatorItems()
Functions to be overwritten.
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
initEditCustomForm(ilPropertyFormGUI $form)
Add custom fields to update form.
afterConstructor()
Do anything that should be done after constructor in here.
getTableActionUrlBuilder()
setSettingsSubTabs(string $active_tab="general")
ILIAS ObjectGroup InternalGUIService $gui
setTabs()
create tabs (repository/workspace switch)
New implementation of ilObjectGUI.
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.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
buildAddNewItemElements(array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
addExternalEditFormCustom(ilPropertyFormGUI $form)
didacticTemplatesToForm()
getCreationFormsHTML(StandardForm|ilPropertyFormGUI|array $form)
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
initDidacticTemplate(ilPropertyFormGUI $form)
addHeaderAction()
Add header action menu.
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
parseDidacticTemplateVar(string $var, string $type)
const DISPLAY_WITHOUT_TITLE
const DISPLAY_WITH_TITLE_AND_TOGGLEABLE
const DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED
const DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY
const DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getParentId(int $a_node_id)
get parent id of given node
static redirect(string $a_script)
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...