ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilContainerGUI.php
Go to the documentation of this file.
1<?php
2
26
35{
36 protected \ILIAS\Container\InternalGUIService $gui;
37 protected \ILIAS\Style\Content\GUIService $content_style_gui;
41 protected \ILIAS\Container\InternalDomainService $domain;
42 protected ilTabsGUI $tabs;
47 protected ilLogger $log;
51 public int $bl_cnt = 1; // block counter
52 public bool $multi_download_enabled = false;
53 protected UIServices $ui;
56 protected ?Standard $ui_filter = null;
57 protected bool $edit_order = false;
58 protected bool $adminCommands = false;
59 protected string $requested_redirectSource = "";
60 protected int $current_position = 0;
63 protected ?ModeManager $mode_manager = null;
65 protected \ILIAS\Style\Content\DomainService $content_style_domain;
66
67 public function __construct(
68 $a_data,
69 int $a_id,
70 bool $a_call_by_reference = true,
71 bool $a_prepare_output = true
72 ) {
74 global $DIC;
75
76 $this->lng = $DIC->language();
77 $this->tpl = $DIC["tpl"];
78 $this->ctrl = $DIC->ctrl();
79 $this->tabs = $DIC->tabs();
80 $this->settings = $DIC->settings();
81 $this->user = $DIC->user();
82 $this->access = $DIC->access();
83 $this->tree = $DIC->repositoryTree();
84 $this->error = $DIC["ilErr"];
85 $this->obj_definition = $DIC["objDefinition"];
86 $this->rbacadmin = $DIC->rbac()->admin();
87 $this->rbacreview = $DIC->rbac()->review();
88 $this->log = $DIC["ilLog"];
89 $this->obj_data_cache = $DIC["ilObjDataCache"];
90 $this->toolbar = $DIC->toolbar();
91 $this->app_event_handler = $DIC["ilAppEventHandler"];
92 $this->ui = $DIC->ui();
93 $this->global_screen = $DIC->globalScreen();
94 $this->component_factory = $DIC["component.factory"];
95 $rbacsystem = $DIC->rbac()->system();
96 $lng = $DIC->language();
97
98 $this->rbacsystem = $rbacsystem;
99
100 $lng->loadLanguageModule("cntr");
101 $lng->loadLanguageModule('cont');
102
103 // prepare output things should generally be made in executeCommand
104 // method (maybe dependent on current class/command
105 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
106
107 $this->clipboard = $DIC
108 ->repository()
109 ->internal()
110 ->domain()
111 ->clipboard();
112 $this->std_request = $DIC
113 ->container()
114 ->internal()
115 ->gui()
116 ->standardRequest();
117 $this->requested_redirectSource = $this->std_request->getRedirectSource();
118 $this->domain = $DIC->container()
119 ->internal()
120 ->domain();
121
122 $this->container_filter_service = new ilContainerFilterService();
123 $this->initFilter();
124 $cs = $DIC->contentStyle();
125 $this->content_style_gui = $cs->gui();
126 $this->content_style_domain = $cs->domain();
127 $this->gui = $DIC->container()->internal()->gui();
128 }
129
130 protected function getModeManager(): ModeManager
131 {
132 if (is_null($this->mode_manager)) {
133 $this->mode_manager = $this->domain
134 ->content()
135 ->mode($this->getObject());
136 }
137 return $this->mode_manager;
138 }
139
140 protected function getItemPresentation(
141 $include_empty_blocks = true,
142 ?string $lang = null
143 ): \ILIAS\Container\Content\ItemPresentationManager {
144 if (is_null($this->item_presentation)) {
145 $this->item_presentation = $this->domain
146 ->content()
147 ->itemPresentation(
148 $this->getObject(),
149 $this->container_user_filter,
150 $include_empty_blocks,
151 $lang
152 );
153 }
155 }
156
157 public function executeCommand(): void
158 {
159 $tpl = $this->tpl;
160
161 $next_class = $this->ctrl->getNextClass();
162 $cmd = $this->ctrl->getCmd("render");
163
164 switch ($next_class) {
165 // page editing
166 case "ilcontainerpagegui":
167 if ($this->requested_redirectSource !== "ilinternallinkgui") {
168 $ret = $this->forwardToPageObject();
169 $tpl->setContent($ret);
170 } else {
171 return;
172 }
173 break;
174
175 default:
176 $this->prepareOutput();
177 $cmd .= "Object";
178 $this->$cmd();
179 break;
180 }
181 }
182
183 protected function getEditFormValues(): array
184 {
185 $values = parent::getEditFormValues();
186
187 $values['didactic_type'] =
188 'dtpl_' . ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
189
190 return $values;
191 }
192
193 protected function afterUpdate(): void
194 {
195 // check if template is changed
197 $this->object->getRefId()
198 );
199 $new_tpl_id = $this->getDidacticTemplateVar('dtpl');
200
201 if ($new_tpl_id !== $current_tpl_id) {
202 // redirect to didactic template confirmation
203 $this->ctrl->setParameterByClass(ilDidacticTemplateGUI::class, "didactic_type", $new_tpl_id);
204 $this->ctrl->redirectByClass(ilDidacticTemplateGUI::class, "confirmTemplateSwitch");
205 }
206 parent::afterUpdate();
207 }
208
210 {
211 return $this->std_request->getDidacticTemplateId();
212 }
213
214 public function forwardToPageObject(): string
215 {
217 $ilTabs = $this->tabs;
218 $ilCtrl = $this->ctrl;
219 $cmd = $ilCtrl->getCmd();
220 if (in_array($cmd, ["displayMediaFullscreen", "downloadFile", "displayMedia"])) {
221 $this->checkPermission("read");
222 } else {
223 $this->checkPermission("write");
224 }
225
226 $ilTabs->clearTargets();
227
228 if ($this->requested_redirectSource === "ilinternallinkgui") {
229 exit;
230 }
231
232 $ilTabs->setBackTarget(
233 $lng->txt("back"),
234 $this->ctrl->getLinkTargetByClass("ilcontainerpagegui", "edit")
235 );
236
237 // page object
238
239 $lng->loadLanguageModule("content");
240 $this->content_style_gui->addCss($this->tpl, $this->object->getRefId());
241 // $this->tpl->setCurrentBlock("SyntaxStyle");
242 $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
243 // $this->tpl->parseCurrentBlock();
244
246 "cont",
247 $this->object->getId()
248 )) {
249 // doesn't exist -> create new one
250 $new_page_object = new ilContainerPage();
251 $new_page_object->setParentId($this->object->getId());
252 $new_page_object->setId($this->object->getId());
253 $new_page_object->createFromXML();
254 }
255
256 // get page object
257 $page_gui = new ilContainerPageGUI($this->object->getId());
258 $style = $this->content_style_domain->styleForRefId($this->object->getRefId());
259 $page_gui->setStyleId(
260 $style->getEffectiveStyleId()
261 );
262 $page_gui->setItemPresentationManager($this->getItemPresentation(
263 false,
264 $page_gui->getLanguage()
265 ));
266 $page_gui->setTemplateTargetVar("ADM_CONTENT");
267 $page_gui->setFileDownloadLink("");
268 //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
269 $page_gui->setPresentationTitle("");
270 $page_gui->setTemplateOutput(false);
271
272 // style tab
273 $page_gui->setTabHook($this, "addPageTabs");
274
275 return $this->ctrl->forwardCommand($page_gui);
276 }
277
278 public function addPageTabs(): void
279 {
280 $ilTabs = $this->tabs;
281 $ilCtrl = $this->ctrl;
282
283 $ilTabs->addTarget(
284 "obj_sty",
285 $ilCtrl->getLinkTargetByClass("ilObjectContentStyleSettingsGUI", ''),
286 "editStyleProperties",
287 "ilobjectcontentstylesettingsgui"
288 );
289 }
290
291 public function getContainerPageHTML(): string
292 {
293 $ilSetting = $this->settings;
294 $ilUser = $this->user;
295
296 if (!$ilSetting->get("enable_cat_page_edit") || $this->object->filteredSubtree()) {
297 return "";
298 }
299
300 // if page does not exist, return nothing
302 "cont",
303 $this->object->getId()
304 )) {
305 return "";
306 }
307 $this->content_style_gui->addCss($this->tpl, $this->object->getRefId());
308 $this->tpl->setCurrentBlock("SyntaxStyle");
309 $this->tpl->setVariable(
310 "LOCATION_SYNTAX_STYLESHEET",
312 );
313 $this->tpl->parseCurrentBlock();
314
315 // get page object
316 $ot = $this->object->getObjectTranslation();
317 $lang = $ot->getEffectiveCOPageLang($ilUser->getCurrentLanguage(), "cont");
318 $page_gui = new ilContainerPageGUI($this->object->getId(), 0, $lang);
319 $style = $this->content_style_domain->styleForRefId($this->object->getRefId());
320 $page_gui->setStyleId($style->getEffectiveStyleId());
321
322 $page_gui->setPresentationTitle("");
323 $page_gui->setTemplateOutput(false);
324 $page_gui->setHeader("");
325 $ret = $page_gui->showPage();
326
327 //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>";
328
329 //$ret =& $page_gui->executeCommand();
330 return $ret;
331 }
332
333 protected function setTitleAndDescription(): void
334 {
335 if (ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title")) {
336 $this->tpl->setTitle($this->object->getTitle(), true);
337 } else {
338 parent::setTitleAndDescription();
339 }
340 }
341
342 protected function showPossibleSubObjects(): void
343 {
344 if ($this->isActiveOrdering()) {
345 return;
346 }
348 $this->buildAddNewItemElements($this->getCreatableObjectTypes())
349 );
350 $gui->render();
351 }
352
354 {
355 $view_mode = $this->object->getViewMode();
356 if ($this->object->filteredSubtree()) {
357 $view_mode = ilContainer::VIEW_SIMPLE;
358 }
359 switch ($view_mode) {
360 // all items in one block
362 $container_view = new ilContainerSimpleContentGUI(
363 $this,
364 $this->getItemPresentation()
365 );
366 break;
367
369 $container_view = new ilContainerObjectiveGUI(
370 $this,
371 $this->getItemPresentation()
372 );
373 break;
374
375 // all items in one block
377 case ilCourseConstants::IL_CRS_VIEW_TIMING: // not nice this workaround
378 $container_view = new ilContainerSessionsContentGUI(
379 $this,
380 $this->getItemPresentation()
381 );
382 break;
383
384 // all items in one block
386 default:
387 $container_view = new ilContainerByTypeContentGUI(
388 $this,
389 $this->getItemPresentation()
390 );
391 break;
392 }
393 return $container_view;
394 }
395
396 public function renderObject(): void
397 {
398 $ilTabs = $this->tabs;
399 $ilCtrl = $this->ctrl;
400 $ilSetting = $this->settings;
401 $user = $this->user;
402 $toolbar = $this->toolbar;
404
405 $container_view = $this->getContentGUI();
406
407 $this->setContentSubTabs();
408 if ($this->isActiveAdministrationPanel()) {
409 if (!$this->item_presentation->canManageItems()) {
410 $this->ctrl->redirect($this, "disableAdministrationPanel");
411 }
412 $ilTabs->activateSubTab("manage");
413 } else {
414 $ilTabs->activateSubTab("view_content");
415 }
416
417 $container_view->setOutput();
418
419 //$this->adminCommands = $container_view->adminCommands;
420
421 $is_container_cmd = strtolower($this->std_request->getCmdClass()) === strtolower(get_class($this))
422 || ($this->std_request->getCmdClass() === "");
423
424 // it is important not to show the subobjects/admin panel here, since
425 // we will create nested forms in case, e.g. a news/calendar item is added
426 if ($is_container_cmd) {
427 $this->showAdministrationPanel();
428
429 if (!$this->edit_order) {
430 $this->showPossibleSubObjects();
431 }
432 if ($this->isActiveAdministrationPanel()) {
433 $this->addImportButtonToToolbar();
434 }
435
436 if (is_object($this->object) &&
437 $user->getId() !== ANONYMOUS_USER_ID &&
438 $this->rbacsystem->checkAccess("write", $this->object->getRefId())
439 ) {
440 if ($ilSetting->get("enable_cat_page_edit")) {
441 if (!$this->isActiveAdministrationPanel() &&
442 !$this->isActiveOrdering() &&
443 $this->supportsPageEditor()
444 ) {
445 $toolbar->addButton(
446 $lng->txt("cntr_text_media_editor"),
447 $ilCtrl->getLinkTarget($this, "editPageFrame")
448 );
449 }
450 }
451 }
452 if (!$this->edit_order) {
453 if (!$this->isActiveAdministrationPanel() && $this->getCreationMode() === false) {
455 }
456 }
457 }
458
459 $this->showContainerFilter();
460
461 $this->showPermanentLink();
462
463 // add tree updater javascript
464 if ($this->requested_ref_id > 1 && $ilSetting->get("rep_tree_synchronize")) {
465 $ilCtrl->setParameter($this, "active_node", $this->requested_ref_id);
466 }
467 }
468
469 protected function supportsPageEditor(): bool
470 {
471 return true;
472 }
473
477 public function renderBlockAsynchObject(): void
478 {
479 $container_view = $this->getContentGUI();
480 echo $container_view->getSingleTypeBlockAsynch(
481 $this->std_request->getType()
482 );
483 exit;
484 }
485
486 public function setContentSubTabs(): void
487 {
488 $this->addStandardContainerSubTabs();
489 }
490
491 public function showAdministrationPanel(): void
492 {
493 global $DIC;
494
495 $ilAccess = $this->access;
497
498 $main_tpl = $DIC->ui()->mainTemplate();
499
500 $lng->loadLanguageModule('cntr');
501
502 if ($this->clipboard->hasEntries() && !$this->edit_order) {
503 // #11545
504 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
505
506 $toolbar = new ilToolbarGUI();
507 $toolbar->setId("admclip");
508 $this->ctrl->setParameter($this, "type", "");
509 $this->ctrl->setParameter($this, "item_ref_id", "");
510
511 $toolbar->addComponent(
512 $this->ui->factory()->button()->standard(
513 $this->lng->txt('paste_clipboard_items'),
514 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, static::class], 'paste')
515 )
516 );
517
518 $toolbar->addComponent(
519 $this->ui->factory()->button()->standard(
520 $this->lng->txt('clear_clipboard'),
521 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, static::class], 'clear')
522 )
523 );
524
525 $main_tpl->addAdminPanelToolbar($toolbar, true, false);
526 } elseif ($this->isActiveAdministrationPanel()) {
527 // #11545
528 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
529 $toolbar = new ilToolbarGUI();
530 $toolbar->setId("adm");
531 $this->ctrl->setParameter($this, "type", "");
532 $this->ctrl->setParameter($this, "item_ref_id", "");
533
534 if ($this->gotItems()) {
535 $toolbar->setLeadingImage(
536 ilUtil::getImagePath("nav/arrow_upright.svg"),
537 $lng->txt("actions")
538 );
539 $toolbar->addFormButton(
540 $this->lng->txt('delete_selected_items'),
541 'delete'
542 );
543 $toolbar->addFormButton(
544 $this->lng->txt('move_selected_items'),
545 'cut'
546 );
547 $toolbar->addFormButton(
548 $this->lng->txt('copy_selected_items'),
549 'copy'
550 );
551 $toolbar->addFormButton(
552 $this->lng->txt('link_selected_items'),
553 'link'
554 );
555
556 $toolbar = $this->addAvailabilityPeriodButtonToToolbar($toolbar);
557 // add download button if multi download enabled
558 $folder_set = new ilSetting('fold');
559 if ((bool) $folder_set->get('enable_multi_download') === true) {
560 $toolbar->addSeparator();
561 $toolbar->addFormButton(
562 $this->lng->txt('download_selected_items'),
563 'download'
564 );
565 }
566 }
567 $main_tpl->addAdminPanelToolbar(
568 $toolbar,
569 $this->gotItems() && !$this->clipboard->hasEntries(),
570 $this->gotItems() && !$this->clipboard->hasEntries()
571 );
572
573 // form action needed, see http://www.ilias.de/mantis/view.php?id=9630
574 if ($this->gotItems()) {
575 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
576 }
577 } elseif ($this->edit_order) {
578 if ($this->getItemPresentation()->hasItems() && $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
579 if ($this->isActiveOrdering()) {
580 // #11843
581 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
582
583 $toolbar = new ilToolbarGUI();
584 $this->ctrl->setParameter($this, "type", "");
585 $this->ctrl->setParameter($this, "item_ref_id", "");
586
587 $toolbar->addFormButton(
588 $this->lng->txt('sorting_save'),
589 'saveSorting'
590 );
591
592 $main_tpl->addAdminPanelToolbar($toolbar, true, false);
593 }
594 }
595 }
596 // bugfix mantis 24559
597 // undoing an erroneous change inside mantis 23516 by adding "Download Multiple Objects"-functionality for non-admins
598 // as they don't have the possibility to use the multi-download-capability of the manage-tab
599 elseif ($this->isMultiDownloadEnabled()) {
600 // bugfix mantis 0021272
602 $num_files = $this->tree->getChildsByType($ref_id, "file");
603 $num_folders = $this->tree->getChildsByType($ref_id, "fold");
604 if (count($num_files) > 0 || count($num_folders) > 0) {
605 // #11843
606 $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this));
607
608 $toolbar = new ilToolbarGUI();
609 $this->ctrl->setParameter($this, "type", "");
610 $this->ctrl->setParameter($this, "item_ref_id", "");
611
612 $toolbar->addFormButton(
613 $this->lng->txt('download_selected_items'),
614 'download'
615 );
616
617 $GLOBALS['tpl']->addAdminPanelToolbar(
618 $toolbar,
619 $this->gotItems(),
620 $this->gotItems()
621 );
622 } else {
623 $this->tpl->setOnScreenMessage('info', $this->lng->txt('msg_no_downloadable_objects'), true);
624 }
625 }
626 }
627
628 protected function gotItems(): bool
629 {
630 return $this->getItemPresentation()->hasItems();
631 }
632
633 public function showPermanentLink(): void
634 {
635 global $DIC;
636
637 $tpl = $DIC->ui()->mainTemplate();
638
639 $tpl->setPermanentLink(
640 $this->object->getType(),
641 $this->object->getRefId(),
642 "",
643 "_top"
644 );
645 }
646
647 public function editPageFrameObject(): void
648 {
649 $this->ctrl->redirectByClass([static::class, "ilcontainerpagegui"], "edit");
650 }
651
652 public function cancelPageContentObject(): void
653 {
654 $this->ctrl->redirect($this, "");
655 }
656
657 public function showLinkListObject(): void
658 {
660 $tree = $this->tree;
661
662 $cnt = [];
663
664 $tpl = new ilGlobalTemplate(
665 "tpl.container_link_help.html",
666 true,
667 true,
668 "components/ILIAS/Container"
669 );
670
671 $type_ordering = [
672 "cat",
673 "fold",
674 "crs",
675 "grp",
676 "chat",
677 "frm",
678 "lres",
679 "glo",
680 "webr",
681 "file",
682 "exc",
683 "tst",
684 "svy",
685 "mep",
686 "qpl",
687 "spl"
688 ];
689
690 $childs = $tree->getChilds($this->requested_ref_id);
691 foreach ($childs as $child) {
692 if (in_array($child["type"], ["lm", "sahs", "htlm"])) {
693 $cnt["lres"]++;
694 } else {
695 $cnt[$child["type"]]++;
696 }
697 }
698
699 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
700 $tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
701 foreach ($type_ordering as $type) {
702 $tpl->setCurrentBlock("row");
703 if ($type !== "lres") {
704 $tpl->setVariable(
705 "TYPE",
706 $lng->txt("objs_" . $type) .
707 " (" . ((int) $cnt[$type]) . ")"
708 );
709 } else {
710 $tpl->setVariable(
711 "TYPE",
712 $lng->txt("obj_lrss") .
713 " (" . ((int) $cnt["lres"]) . ")"
714 );
715 }
716 $tpl->setVariable("TXT_LINK", "[list-" . $type . "]");
717 $tpl->parseCurrentBlock();
718 }
719 $tpl->printToStdout();
720 exit;
721 }
722
723 public function addHeaderRow(
724 ilTemplate $a_tpl,
725 string $a_type,
726 bool $a_show_image = true
727 ): void {
728 $icon = ilUtil::getImagePath("standard/icon_" . $a_type . ".svg");
729 $title = $this->lng->txt("objs_" . $a_type);
730
731 if ($a_show_image) {
732 $a_tpl->setCurrentBlock("container_header_row_image");
733 $a_tpl->setVariable("HEADER_IMG", $icon);
734 $a_tpl->setVariable("HEADER_ALT", $title);
735 } else {
736 $a_tpl->setCurrentBlock("container_header_row");
737 }
738
739 $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
740 $a_tpl->parseCurrentBlock();
741 //$a_tpl->touchBlock("container_row");
742 }
743
744 public function addStandardRow(
745 ilTemplate $a_tpl,
746 string $a_html,
747 ?int $a_item_ref_id = null,
748 ?int $a_item_obj_id = null,
749 string $a_image_type = ""
750 ): void {
751 $ilSetting = $this->settings;
752
753 $nbsp = true;
754 if ($ilSetting->get("icon_position_in_lists") === "item_rows") {
755 $icon = ilUtil::getImagePath("standard/icon_" . $a_image_type . ".svg");
756 $alt = $this->lng->txt("obj_" . $a_image_type);
757
758 if ($ilSetting->get('custom_icons')) {
759 global $DIC;
761 $customIconFactory = $DIC['object.customicons.factory'];
762 $customIcon = $customIconFactory->getPresenterByObjId($a_item_obj_id, $a_image_type);
763
764 if ($customIcon->exists()) {
765 $icon = $customIcon->getFullPath();
766 }
767 }
768
769 $a_tpl->setCurrentBlock("block_row_image");
770 $a_tpl->setVariable("ROW_IMG", $icon);
771 $a_tpl->setVariable("ROW_ALT", $alt);
772 $a_tpl->parseCurrentBlock();
773 $nbsp = false;
774 }
775
776 if ($this->isActiveAdministrationPanel()) {
777 $a_tpl->setCurrentBlock("block_row_check");
778 $a_tpl->setVariable("ITEM_ID", $a_item_ref_id);
779 $a_tpl->parseCurrentBlock();
780 $nbsp = false;
781 }
782 if ($this->isActiveAdministrationPanel() &&
784 $a_tpl->setCurrentBlock('block_position');
785 $a_tpl->setVariable('POS_TYPE', $a_image_type);
786 $a_tpl->setVariable('POS_ID', $a_item_ref_id);
787 $a_tpl->setVariable('POSITION', sprintf('%.1f', $this->current_position++));
788 $a_tpl->parseCurrentBlock();
789 }
790 if ($nbsp) {
791 $a_tpl->setVariable("ROW_NBSP", "&nbsp;");
792 }
793 $a_tpl->setCurrentBlock("container_standard_row");
794 $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
795 $a_tpl->parseCurrentBlock();
796 $a_tpl->touchBlock("container_row");
797 }
798
799 public function addMessageRow(
800 ilTemplate $a_tpl,
801 string $a_message,
802 string $a_type
803 ): void {
804 $type = $this->lng->txt("obj_" . $a_type);
805 $a_message = str_replace("[type]", $type, $a_message);
806
807 $a_tpl->setVariable("ROW_NBSP", "&nbsp;");
808
809 $a_tpl->setCurrentBlock("container_standard_row");
810 $a_tpl->setVariable(
811 "BLOCK_ROW_CONTENT",
812 $a_message
813 );
814 $a_tpl->parseCurrentBlock();
815 $a_tpl->touchBlock("container_row");
816 }
817
818 public function setPageEditorTabs(): void
819 {
821
822 if (!$this->isActiveAdministrationPanel()
823 || strtolower($this->ctrl->getCmdClass()) !== "ilcontainerpagegui") {
824 return;
825 }
826
827 $lng->loadLanguageModule("content");
828 //$tabs_gui = new ilTabsGUI();
829 //$tabs_gui->setSubTabs();
830
831 // back to upper context
832 $this->tabs_gui->setBackTarget(
833 $this->lng->txt("obj_cat"),
834 $this->ctrl->getLinkTarget($this, "")
835 );
836
837 $this->tabs_gui->addTarget(
838 "edit",
839 $this->ctrl->getLinkTargetByClass("ilcontainerpagegui", "view"),
840 ["", "view"],
841 "ilcontainerpagegui"
842 );
843
844 //$this->tpl->setTabs($tabs_gui->getHTML());
845 }
846
851 bool $a_include_view = true
852 ): void {
853 $ilTabs = $this->tabs;
855 $ilCtrl = $this->ctrl;
856 $ilUser = $this->user;
857
858 if (!is_object($this->object)) {
859 return;
860 }
861
862 if ($a_include_view && $this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
863 if (!$this->isActiveAdministrationPanel()) {
864 $ilTabs->addSubTab("view_content", $lng->txt("view"), $ilCtrl->getLinkTargetByClass(static::class, "view"));
865 } else {
866 $ilTabs->addSubTab(
867 "view_content",
868 $lng->txt("view"),
869 $ilCtrl->getLinkTarget($this, "disableAdministrationPanel")
870 );
871 }
872 }
873
874 $item_presentation = $this->getItemPresentation();
875 if ($item_presentation->canManageItems()) {
876 if ($this->isActiveAdministrationPanel()) {
877 $ilTabs->addSubTab("manage", $lng->txt("cntr_manage"), $ilCtrl->getLinkTarget($this, ""));
878 } else {
879 $ilTabs->addSubTab(
880 "manage",
881 $lng->txt("cntr_manage"),
882 $ilCtrl->getLinkTarget($this, "enableAdministrationPanel")
883 );
884 }
885 }
886 if ($item_presentation->canOrderItems()) {
887 $ilTabs->addSubTab("ordering", $lng->txt("cntr_ordering"), $ilCtrl->getLinkTarget($this, "editOrder"));
888 }
889 }
890
891 protected function getTabs(): void
892 {
893 $rbacsystem = $this->rbacsystem;
894 $ilCtrl = $this->ctrl;
895
896 // edit permissions
897 if ($rbacsystem->checkAccess('edit_permission', $this->ref_id)) {
898 $this->tabs_gui->addTarget(
899 "perm_settings",
900 $this->ctrl->getLinkTargetByClass([get_class($this), 'ilpermissiongui'], "perm"),
901 ["perm", "info", "owner"],
902 'ilpermissiongui'
903 );
904 if ($ilCtrl->getNextClass() === "ilpermissiongui") {
905 $this->tabs_gui->activateTab("perm_settings");
906 }
907 }
908
909 // show clipboard
910 if (strtolower($this->std_request->getBaseClass()) === "ilrepositorygui" &&
911 $this->clipboard->hasEntries()) {
912 $this->tabs_gui->addTarget(
913 "clipboard",
914 $this->ctrl->getLinkTarget($this, "clipboard"),
915 "clipboard",
916 get_class($this)
917 );
918 }
919 }
920
921 //*****************
922 // COMMON METHODS (may be overwritten in derived classes
923 // if special handling is necessary)
924 //*****************
925
926 public function enableAdministrationPanelObject(): void
927 {
928 $this->getModeManager()->setAdminMode();
929 $this->ctrl->redirect($this, "render");
930 }
931
932 public function disableAdministrationPanelObject(): void
933 {
934 $this->getModeManager()->setContentMode();
935 $this->ctrl->redirect($this, "render");
936 }
937
938 public function editOrderObject(): void
939 {
940 $ilTabs = $this->tabs;
941 $this->edit_order = true;
942 $this->getModeManager()->setOrderingMode();
943 $this->renderObject();
944
945 $ilTabs->activateSubTab("ordering");
946 }
947
948 // Check if ordering is enabled
949 public function isActiveOrdering(): bool
950 {
951 return $this->edit_order;
952 }
953
954 public function isActiveItemOrdering(): bool
955 {
956 if ($this->isActiveOrdering()) {
958 }
959 return false;
960 }
961
962
963 // bugfix mantis 24559
964 // undoing an erroneous change inside mantis 23516 by adding "Download Multiple Objects"-functionality for non-admins
965 // as they don't have the possibility to use the multi-download-capability of the manage-tab
966 public function enableMultiDownloadObject(): void
967 {
968 $this->multi_download_enabled = true;
969 $this->renderObject();
970 }
971
972 public function isMultiDownloadEnabled(): bool
973 {
974 return $this->multi_download_enabled;
975 }
976
981 public function cutObject(): void
982 {
983 $rbacsystem = $this->rbacsystem;
984 $ilCtrl = $this->ctrl;
985 $ilErr = $this->error;
986
987 $ids = $this->std_request->getSelectedIds();
988 $no_cut = [];
989
990 if (count($ids) === 0) {
991 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
992 $this->ctrl->redirect($this, "");
993 }
994
995 // FOR ALL OBJECTS THAT SHOULD BE COPIED
996 foreach ($ids as $ref_id) {
997 // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
998 $node_data = $this->tree->getNodeData($ref_id);
999 $subtree_nodes = $this->tree->getSubTree($node_data);
1000
1001 $all_node_data[] = $node_data;
1002 $all_subtree_nodes[] = $subtree_nodes;
1003
1004 // CHECK DELETE PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
1005 foreach ($subtree_nodes as $node) {
1006 if ($node['type'] === 'rolf') {
1007 continue;
1008 }
1009
1010 if (!$rbacsystem->checkAccess('delete', $node["ref_id"])) {
1011 $no_cut[] = $node["ref_id"];
1012 }
1013 }
1014 }
1015 // IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'delete'
1016 if (count($no_cut)) {
1017 $titles = [];
1018 foreach ($no_cut as $cut_id) {
1019 $titles[] = ilObject::_lookupTitle(ilObject::_lookupObjId($cut_id));
1020 }
1021 $ilErr->raiseError(
1022 $this->lng->txt("msg_no_perm_cut") . " " . implode(',', $titles),
1023 $ilErr->MESSAGE
1024 );
1025 }
1026 $this->clipboard->setParent($this->requested_ref_id);
1027 $this->clipboard->setCmd($ilCtrl->getCmd());
1028 $this->clipboard->setRefIds($this->std_request->getSelectedIds());
1029
1030 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cut_clipboard"), true);
1031
1032 $this->initAndDisplayMoveIntoObjectObject();
1033 }
1034
1039 public function copyObject(): void
1040 {
1041 $rbacsystem = $this->rbacsystem;
1042 $ilCtrl = $this->ctrl;
1043 $objDefinition = $this->obj_definition;
1044 $ilErr = $this->error;
1045
1046 $no_copy = [];
1047
1048 $ids = $this->std_request->getSelectedIds();
1049
1050 if (count($ids) === 0) {
1051 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1052 $this->ctrl->redirect($this, "");
1053 }
1054
1055 // FOR ALL OBJECTS THAT SHOULD BE COPIED
1056 $containers = 0;
1057 foreach ($ids as $ref_id) {
1058 // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
1059 $node_data = $this->tree->getNodeData($ref_id);
1060
1061 // count containers
1062 if ($objDefinition->isContainer($node_data["type"])) {
1063 $containers++;
1064 }
1065
1066 $subtree_nodes = $this->tree->getSubTree($node_data);
1067
1068 $all_node_data[] = $node_data;
1069 $all_subtree_nodes[] = $subtree_nodes;
1070
1071 // CHECK COPY PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
1072 foreach ($subtree_nodes as $node) {
1073 if ($node['type'] === 'rolf') {
1074 continue;
1075 }
1076
1077 if (!$rbacsystem->checkAccess('visible,read', $node["ref_id"])) {
1078 $no_copy[] = $node["ref_id"];
1079 }
1080 }
1081 }
1082
1083 if ($containers > 0 && count($this->std_request->getSelectedIds()) > 1) {
1084 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("cntr_container_only_on_their_own"), true);
1085 $this->ctrl->redirect($this, "");
1086 }
1087
1088 // IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'delete'
1089 if (is_array($no_copy) && count($no_copy)) {
1090 $titles = [];
1091 foreach ($no_copy as $copy_id) {
1092 $titles[] = ilObject::_lookupTitle(ilObject::_lookupObjId($copy_id));
1093 }
1094 $this->tpl->setOnScreenMessage(
1095 'failure',
1096 $this->lng->txt("msg_no_perm_copy") . " " . implode(',', $titles),
1097 true
1098 );
1099 $this->ctrl->redirect($this, "");
1100 }
1101
1102 // if we have a single container, set it as source id and redirect to ilObjectCopyGUI
1103 $ids = $this->std_request->getSelectedIds();
1104 if (count($ids) === 1) {
1105 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_id", $ids[0]);
1106 } else {
1107 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_ids", implode("_", $ids));
1108 }
1109 $ilCtrl->redirectByClass("ilobjectcopygui", "initTargetSelection");
1110
1111 $this->clipboard->setParent($this->requested_ref_id);
1112 $this->clipboard->setCmd($ilCtrl->getCmd());
1113 $this->clipboard->setRefIds($ids);
1114
1115 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_copy_clipboard"), true);
1116
1117 $this->initAndDisplayCopyIntoMultipleObjectsObject();
1118 }
1119
1120 public function downloadObject(): void
1121 {
1122 if (in_array($this->user->getId(), [ANONYMOUS_USER_ID, 0], true)) {
1123 return;
1124 }
1125
1126 $ilErr = $this->error;
1127 // This variable determines whether the task has been initiated by a folder's action drop-down to prevent a folder
1128 // duplicate inside the zip.
1129 $initiated_by_folder_action = false;
1130
1131 $ids = $this->std_request->getSelectedIds();
1132
1133 if (count($ids) === 0) {
1134 $object = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
1135 $object_type = $object->getType();
1136 if ($object_type === "fold") {
1137 $ids = [$this->requested_ref_id];
1138 $initiated_by_folder_action = true;
1139 } else {
1140 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1141 $this->ctrl->redirect($this, "");
1142 }
1143 }
1144
1145 $download_job = new ilDownloadContainerFilesBackgroundTask(
1146 $GLOBALS['DIC']->user()->getId(),
1147 $ids,
1148 $initiated_by_folder_action
1149 );
1150
1151 $download_job->setBucketTitle($this->getBucketTitle());
1152 if ($download_job->run()) {
1153 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_bt_download_started'), true);
1154 }
1155 $GLOBALS['DIC']->ctrl()->redirect($this);
1156 }
1157
1158 public function getBucketTitle(): string
1159 {
1160 return ilFileUtils::getASCIIFilename($this->object->getTitle());
1161 }
1162
1167 public function linkObject(): void
1168 {
1169 $rbacsystem = $this->rbacsystem;
1170 $ilCtrl = $this->ctrl;
1171 $ilErr = $this->error;
1172
1173 $no_cut = [];
1174 $no_link = [];
1175
1176 $ids = $this->std_request->getSelectedIds();
1177
1178 if (count($ids) === 0) {
1179 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1180 $this->ctrl->redirect($this, "");
1181 }
1182
1183 // CHECK ACCESS
1184 foreach ($ids as $ref_id) {
1185 if (!$rbacsystem->checkAccess('delete', $ref_id)) {
1186 $no_cut[] = $ref_id;
1187 }
1188
1190
1191 if (!$this->obj_definition->allowLink($object->getType())) {
1192 $no_link[] = $object->getType();
1193 }
1194 }
1195
1196 // NO ACCESS
1197 if ($no_cut !== []) {
1198 $this->tpl->setOnScreenMessage(
1199 'failure',
1200 $this->lng->txt("msg_no_perm_link") . " " . implode(',', $no_cut),
1201 true
1202 );
1203 $this->ctrl->redirect($this, "");
1204 }
1205
1206 if ($no_link !== []) {
1207 //#12203
1208 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_obj_no_link'), true);
1209 $this->ctrl->redirect($this, "");
1210 }
1211
1212 $this->clipboard->setParent($this->requested_ref_id);
1213 $this->clipboard->setCmd($ilCtrl->getCmd());
1214 $this->clipboard->setRefIds($ids);
1215
1216 $suffix = 'p';
1217 if (count($this->clipboard->getRefIds()) === 1) {
1218 $suffix = 's';
1219 }
1220 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_link_clipboard_" . $suffix), true);
1221
1222 $this->initAndDisplayLinkIntoMultipleObjectsObject();
1223 }
1224
1228 public function clearObject(): void
1229 {
1230 $this->clipboard->clear();
1231
1232 //var_dump($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));
1233
1234 // only redirect if clipboard was cleared
1235 if ($this->ctrl->getCmd() === "clear") {
1236 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_clear_clipboard"), true);
1237 // fixed mantis 0018474: Clear Clipboard redirects to Subtab View, instead of Subtab "Edit Multiple"
1238 $this->ctrl->redirect($this, 'render');
1239 }
1240 }
1241
1243 {
1244 $rbacsystem = $this->rbacsystem;
1245 $rbacadmin = $this->rbacadmin;
1246 $rbacreview = $this->rbacreview;
1247 $ilLog = $this->log;
1248 $tree = $this->tree;
1249 $ilObjDataCache = $this->obj_data_cache;
1250 $ilUser = $this->user;
1251 $ilErr = $this->error;
1252 $lng = $this->lng;
1253 $ui = $this->ui;
1254
1255 $exists = [];
1256 $is_child = [];
1257 $not_allowed_subobject = [];
1258 $no_paste = [];
1259
1260 $command = $this->clipboard->getCmd();
1261 if (!in_array($command, ['cut', 'link', 'copy'])) {
1262 $message = __METHOD__ . ": cmd was neither 'cut', 'link' nor 'copy'; may be a hack attempt!";
1263 $ilErr->raiseError($message, $ilErr->WARNING);
1264 }
1265
1266 $nodes = $this->std_request->getNodes();
1267
1268 if (count($nodes) === 0) {
1269 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_at_least_one_object'));
1270 switch ($command) {
1271 case 'link':
1272 case 'copy':
1273 case 'cut':
1274 $this->showPasteTreeObject();
1275 break;
1276 }
1277 return;
1278 }
1279
1280 // this loop does all checks
1281 $folder_objects_cache = [];
1282 foreach ($this->clipboard->getRefIds() as $ref_id) {
1284 $current_parent_id = $tree->getParentId($obj_data->getRefId());
1285
1286 foreach ($nodes as $folder_ref_id) {
1287 if (!array_key_exists($folder_ref_id, $folder_objects_cache)) {
1288 $folder_objects_cache[$folder_ref_id] = ilObjectFactory::getInstanceByRefId($folder_ref_id);
1289 }
1290
1291 // CHECK ACCESS
1292 if (!$rbacsystem->checkAccess('create', $folder_ref_id, $obj_data->getType())) {
1293 $no_paste[] = sprintf(
1294 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
1295 $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']',
1296 $folder_objects_cache[$folder_ref_id]->getTitle(
1297 ) . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']'
1298 );
1299 }
1300
1301 // CHECK IF REFERENCE ALREADY EXISTS
1302 if ($folder_ref_id == $current_parent_id) {
1303 $exists[] = sprintf(
1304 $this->lng->txt('msg_obj_exists_in_folder'),
1305 $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']',
1306 $folder_objects_cache[$folder_ref_id]->getTitle(
1307 ) . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']'
1308 );
1309 }
1310
1311 // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
1312 if ($ref_id == $folder_ref_id || $tree->isGrandChild($ref_id, $folder_ref_id)) {
1313 $is_child[] = sprintf(
1314 $this->lng->txt('msg_paste_object_not_in_itself'),
1315 $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']'
1316 );
1317 }
1318
1319 // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
1320 if (!array_key_exists(
1321 $obj_data->getType(),
1322 $folder_objects_cache[$folder_ref_id]->getPossibleSubObjects()
1323 )) {
1324 $not_allowed_subobject[] = sprintf(
1325 $this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
1326 $folder_objects_cache[$folder_ref_id]->getTitle(
1327 ) . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']',
1328 $lng->txt('obj_' . $obj_data->getType())
1329 );
1330 }
1331 }
1332 }
1333
1335 // process checking results
1336 $error = "";
1337 if ($command !== "copy" && count($exists)) {
1338 $error .= implode('<br />', $exists);
1339 }
1340
1341 if (count($is_child)) {
1342 $error .= $error !== '' ? '<br />' : '';
1343 $error .= implode('<br />', $is_child);
1344 }
1345
1346 if (count($not_allowed_subobject)) {
1347 $error .= $error !== '' ? '<br />' : '';
1348 $error .= implode('<br />', $not_allowed_subobject);
1349 }
1350
1351 if (count($no_paste)) {
1352 $error .= $error !== '' ? '<br />' : '';
1353 $error .= implode('<br />', $no_paste);
1354 }
1355
1356 if ($error !== '') {
1357 $this->tpl->setOnScreenMessage('failure', $error);
1358 switch ($command) {
1359 case 'link':
1360 case 'copy':
1361 case 'cut':
1362 $this->showPasteTreeObject();
1363 break;
1364 }
1365 return;
1366 }
1367
1368 // log pasteObject call
1369 $ilLog->write(__METHOD__ . ", cmd: " . $command);
1370
1372 // everything ok: now paste the objects to new location
1373
1374 // to prevent multiple actions via back/reload button
1375 $ref_ids = $this->clipboard->getRefIds();
1376 $this->clipboard->clear();
1377
1378
1379 // process COPY command
1380 if ($command === 'copy') {
1381 foreach ($nodes as $folder_ref_id) {
1382 foreach ($ref_ids as $ref_id) {
1383 $revIdMapping = [];
1384
1385 $oldNode_data = $tree->getNodeData($ref_id);
1386 if ($oldNode_data['parent'] == $folder_ref_id) {
1387 $newTitle = ilObjFileAccess::_appendNumberOfCopyToFilename($oldNode_data['title'], null);
1388 $newRef = $this->cloneNodes($ref_id, $folder_ref_id, $refIdMapping, $newTitle);
1389 } else {
1390 $newRef = $this->cloneNodes($ref_id, $folder_ref_id, $refIdMapping, null);
1391 }
1392
1393 // BEGIN ChangeEvent: Record copy event.
1394 $old_parent_data = $tree->getParentNodeData($ref_id);
1395 $newNode_data = $tree->getNodeData($newRef);
1397 $oldNode_data['type'],
1398 $ref_id,
1399 $oldNode_data['obj_id'],
1400 $ilUser->getId()
1401 );
1403 $newNode_data['obj_id'],
1404 $ilUser->getId(),
1405 'add',
1406 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1407 );
1408 // END PATCH ChangeEvent: Record cut event.
1409 }
1410 }
1411
1412 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_cloned'), true);
1413 } // END COPY
1414
1415 // process CUT command
1416 if ($command === 'cut') {
1417 foreach ($nodes as $folder_ref_id) {
1418 foreach ($ref_ids as $ref_id) {
1419 // Store old parent
1420 $old_parent = $tree->getParentId($ref_id);
1421 $tree->moveTree($ref_id, $folder_ref_id);
1422 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1423
1425
1426 // BEGIN ChangeEvent: Record cut event.
1427 $node_data = $tree->getNodeData($ref_id);
1428 $old_parent_data = $tree->getNodeData($old_parent);
1430 $node_data['obj_id'],
1431 $ilUser->getId(),
1432 'remove',
1433 $old_parent_data['obj_id']
1434 );
1436 $node_data['obj_id'],
1437 $ilUser->getId(),
1438 'add',
1439 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1440 );
1441 // END PATCH ChangeEvent: Record cut event.
1442 }
1443
1444 // prevent multiple iterations for cut cmommand
1445 break;
1446 }
1447
1448 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_cut_copied'), true);
1449 } // END CUT
1450
1451 // process LINK command
1452 if ($command === 'link') {
1453 $subnodes = [];
1454 $linked_to_folders = [];
1455
1456 $rbac_log_active = ilRbacLog::isActive();
1457
1458 foreach ($nodes as $folder_ref_id) {
1459 $linked_to_folders[$folder_ref_id] = $ilObjDataCache->lookupTitle(
1460 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1461 );
1462
1463 foreach ($ref_ids as $ref_id) {
1464 // get node data
1465 $top_node = $tree->getNodeData($ref_id);
1466
1467 // get subnodes of top nodes
1468 $subnodes[$ref_id] = $tree->getSubTree($top_node);
1469 }
1470
1471 // now move all subtrees to new location
1472 foreach ($subnodes as $key => $subnode) {
1473 // first paste top_node....
1474 $obj_data = ilObjectFactory::getInstanceByRefId($key);
1475 $new_ref_id = $obj_data->createReference();
1476 $obj_data->putInTree($folder_ref_id);
1477 $obj_data->setPermissions($folder_ref_id);
1478
1479 // rbac log
1480 if ($rbac_log_active) {
1481 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, false);
1482 $rbac_log = ilRbacLog::gatherFaPa($new_ref_id, array_keys($rbac_log_roles), true);
1483 ilRbacLog::add(ilRbacLog::LINK_OBJECT, $new_ref_id, $rbac_log, $key);
1484 }
1485
1486 // BEGIN ChangeEvent: Record link event.
1487 $node_data = $tree->getNodeData($new_ref_id);
1489 $node_data['obj_id'],
1490 $ilUser->getId(),
1491 'add',
1492 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1493 );
1494 // END PATCH ChangeEvent: Record link event.
1495 }
1496
1497 $ilLog->write(__METHOD__ . ', link finished');
1498 }
1499
1500 $links = [];
1501 if (count($linked_to_folders)) {
1502 foreach ($linked_to_folders as $ref_id => $title) {
1503 $links[] = $ui->factory()->link()->standard($title, ilLink::_getLink($ref_id));
1504 }
1505 }
1506
1507 $suffix = 'p';
1508 if (count($ref_ids) === 1) {
1509 $suffix = 's';
1510 }
1511
1512 $mbox = $ui->factory()->messageBox()->success(
1513 $this->lng->txt('mgs_objects_linked_to_the_following_folders_' . $suffix)
1514 )
1515 ->withLinks($links);
1516
1517 $this->tpl->setOnScreenMessage('success', $ui->renderer()->render($mbox), true);
1518 } // END LINK
1519
1520 // clear clipboard
1521 $this->clearObject();
1522
1523 $this->ctrl->returnToParent($this);
1524 }
1525
1527 {
1528 $this->showPasteTreeObject();
1529 }
1530
1531 public function showPasteTreeObject(): void
1532 {
1533 $ilTabs = $this->tabs;
1534 $ilErr = $this->error;
1535
1536 $ilTabs->setTabActive('view_content');
1537
1538 if (!in_array($this->clipboard->getCmd(), ['link', 'copy', 'cut'])) {
1539 $message = __METHOD__ . ": Unknown action.";
1540 $ilErr->raiseError($message, $ilErr->WARNING);
1541 }
1542 $cmd = $this->clipboard->getCmd();
1543
1544 //
1545 $exp = $this->getTreeSelectorGUI($cmd);
1546 if ($exp->handleCommand()) {
1547 return;
1548 }
1549 $output = $exp->getHTML();
1550
1551 $txt_var = ($cmd === "copy")
1552 ? "copy"
1553 : "paste";
1554
1555 // toolbars
1556 $t = new ilToolbarGUI();
1557 $t->setFormAction($this->ctrl->getFormAction($this, "performPasteIntoMultipleObjects"));
1558
1559 $this->gui->button(
1560 $this->lng->txt($txt_var),
1561 "performPasteIntoMultipleObjects"
1562 )->submit()->toToolbar(true, $t);
1563
1564 $t->addSeparator();
1565 $this->lng->loadLanguageModule('obj');
1566 $t->addFormButton($this->lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard");
1567
1568 $t->addFormButton($this->lng->txt("cancel"), "cancelMoveLink");
1569 $t->setCloseFormTag(false);
1570 $t->setLeadingImage(ilUtil::getImagePath("nav/arrow_upright.svg"), " ");
1571 $output = $t->getHTML() . $output;
1572 $t->setLeadingImage(ilUtil::getImagePath("nav/arrow_downright.svg"), " ");
1573 $t->setCloseFormTag(true);
1574 $t->setOpenFormTag(false);
1575 $output .= "<br />" . $t->getHTML();
1576
1577 $this->tpl->setContent($output);
1578 }
1579
1584 public function cancelMoveLinkObject(): void
1585 {
1586 $ilCtrl = $this->ctrl;
1587
1588 $this->clipboard->clear();
1589 $ilCtrl->returnToParent($this);
1590 }
1591
1592 public function keepObjectsInClipboardObject(): void
1593 {
1594 $ilCtrl = $this->ctrl;
1595
1596 $this->tpl->setOnScreenMessage('success', $this->lng->txt("obj_inserted_clipboard"), true);
1597 $ilCtrl->returnToParent($this);
1598 }
1599
1601 {
1602 $this->showPasteTreeObject();
1603 }
1604
1606 {
1607 $this->showPasteTreeObject();
1608 }
1609
1614 public function pasteObject(): void
1615 {
1616 $rbacsystem = $this->rbacsystem;
1617 $rbacadmin = $this->rbacadmin;
1618 $ilLog = $this->log;
1619 $tree = $this->tree;
1620 $ilUser = $this->user;
1621 $ilCtrl = $this->ctrl;
1622 $ilErr = $this->error;
1623
1624 $exists = [];
1625 $no_paste = [];
1626 $is_child = [];
1627 $not_allowed_subobject = [];
1628
1629
1630 if (!in_array($this->clipboard->getCmd(), ["cut", "link", "copy"])) {
1631 $message = get_class(
1632 $this
1633 ) . "::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
1634 $ilErr->raiseError($message, $ilErr->WARNING);
1635 }
1636
1637 // this loop does all checks
1638 foreach ($this->clipboard->getRefIds() as $ref_id) {
1640
1641 // CHECK ACCESS
1642 if (!$rbacsystem->checkAccess('create', $this->object->getRefId(), $obj_data->getType())) {
1643 $no_paste[] = $ref_id;
1644 $no_paste_titles[] = $obj_data->getTitle();
1645 }
1646
1647 // CHECK IF REFERENCE ALREADY EXISTS
1648 if ($this->object->getRefId() === $this->tree->getParentId($obj_data->getRefId())) {
1649 $exists[] = $ref_id;
1650 break;
1651 }
1652
1653 // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
1654 if ($this->tree->isGrandChild($ref_id, $this->object->getRefId())) {
1656 }
1657
1658 if ($ref_id == $this->object->getRefId()) {
1660 }
1661
1662 // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
1663 $obj_type = $obj_data->getType();
1664
1665 if (!array_key_exists($obj_type, $this->object->getPossibleSubObjects())) {
1666 $not_allowed_subobject[] = $obj_data->getType();
1667 }
1668 }
1669
1671 // process checking results
1672 // BEGIN WebDAV: Copying an object into the same container is allowed
1673 if (count($exists) > 0 && $this->clipboard->getCmd() !== "copy") {
1674 // END WebDAV: Copying an object into the same container is allowed
1675 $ilErr->raiseError($this->lng->txt("msg_obj_exists"), $ilErr->MESSAGE);
1676 }
1677
1678 if (count($is_child) > 0) {
1679 $ilErr->raiseError(
1680 $this->lng->txt("msg_not_in_itself") . " " . implode(',', $is_child),
1681 $ilErr->MESSAGE
1682 );
1683 }
1684
1685 if (count($not_allowed_subobject) > 0) {
1686 $ilErr->raiseError(
1687 $this->lng->txt("msg_may_not_contain") . " " . implode(',', $not_allowed_subobject),
1688 $ilErr->MESSAGE
1689 );
1690 }
1691
1692 if (count($no_paste) > 0) {
1693 $ilErr->raiseError(
1694 $this->lng->txt("msg_no_perm_paste") . " " .
1695 implode(',', $no_paste),
1696 $ilErr->MESSAGE
1697 );
1698 }
1699
1700 // log pasteObject call
1701 $ilLog->write("ilObjectGUI::pasteObject(), cmd: " . $this->clipboard->getCmd());
1702
1704 // everything ok: now paste the objects to new location
1705
1706 // to prevent multiple actions via back/reload button
1707 $ref_ids = $this->clipboard->getRefIds();
1708
1709 // save cmd for correct message output after clearing the clipboard
1710 $last_cmd = $this->clipboard->getCmd();
1711
1712 // BEGIN WebDAV: Support a copy command in the repository
1713 // process COPY command
1714 if ($this->clipboard->getCmd() === "copy") {
1715 $this->clipboard->clear();
1716
1717 // new implementation, redirects to ilObjectCopyGUI
1718 $ilCtrl->setParameterByClass("ilobjectcopygui", "target", $this->object->getRefId());
1719 if (count($ref_ids) === 1) {
1720 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_id", $ref_ids[0]);
1721 } else {
1722 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_ids", implode("_", $ref_ids));
1723 }
1724 $ilCtrl->redirectByClass("ilobjectcopygui", "saveTarget");
1725
1726 $ilLog->write("ilObjectGUI::pasteObject(), copy finished");
1727 }
1728 // END WebDAV: Support a Copy command in the repository
1729
1730 // process CUT command
1731 if ($this->clipboard->getCmd() === "cut") {
1732 foreach ($ref_ids as $ref_id) {
1733 // Store old parent
1734 $old_parent = $tree->getParentId($ref_id);
1735 $this->tree->moveTree($ref_id, $this->object->getRefId());
1736 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1737
1739
1740 // BEGIN ChangeEvent: Record cut event.
1741 $node_data = $tree->getNodeData($ref_id);
1742 $old_parent_data = $tree->getNodeData($old_parent);
1744 $node_data['obj_id'],
1745 $ilUser->getId(),
1746 'remove',
1747 $old_parent_data['obj_id']
1748 );
1750 $node_data['obj_id'],
1751 $ilUser->getId(),
1752 'add',
1753 $this->object->getId()
1754 );
1755 // END PATCH ChangeEvent: Record cut event.
1756 }
1757 } // END CUT
1758
1759 // process LINK command
1760 $ref_id = 0;
1761 $subnodes = [];
1762 if ($this->clipboard->getCmd() === "link") {
1763 foreach ($ref_ids as $ref_id) {
1764 // get node data
1765 $top_node = $this->tree->getNodeData($ref_id);
1766
1767 // get subnodes of top nodes
1768 $subnodes[$ref_id] = $this->tree->getSubTree($top_node);
1769 }
1770 // now move all subtrees to new location
1771 foreach ($subnodes as $key => $subnode) {
1772 // first paste top_node....
1773 $obj_data = ilObjectFactory::getInstanceByRefId($key);
1774 $new_ref_id = $obj_data->createReference();
1775 $obj_data->putInTree($this->requested_ref_id);
1776 $obj_data->setPermissions($this->requested_ref_id);
1777
1778 // BEGIN ChangeEvent: Record link event.
1779 $node_data = $tree->getNodeData($new_ref_id);
1781 $node_data['obj_id'],
1782 $ilUser->getId(),
1783 'add',
1784 $this->object->getId()
1785 );
1786 // END PATCH ChangeEvent: Record link event.
1787 }
1788
1789 $ilLog->write("ilObjectGUI::pasteObject(), link finished");
1790 } // END LINK
1791
1792
1793 // clear clipboard
1794 $this->clearObject();
1795
1796 if ($last_cmd === "cut") {
1797 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_cut_copied"), true);
1798 } // BEGIN WebDAV: Support a copy command in repository
1799 elseif ($last_cmd === "copy") {
1800 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_cloned"), true);
1801 } elseif ($last_cmd === 'link') {
1802 // END WebDAV: Support copy command in repository
1803 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_linked"), true);
1804 }
1805
1806 $this->ctrl->returnToParent($this);
1807 }
1808
1809 // show clipboard
1810 public function clipboardObject(): void
1811 {
1812 $ilErr = $this->error;
1813 $ilLog = $this->log;
1814 $ilTabs = $this->tabs;
1815 $tpl = $this->tpl;
1816 $ilToolbar = $this->toolbar;
1817 $ilCtrl = $this->ctrl;
1818 $lng = $this->lng;
1819
1820 $ilTabs->activateTab("clipboard");
1821
1822 // function should not be called if clipboard is empty
1823 if (!$this->clipboard->hasEntries()) {
1824 $message = sprintf('%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
1825 $ilLog->write($message, $ilLog->FATAL);
1826 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
1827 }
1828
1829 $data = [];
1830 foreach ($this->clipboard->getRefIds() as $ref_id) {
1831 if (!$tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id, false)) {
1832 continue;
1833 }
1834
1835 $data[] = [
1836 "type" => $tmp_obj->getType(),
1837 "type_txt" => $this->lng->txt("obj_" . $tmp_obj->getType()),
1838 "title" => $tmp_obj->getTitle(),
1839 "cmd" => ($this->clipboard->getCmd() === "cut") ? $this->lng->txt("move") : $this->lng->txt(
1840 $this->clipboard->getCmd()
1841 ),
1842 "ref_id" => $ref_id,
1843 "obj_id" => $tmp_obj->getId()
1844 ];
1845
1846 unset($tmp_obj);
1847 }
1848
1849 $tab = new ilObjClipboardTableGUI($this, "clipboard");
1850 $tab->setData($data);
1851 $tpl->setContent($tab->getHTML());
1852
1853 if (count($data) > 0) {
1854 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1855 $ilToolbar->addFormButton(
1856 $lng->txt("insert_object_here"),
1857 "paste"
1858 );
1859 $ilToolbar->addFormButton(
1860 $lng->txt("clear_clipboard"),
1861 "clear"
1862 );
1863 }
1864 }
1865
1866 public function isActiveAdministrationPanel(): bool
1867 {
1868 // #10081
1869 if ($this->object->getRefId() &&
1870 !$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
1871 return false;
1872 }
1873
1874 return $this->getModeManager()->isAdminMode();
1875 }
1876
1877 public function setColumnSettings(ilColumnGUI $column_gui): void
1878 {
1879 $ilAccess = $this->access;
1880 parent::setColumnSettings($column_gui);
1881
1882 $column_gui->setItemPresentationManager(
1883 $this->item_presentation
1884 );
1885
1886 //if ($ilAccess->checkAccess("write", "", $this->object->getRefId())
1887 // && $this->allowBlocksConfigure())
1888 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1889 $column_gui->setBlockProperty("news", "settings", '1');
1890 //$column_gui->setBlockProperty("news", "public_notifications_option", true);
1891 $column_gui->setBlockProperty("news", "default_visibility_option", '1');
1892 $column_gui->setBlockProperty("news", "hide_news_block_option", '1');
1893 }
1894
1895 if ($this->isActiveAdministrationPanel()) {
1896 $column_gui->setAdminCommands(true);
1897 }
1898 }
1899
1903 public function allowBlocksMoving(): bool
1904 {
1905 return true;
1906 }
1907
1911 public function allowBlocksConfigure(): bool
1912 {
1913 return true;
1914 }
1915
1916
1921 public function cloneAllObject(): void
1922 {
1923 $ilCtrl = $this->ctrl;
1924
1925 $ilAccess = $this->access;
1926 $ilErr = $this->error;
1927 $rbacsystem = $this->rbacsystem;
1928
1929 $new_type = $this->std_request->getNewType();
1931 $clone_source = $this->std_request->getCloneSource();
1932
1933 if (!$rbacsystem->checkAccess('create', $ref_id, $new_type)) {
1934 $ilErr->raiseError($this->lng->txt('permission_denied'));
1935 }
1936 if (!$clone_source) {
1937 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1938 $this->createObject();
1939 return;
1940 }
1941 if (!$ilAccess->checkAccess('write', '', $clone_source, $new_type)) {
1942 $ilErr->raiseError($this->lng->txt('permission_denied'));
1943 }
1944
1945 $options = $this->std_request->getCopyOptions();
1946 $orig = ilObjectFactory::getInstanceByRefId($clone_source);
1947 $result = $orig->cloneAllObject(
1948 $_COOKIE[session_name()],
1949 $_COOKIE['ilClientId'],
1950 $new_type,
1951 $ref_id,
1952 $clone_source,
1953 $options
1954 );
1955
1956 if (ilCopyWizardOptions::_isFinished($result['copy_id'])) {
1957 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_duplicated"), true);
1958 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $result['ref_id']);
1959 } else {
1960 $this->tpl->setOnScreenMessage('info', $this->lng->txt("object_copy_in_progress"), true);
1961 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
1962 }
1963 $ilCtrl->redirectByClass("ilrepositorygui", "");
1964 }
1965
1966 public function saveSortingObject(): void
1967 {
1968 $sorting = ilContainerSorting::_getInstance($this->object->getId());
1969
1970 // Allow comma
1971 $positions = $this->std_request->getPositions();
1972 $sorting->savePost($positions);
1973 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cntr_saved_sorting'), true);
1974 $this->ctrl->redirect($this, "editOrder");
1975 }
1976
1977 // BEGIN WebDAV: Support a copy command in the repository
1978
1982 public function cloneNodes(
1983 int $srcRef,
1984 int $dstRef,
1985 array &$mapping,
1986 ?string $newName = null
1987 ): int {
1988 $tree = $this->tree;
1989
1990 // clone the source node
1991 $srcObj = ilObjectFactory::getInstanceByRefId($srcRef);
1992 $newRef = $srcObj->cloneObject($dstRef)->getRefId();
1993
1994 // We must immediately apply a new name to the object, to
1995 // prevent confusion of WebDAV clients about having two objects with identical
1996 // name in the repository.
1997 if (!is_null($newName)) {
1998 $newObj = ilObjectFactory::getInstanceByRefId($newRef);
1999 $newObj->setTitle($newName);
2000 $newObj->update();
2001 unset($newObj);
2002 }
2003 unset($srcObj);
2004 $mapping[$newRef] = $srcRef;
2005
2006 // clone all children of the source node
2007 $children = $tree->getChilds($srcRef);
2008 foreach ($tree->getChilds($srcRef) as $child) {
2009 // Don't clone role folders, because it does not make sense to clone local roles
2010 // FIXME - Maybe it does make sense (?)
2011 if ($child["type"] !== 'rolf') {
2012 $this->cloneNodes($child["ref_id"], $newRef, $mapping);
2013 } elseif (count($rolf = $tree->getChildsByType($newRef, "rolf"))) {
2014 $mapping[$rolf[0]["ref_id"]] = $child["ref_id"];
2015 }
2016 }
2017 return $newRef;
2018 }
2019 // END PATCH WebDAV: Support a copy command in the repository
2020
2021 // Modify list gui for presentation in container
2022 public function modifyItemGUI(
2023 ilObjectListGUI $a_item_list_gui,
2024 array $a_item_data
2025 ): void {
2026 /* not really implemented buildPath does not exist
2027 $lng = $this->lng;
2028
2029 if ($a_show_path) {
2030 $a_item_list_gui->addCustomProperty(
2031 $lng->txt('path'),
2032 ilContainer::buildPath($a_item_data['ref_id'], $this->object->getRefId()),
2033 false,
2034 true
2035 );
2036 }
2037 */
2038 }
2039
2043 public static function _buildPath(
2044 int $a_ref_id,
2045 int $a_course_ref_id
2046 ): string {
2047 global $DIC;
2048
2049 $tree = $DIC->repositoryTree();
2050 $path = "";
2051
2052 $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
2053 $counter = 0;
2054 foreach ($path_arr as $data) {
2055 if ($counter++) {
2056 $path .= " > ";
2057 }
2058 $path .= $data['title'];
2059 }
2060
2061 return $path;
2062 }
2063
2064
2065 public function editStylePropertiesObject(): void
2066 {
2067 $this->content_style_gui
2068 ->redirectToObjectSettings();
2069 }
2070
2071 protected function showContainerPageTabs(): void
2072 {
2073 $ctrl = $this->ctrl;
2074 $tabs = $this->tabs;
2075 $tabs->clearTargets();
2076 $page_gui = new ilContainerPageGUI($this->object->getId());
2077 $tabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($page_gui, "edit"));
2078 }
2079
2081 bool $a_init = true
2082 ): void {
2083 global $DIC;
2084 $tpl = $this->tpl;
2085 $ilToolbar = $this->toolbar;
2086
2087 if ($a_init) {
2088 $this->tpl->setOnScreenMessage('info', $this->lng->txt('webdav_pwd_instruction'));
2089 $this->initFormPasswordInstruction();
2090 }
2091
2092 $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
2093 $href = $uri_builder->getUriToMountInstructionModalByRef($this->object->getRefId());
2094
2095 $this->gui->button(
2096 $this->lng->txt("mount_webfolder"),
2097 "#"
2098 )->onClick("triggerWebDAVModal('$href'); return false;")->toToolbar();
2099
2100 $tpl->setContent($this->form->getHTML());
2101 }
2102
2107 {
2108 $this->form = new ilPropertyFormGUI();
2109 $this->form->setFormAction($this->ctrl->getFormAction($this));
2110
2111 // new password
2112 $ipass = new ilPasswordInputGUI($this->lng->txt("desired_password"), "new_password");
2113 $ipass->setRequired(true);
2114
2115 $this->form->addItem($ipass);
2116 $this->form->addCommandButton("savePassword", $this->lng->txt("save"));
2117 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
2118
2119 $this->form->setTitle($this->lng->txt("chg_ilias_and_webfolder_password"));
2120 $this->form->setFormAction($this->ctrl->getFormAction($this));
2121
2122 return $this->form;
2123 }
2124
2125 protected function savePasswordObject(): void
2126 {
2127 $ilUser = $this->user;
2128
2129 $form = $this->initFormPasswordInstruction();
2130 if ($form->checkInput()) {
2131 $ilUser->resetPassword($this->form->getInput('new_password'));
2132 $this->tpl->setOnScreenMessage('success', $this->lng->txt('webdav_pwd_instruction_success'), true);
2133 $this->showPasswordInstructionObject(false);
2134 return;
2135 }
2136 $form->setValuesByPost();
2137 $this->showPasswordInstructionObject();
2138 }
2139
2143 public function redrawListItemObject(): void
2144 {
2145 $tpl = $this->tpl;
2146
2147 $html = null;
2148
2149 $child_ref_id = $this->std_request->getChildRefId();
2150 $parent_ref_id = $this->std_request->getParentRefId();
2151
2152 $item_data = $this->object->getSubItems(false, false, $child_ref_id);
2153 $container_view = $this->getContentGUI();
2154
2155 // see #41377 (material not redrawn, when not a direct child)
2156 $sess_data = [];
2157 if (isset($this->object->items["sess"])) {
2158 $sess_data = $this->object->items["sess"]; // before #41377
2159 } elseif (ilObject::_lookupType($parent_ref_id, true) === "sess") {
2160 $sess_data[] = [
2161 "obj_id" => ilObject::_lookupObjectId($parent_ref_id)
2162 ]; // added with #41377
2163 }
2164
2165 // list item is session material (not part of "_all"-items - see below)
2166 $event_items = ilEventItems::_getItemsOfContainer($this->object->getRefId());
2167 if (in_array($child_ref_id, $event_items)) {
2168 foreach (($sess_data) as $id) {
2169 $items = ilObjectActivation::getItemsByEvent($id['obj_id']);
2170 foreach ($items as $event_item) {
2171 if ($event_item["child"] == $child_ref_id) {
2172 // sessions
2173 if ($parent_ref_id > 0) {
2174 $event_item["parent"] = $parent_ref_id;
2175 }
2176 $html = $container_view->renderItem($event_item);
2177 }
2178 }
2179 }
2180 }
2181
2182 // "normal" list item
2183 if (!$html) {
2184 foreach (($this->object->items["_all"] ?? []) as $id) {
2185 if ($id["child"] == $child_ref_id) {
2186 $html = $container_view->renderItem($id);
2187 }
2188 }
2189 }
2190
2191 if ($html) {
2192 echo $html;
2193
2194 // we need to add onload code manually (rating, comments, etc.)
2195 echo $tpl->getOnLoadCodeForAsynch();
2196 }
2197
2198 exit;
2199 }
2200
2201 protected function initEditForm(): ilPropertyFormGUI
2202 {
2203 $lng = $this->lng;
2204 $lng->loadLanguageModule($this->object->getType());
2205
2206 $form = new ilPropertyFormGUI();
2207 $form->setFormAction($this->ctrl->getFormAction($this, "update"));
2208 $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
2209
2210 $this->initFormTitleDescription($form);
2211
2212 $this->initEditCustomForm($form);
2213
2214 $form->addCommandButton("update", $this->lng->txt("save"));
2215
2216 return $form;
2217 }
2218
2222 public function initFormTitleDescription(ilPropertyFormGUI $form): void
2223 {
2224 $trans = null;
2225 if ($this->getCreationMode() === false) {
2227 $trans = $this->object->getObjectTranslation();
2228 }
2229 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
2230 $title->setRequired(true);
2231 $title->setSize(min(40, ilObject::TITLE_LENGTH));
2232 $title->setMaxLength(ilObject::TITLE_LENGTH);
2233 $form->addItem($title);
2234
2235 if ($this->getCreationMode() === false && count($trans->getLanguages()) > 1) {
2236 $languages = $this->domain->metadata()->getLOMLanguagesForSelectInputs();
2237 $title->setInfo(
2238 $this->lng->txt("language") . ": " . $languages[$trans->getDefaultLanguage()] .
2239 ' <a href="' . $this->ctrl->getLinkTargetByClass(TranslationGUI::class, "") .
2240 '">&raquo; ' . $this->lng->txt("obj_more_translations") . '</a>'
2241 );
2242
2243 unset($languages);
2244 }
2245 $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
2246 $desc->setRows(2);
2247 $desc->setCols(40);
2248 $desc->setMaxNumOfChars(ilObject::LONG_DESC_LENGTH);
2249 $form->addItem($desc);
2250
2251 if ($this->getCreationMode() === false) {
2252 $title->setValue($trans->getDefaultTitle());
2253 $desc->setValue($trans->getDefaultDescription());
2254 }
2255 }
2256
2260 protected function initSortingForm(
2261 ilPropertyFormGUI $form,
2262 array $a_sorting_settings
2264 $settings = new ilContainerSortingSettings($this->object->getId());
2265 $sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting");
2266
2267 if (in_array(ilContainer::SORT_INHERIT, $a_sorting_settings)) {
2268 $sort_inherit = new ilRadioOption();
2269 $sort_inherit->setTitle(
2270 $this->lng->txt('sort_inherit_prefix') .
2273 $this->object->getId()
2274 )
2275 ) . ') '
2276 );
2277 $sort_inherit->setValue((string) ilContainer::SORT_INHERIT);
2278 $sort_inherit->setInfo($this->lng->txt('sorting_info_inherit'));
2279 $sort->addOption($sort_inherit);
2280 }
2281 if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
2282 $sort_title = new ilRadioOption(
2283 $this->lng->txt('sorting_title_header'),
2285 );
2286 $sort_title->setInfo($this->lng->txt('sorting_info_title'));
2287
2288 $this->initSortingDirectionForm($settings, $sort_title, 'title');
2289 $sort->addOption($sort_title);
2290 }
2291 if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
2292 $sort_activation = new ilRadioOption(
2293 $this->lng->txt('sorting_creation_header'),
2295 );
2296 $sort_activation->setInfo($this->lng->txt('sorting_creation_info'));
2297 $this->initSortingDirectionForm($settings, $sort_activation, 'creation');
2298 $sort->addOption($sort_activation);
2299 }
2300 if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
2301 $sort_activation = new ilRadioOption($this->lng->txt('crs_sort_activation'), (string) ilContainer::SORT_ACTIVATION);
2302 $sort_activation->setInfo($this->lng->txt('crs_sort_timing_info'));
2303 $this->initSortingDirectionForm($settings, $sort_activation, 'activation');
2304 $sort->addOption($sort_activation);
2305 }
2306 if (in_array(ilContainer::SORT_MANUAL, $a_sorting_settings)) {
2307 $sort_manual = new ilRadioOption(
2308 $this->lng->txt('sorting_manual_header'),
2310 );
2311 $sort_manual->setInfo($this->lng->txt('sorting_info_manual'));
2312 $this->initManualSortingOptionForm($settings, $sort_manual, "manual", $a_sorting_settings);
2313 $sort->addOption($sort_manual);
2314 }
2315
2316 // Handle moved containers and there possibly invalid values
2317 if (in_array($settings->getSortMode(), $a_sorting_settings)) {
2318 $sort->setValue((string) $settings->getSortMode());
2319 } else {
2320 $sort->setValue((string) ilContainer::SORT_TITLE);
2321 }
2322 $form->addItem($sort);
2323
2324 return $form;
2325 }
2326
2331 {
2332 $lpres = new ilRadioGroupInputGUI($this->lng->txt('cont_list_presentation'), "list_presentation");
2333
2334 $item_list = new ilRadioOption($this->lng->txt('cont_item_list'), "");
2335 $item_list->setInfo($this->lng->txt('cont_item_list_info'));
2336 $lpres->addOption($item_list);
2337
2338 $tile_view = new ilRadioOption($this->lng->txt('cont_tile_view'), "tile");
2339 $tile_view->setInfo($this->lng->txt('cont_tile_view_info'));
2340 $lpres->addOption($tile_view);
2341
2342 // tile size
2343
2344 $si = new ilRadioGroupInputGUI($this->lng->txt("cont_tile_size"), "tile_size");
2345 foreach ($this->object->getTileSizes() as $key => $txt) {
2346 $op = new ilRadioOption($txt, $key);
2347 $si->addOption($op);
2348 }
2349 $tile_view->addSubItem($si);
2350 $si->setValue(
2351 (string) ((int) ilContainer::_lookupContainerSetting($this->object->getId(), "tile_size"))
2352 );
2353
2354 $lpres->setValue(
2355 ilContainer::_lookupContainerSetting($this->object->getId(), "list_presentation")
2356 );
2357
2358 $form->addItem($lpres);
2359
2360 return $form;
2361 }
2362
2363 protected function saveListPresentation(ilPropertyFormGUI $form): void
2364 {
2365 $val = ($form->getInput('list_presentation') === "tile")
2366 ? "tile"
2367 : "";
2368 ilContainer::_writeContainerSetting($this->object->getId(), "list_presentation", $val);
2370 $this->object->getId(),
2371 "tile_size",
2372 (string) ((int) $form->getInput('tile_size'))
2373 );
2374 }
2375
2379 protected function initSortingDirectionForm(
2380 ilContainerSortingSettings $sorting_settings,
2381 ilRadioOption $element,
2382 string $a_prefix
2383 ): ilRadioOption {
2384 if ($a_prefix === 'manual') {
2385 $txt = $this->lng->txt('sorting_new_items_direction');
2386 } else {
2387 $txt = $this->lng->txt('sorting_direction');
2388 }
2389
2390 $direction = new ilRadioGroupInputGUI($txt, $a_prefix . '_sorting_direction');
2391 $direction->setValue((string) $sorting_settings->getSortDirection());
2392 $direction->setRequired(true);
2393
2394 // asc
2395 $asc = new ilRadioOption(
2396 $this->lng->txt('sorting_asc'),
2398 );
2399 $direction->addOption($asc);
2400
2401 // desc
2402 $desc = new ilRadioOption(
2403 $this->lng->txt('sorting_desc'),
2405 );
2406 $direction->addOption($desc);
2407
2408 $element->addSubItem($direction);
2409
2410 return $element;
2411 }
2412
2418 ilRadioOption $element,
2419 string $a_prefix,
2420 array $a_sorting_settings
2421 ): ilRadioOption {
2422 $position = new ilRadioGroupInputGUI(
2423 $this->lng->txt('sorting_new_items_position'),
2424 $a_prefix . '_new_items_position'
2425 );
2426 $position->setValue((string) $settings->getSortNewItemsPosition());
2427 $position->setRequired(true);
2428
2429 //new items insert on top
2430 $new_top = new ilRadioOption(
2431 $this->lng->txt('sorting_new_items_at_top'),
2433 );
2434
2435 $position->addOption($new_top);
2436
2437 //new items insert at bottom
2438 $new_bottom = new ilRadioOption(
2439 $this->lng->txt('sorting_new_items_at_bottom'),
2441 );
2442
2443 $position->addOption($new_bottom);
2444
2445 $element->addSubItem($position);
2446
2447 $order = new ilRadioGroupInputGUI($this->lng->txt('sorting_new_items_order'), $a_prefix . '_new_items_order');
2448 $order->setValue((string) $settings->getSortNewItemsOrder());
2449 $order->setRequired(true);
2450
2451 if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
2452 //new items sort in alphabetical order
2453 $new_title = new ilRadioOption(
2454 $this->lng->txt('sorting_title_header'),
2456 );
2457
2458 $order->addOption($new_title);
2459 }
2460
2461 if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
2462 //new items sort by creation date
2463 $new_creation = new ilRadioOption(
2464 $this->lng->txt('sorting_creation_header'),
2466 );
2467
2468 $order->addOption($new_creation);
2469 }
2470
2471 if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
2472 //new items by activation
2473 $new_activation = new ilRadioOption(
2474 $this->lng->txt('crs_sort_activation'),
2476 );
2477
2478 $order->addOption($new_activation);
2479 }
2480
2481 $element->addSubItem($order);
2482
2483 $this->initSortingDirectionForm($settings, $element, 'manual');
2484
2485 return $element;
2486 }
2487
2488 protected function saveSortingSettings(ilPropertyFormGUI $form): void
2489 {
2490 $settings = new ilContainerSortingSettings($this->object->getId());
2491 $settings->setSortMode((int) $form->getInput("sorting"));
2492
2493 switch ($form->getInput('sorting')) {
2495 $settings->setSortDirection((int) $form->getInput('title_sorting_direction'));
2496 break;
2498 $settings->setSortDirection((int) $form->getInput('activation_sorting_direction'));
2499 break;
2501 $settings->setSortDirection((int) $form->getInput('creation_sorting_direction'));
2502 break;
2504 $settings->setSortNewItemsPosition($form->getInput('manual_new_items_position'));
2505 $settings->setSortNewItemsOrder($form->getInput('manual_new_items_order'));
2506 $settings->setSortDirection((int) $form->getInput('manual_sorting_direction'));
2507 break;
2508 }
2509
2510 $settings->update();
2511 }
2512
2516 public function trashObject(): void
2517 {
2518 $this->checkPermission("write");
2519 $tpl = $this->tpl;
2520
2521 $this->tabs_gui->activateTab('trash');
2522
2523 $this->lng->loadLanguageModule('cont');
2524 $tpl->setOnScreenMessage('info', $this->lng->txt('cont_trash_general_usage'));
2525
2526 $trash_table = new ilTrashTableGUI($this, 'trash', $this->object->getRefId());
2527 $trash_table->init();
2528 $trash_table->parse();
2529
2530 $trash_table->setFilterCommand('trashApplyFilter');
2531 $trash_table->setResetCommand('trashResetFilter');
2532
2533 $tpl->setContent($trash_table->getHTML());
2534 }
2535
2536 public function trashApplyFilterObject(): void
2537 {
2538 $this->trashHandleFilter(true, false);
2539 }
2540
2541 public function trashResetFilterObject(): void
2542 {
2543 $this->trashHandleFilter(false, true);
2544 }
2545
2546 protected function trashHandleFilter(bool $action_apply, bool $action_reset): void
2547 {
2548 $trash_table = new ilTrashTableGUI($this, 'trash', $this->object->getRefId());
2549 $trash_table->init();
2550 $trash_table->resetOffset();
2551 if ($action_reset) {
2552 $trash_table->resetFilter();
2553 }
2554 if ($action_apply) {
2555 $trash_table->writeFilterToSession();
2556 }
2557 $this->trashObject();
2558 }
2559
2560 public function removeFromSystemObject(): void
2561 {
2562 $this->checkPermission("write");
2563 $ru = new ilRepositoryTrashGUI($this);
2564 $ru->removeObjectsFromSystem($this->std_request->getTrashIds());
2565 $this->ctrl->redirect($this, "trash");
2566 }
2567
2568 protected function restoreToNewLocationObject(?ilPropertyFormGUI $form = null): void
2569 {
2570 $this->tabs_gui->activateTab('trash');
2571
2572 $ru = new ilRepositoryTrashGUI($this);
2573 $ru->restoreToNewLocation();
2574 }
2575
2579 public function undeleteObject(): void
2580 {
2581 $ru = new ilRepositoryTrashGUI($this);
2582 $ru->restoreObjects(
2583 $this->requested_ref_id,
2584 $this->std_request->getTrashIds()
2585 );
2586 $this->ctrl->redirect($this, "trash");
2587 }
2588
2589 public function confirmRemoveFromSystemObject(): void
2590 {
2591 $lng = $this->lng;
2592 $this->checkPermission("write");
2593 if (count($this->std_request->getTrashIds()) == 0) {
2594 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
2595 $this->ctrl->redirect($this, "trash");
2596 }
2597
2598 $ru = new ilRepositoryTrashGUI($this);
2599 $ru->confirmRemoveFromSystemObject($this->std_request->getTrashIds());
2600 }
2601
2602 protected function getTreeSelectorGUI(string $cmd): ilTreeExplorerGUI
2603 {
2604 $exp = new ilRepositorySelectorExplorerGUI($this, "showPasteTree");
2605 // TODO: The study programme 'prg' is not included here, as the
2606 // ilRepositorySelectorExplorerGUI only handles static rules for
2607 // parent-child-relations and not the dynamic relationsships
2608 // required for the SP (see #16909).
2609 $exp->setTypeWhiteList(["root", "cat", "grp", "crs", "fold"]);
2610
2611 // Not all types are allowed in the LearningSequence
2612 // Extend whitelist, if all selected types are possible subojects of LSO
2613 if (in_array($this->clipboard->getCmd(), ["link", "cut"])) {
2614 $lso_types = array_keys($this->obj_definition->getSubObjects('lso'));
2615 $refs = $this->clipboard->getRefIds();
2616 $allow_lso = true;
2617 foreach ($refs as $item_ref_id) {
2618 $type = ilObject::_lookupType($item_ref_id, true);
2619 if (!in_array($type, $lso_types)) {
2620 $allow_lso = false;
2621 }
2622 }
2623 if ($allow_lso) {
2624 $whitelist = $exp->getTypeWhiteList();
2625 $whitelist[] = 'lso';
2626 $exp->setTypeWhiteList($whitelist);
2627 }
2628 }
2629
2630 if ($cmd === "link") {
2631 $exp->setSelectMode("nodes", true);
2632 } else {
2633 $exp->setSelectMode("nodes[]", false);
2634 }
2635 return $exp;
2636 }
2637
2638 public function setSideColumnReturn(): void
2639 {
2640 $this->ctrl->setReturn($this, "");
2641 }
2642
2643 protected function initFilter(): void
2644 {
2645 global $DIC;
2646
2647 if (!$this->object || !ilContainer::_lookupContainerSetting($this->object->getId(), "filter", '0')) {
2648 return;
2649 }
2650
2651 if ($this->isActiveOrdering() || $this->ctrl->getCmd() === "editOrder") {
2652 return;
2653 }
2654
2655 $filter_service = $this->container_filter_service;
2656 $request = $DIC->http()->request();
2657
2658 $filter = $filter_service->util()->getFilterForRefId(
2659 $this->ref_id,
2660 $DIC->ctrl()->getLinkTarget($this, "render", "", true),
2661 $this->isActiveAdministrationPanel()
2662 );
2663
2664 $filter_data = $DIC->uiService()->filter()->getData($filter);
2665
2666 $this->container_user_filter = $filter_service->userFilter($filter_data);
2667 $this->ui_filter = $filter;
2668 }
2669
2670 protected function showContainerFilter(): void
2671 {
2672 global $DIC;
2673 if (!is_null($this->ui_filter)) {
2674 $renderer = $DIC->ui()->renderer();
2675
2676 $main_tpl = $this->tpl;
2677 $main_tpl->setFilter($renderer->render($this->ui_filter));
2678 if ($this->container_user_filter->isEmpty() && !ilContainer::_lookupContainerSetting(
2679 $this->object->getId(),
2680 "filter_show_empty",
2681 '0'
2682 )) {
2683 $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_filter_empty"));
2684 }
2685 }
2686 }
2687
2688 public function getAdminTabs(): void
2689 {
2690 if ($this->checkPermissionBool("visible,read")) {
2691 $this->tabs_gui->addTab(
2692 'view',
2693 $this->lng->txt('view'),
2694 $this->ctrl->getLinkTarget($this, 'view')
2695 );
2696 }
2697
2698 // Always show container trash
2699 $this->tabs_gui->addTab(
2700 'trash',
2701 $this->lng->txt('trash'),
2702 $this->ctrl->getLinkTarget($this, 'trash')
2703 );
2704
2705 if ($this->checkPermissionBool("edit_permission")) {
2706 $this->tabs_gui->addTab(
2707 'perm_settings',
2708 $this->lng->txt('perm_settings'),
2709 $this->ctrl->getLinkTargetByClass(
2710 [
2711 get_class($this),
2712 'ilpermissiongui'
2713 ],
2714 'perm'
2715 )
2716 );
2717 }
2718 }
2719
2720 public function competencesObject(): void
2721 {
2722 $ctrl = $this->ctrl;
2723
2724 $ctrl->redirectByClass(["ilContainerSkillGUI", "ilContSkillPresentationGUI"]);
2725 }
2726}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$renderer
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
Render add new item selector.
Manages items in repository clipboard.
error(string $a_errmsg)
Global event handler.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $a_ext_rc=null, $a_ext_time=null)
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.
Column user interface class.
setAdminCommands(bool $a_admincommands)
setItemPresentationManager(ItemPresentationManager $item_presentation)
setBlockProperty(string $a_block_type, string $a_property, string $a_value)
This function is supposed to be used for block type specific properties, that should be passed to ilB...
static _adjustMovedObjectConditions(int $a_ref_id)
In the moment it is not allowed to create preconditions on objects that are located outside of a cour...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Parent class of all container content GUIs.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
clearObject()
clear clipboard and go back to last object
ILIAS Container InternalGUIService $gui
ilRbacSystem $rbacsystem
afterUpdate()
Post (successful) object update hook.
ilAppEventHandler $app_event_handler
StandardGUIRequest $std_request
ModeManager $mode_manager
ilObjectDefinition $obj_definition
restoreToNewLocationObject(?ilPropertyFormGUI $form=null)
addStandardContainerSubTabs(bool $a_include_view=true)
Add standard container subtabs for view, manage, oderdering and text/media editor link.
ilComponentFactory $component_factory
initFormPasswordInstruction()
Init password form.
ILIAS Container InternalDomainService $domain
modifyItemGUI(ilObjectListGUI $a_item_list_gui, array $a_item_data)
ILIAS Style Content DomainService $content_style_domain
initManualSortingOptionForm(ilContainerSortingSettings $settings, ilRadioOption $element, string $a_prefix, array $a_sorting_settings)
Add manual sorting options.
trashObject()
Show trash content of object.
cutObject()
cut object(s) out from a container and write the information to clipboard @access public
getItemPresentation( $include_empty_blocks=true, ?string $lang=null)
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
initSortingDirectionForm(ilContainerSortingSettings $sorting_settings, ilRadioOption $element, string $a_prefix)
Add sorting direction.
ilContainerUserFilter $container_user_filter
cancelMoveLinkObject()
Cancel move|link empty clipboard and return to parent.
allowBlocksConfigure()
Standard is to allow blocks configuration.
ilPropertyFormGUI $form
trashHandleFilter(bool $action_apply, bool $action_reset)
renderBlockAsynchObject()
render the object
ILIAS Container Content ItemPresentationManager $item_presentation
redrawListItemObject()
Redraw a list item (ajax)
undeleteObject()
Get objects back from trash.
showPasswordInstructionObject(bool $a_init=true)
ilRbacReview $rbacreview
pasteObject()
paste object from clipboard to current place Depending on the chosen command the object(s) are linked...
ilContainerFilterService $container_filter_service
ilErrorHandling $error
ClipboardManager $clipboard
saveListPresentation(ilPropertyFormGUI $form)
getTreeSelectorGUI(string $cmd)
addHeaderRow(ilTemplate $a_tpl, string $a_type, bool $a_show_image=true)
getAdminTabs()
administration tabs show only permissions and trash folder
initListPresentationForm(ilPropertyFormGUI $form)
Add list presentation settings to form.
allowBlocksMoving()
Standard is to allow blocks moving.
copyObject()
Copy object(s) out from a container and write the information to clipboard It is not possible to copy...
setColumnSettings(ilColumnGUI $column_gui)
showPossibleSubObjects()
show possible sub objects (pull down menu)
linkObject()
create an new reference of an object in tree it's like a hard link of unix
ILIAS Style Content GUIService $content_style_gui
cloneNodes(int $srcRef, int $dstRef, array &$mapping, ?string $newName=null)
Recursively clones all nodes of the RBAC tree.
saveSortingSettings(ilPropertyFormGUI $form)
ilObjectDataCache $obj_data_cache
addMessageRow(ilTemplate $a_tpl, string $a_message, string $a_type)
cloneAllObject()
Clone all object Overwritten method for copying container objects.
getTabs()
@abstract overwrite in derived GUI class of your object type
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Container page GUI class.
Container page object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupSortModeFromParentContainer(int $a_obj_id)
static sortModeToString(int $a_sort_mode)
Get string representation of sort mode.
static _getInstance(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
const SORT_DIRECTION_DESC
const SORT_NEW_ITEMS_ORDER_ACTIVATION
const SORT_NEW_ITEMS_ORDER_TITLE
const SORT_NEW_ITEMS_ORDER_CREATION
const SORT_NEW_ITEMS_POSITION_BOTTOM
const SORT_NEW_ITEMS_POSITION_TOP
const SORT_DIRECTION_ASC
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _isFinished(int $a_copy_id)
Error Handling & global info handling.
static _getItemsOfContainer(int $a_ref_id)
static getASCIIFilename(string $a_filename)
special template class to simplify handling of ITX/PEAR
loadLanguageModule(string $a_module)
Load language module.
Component logger with individual log levels by component id.
static showMemberViewSwitch(int $a_ref_id)
static _appendNumberOfCopyToFilename($a_file_name, $nth_copy=null)
Appends the text " - Copy" to a filename in the language of the current user.
static getItemsByEvent(int $event_id)
Get session material / event items.
class ilObjectDataCache
parses the objects.xml it handles the xml-description of all ilias objects
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
ilLanguage $lng
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
const TITLE_LENGTH
const LONG_DESC_LENGTH
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
This class represents a password property in a property form.
This class represents a property form user interface.
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-...
This class represents a property in a property form.
This class represents an option in a radio group.
Class ilRbacAdmin Core functions for role based access control.
static add(int $action, int $ref_id, array $diff, bool $source_ref_id=false)
static gatherFaPa(int $ref_id, array $role_ids, bool $add_action=false)
const LINK_OBJECT
static isActive()
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Explorer for selecting repository items.
Repository GUI Utilities.
ILIAS Setting Class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
This class represents a text area property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Explorer class that works on tree objects (Services/Tree)
Util class various functions, usage as namespace.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
const ANONYMOUS_USER_ID
Definition: constants.php:27
exit
$requested_ref_id
Definition: feed.php:40
This describes a standard filter.
Definition: Standard.php:27
$ref_id
Definition: ltiauth.php:66
$log
Definition: ltiresult.php:34
$path
Definition: ltiservices.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form(?array $class_path, string $cmd, string $submit_caption="")
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:31
global $ilSetting
Definition: privfeed.php:31
$ilErr
Definition: raiseError.php:33
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26
$counter
$GLOBALS["DIC"]
Definition: wac.php:54
$_COOKIE[session_name()]
Definition: xapitoken.php:52