ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 $toolbar = new ilToolbarGUI();
606 $this->ctrl->setParameter($this, "type", "");
607 $this->ctrl->setParameter($this, "item_ref_id", "");
608
609 // #11843
610 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
611
612 $toolbar->addFormButton(
613 $this->lng->txt('download_selected_items'),
614 'download'
615 );
616
617 $main_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 foreach ($ids as $ref_id) {
1146 if (!in_array(ilObject::_lookupType($ref_id, true), ["crs", "grp", "fold", "file"])) {
1147 $this->lng->loadLanguageModule("cont");
1148 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("cont_only_crs_grp_fold_download"), true);
1149 $this->ctrl->redirect($this, "");
1150 }
1151 }
1152
1153 $download_job = new ilDownloadContainerFilesBackgroundTask(
1154 $GLOBALS['DIC']->user()->getId(),
1155 $ids,
1156 $initiated_by_folder_action
1157 );
1158
1159 $download_job->setBucketTitle($this->getBucketTitle());
1160 if ($download_job->run()) {
1161 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_bt_download_started'), true);
1162 }
1163 $GLOBALS['DIC']->ctrl()->redirect($this);
1164 }
1165
1166 public function getBucketTitle(): string
1167 {
1168 return ilFileUtils::getASCIIFilename($this->object->getTitle());
1169 }
1170
1175 public function linkObject(): void
1176 {
1177 $rbacsystem = $this->rbacsystem;
1178 $ilCtrl = $this->ctrl;
1179 $ilErr = $this->error;
1180
1181 $no_cut = [];
1182 $no_link = [];
1183
1184 $ids = $this->std_request->getSelectedIds();
1185
1186 if (count($ids) === 0) {
1187 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1188 $this->ctrl->redirect($this, "");
1189 }
1190
1191 // CHECK ACCESS
1192 foreach ($ids as $ref_id) {
1193 if (!$rbacsystem->checkAccess('delete', $ref_id)) {
1194 $no_cut[] = $ref_id;
1195 }
1196
1198
1199 if (!$this->obj_definition->allowLink($object->getType())) {
1200 $no_link[] = $object->getType();
1201 }
1202 }
1203
1204 // NO ACCESS
1205 if ($no_cut !== []) {
1206 $this->tpl->setOnScreenMessage(
1207 'failure',
1208 $this->lng->txt("msg_no_perm_link") . " " . implode(',', $no_cut),
1209 true
1210 );
1211 $this->ctrl->redirect($this, "");
1212 }
1213
1214 if ($no_link !== []) {
1215 //#12203
1216 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_obj_no_link'), true);
1217 $this->ctrl->redirect($this, "");
1218 }
1219
1220 $this->clipboard->setParent($this->requested_ref_id);
1221 $this->clipboard->setCmd($ilCtrl->getCmd());
1222 $this->clipboard->setRefIds($ids);
1223
1224 $suffix = 'p';
1225 if (count($this->clipboard->getRefIds()) === 1) {
1226 $suffix = 's';
1227 }
1228 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_link_clipboard_" . $suffix), true);
1229
1230 $this->initAndDisplayLinkIntoMultipleObjectsObject();
1231 }
1232
1236 public function clearObject(): void
1237 {
1238 $this->clipboard->clear();
1239
1240 //var_dump($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));
1241
1242 // only redirect if clipboard was cleared
1243 if ($this->ctrl->getCmd() === "clear") {
1244 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_clear_clipboard"), true);
1245 // fixed mantis 0018474: Clear Clipboard redirects to Subtab View, instead of Subtab "Edit Multiple"
1246 $this->ctrl->redirect($this, 'render');
1247 }
1248 }
1249
1251 {
1252 $rbacsystem = $this->rbacsystem;
1253 $rbacadmin = $this->rbacadmin;
1254 $rbacreview = $this->rbacreview;
1255 $ilLog = $this->log;
1256 $tree = $this->tree;
1257 $ilObjDataCache = $this->obj_data_cache;
1258 $ilUser = $this->user;
1259 $ilErr = $this->error;
1260 $lng = $this->lng;
1261 $ui = $this->ui;
1262
1263 $exists = [];
1264 $is_child = [];
1265 $not_allowed_subobject = [];
1266 $no_paste = [];
1267
1268 $command = $this->clipboard->getCmd();
1269 if (!in_array($command, ['cut', 'link', 'copy'])) {
1270 $message = __METHOD__ . ": cmd was neither 'cut', 'link' nor 'copy'; may be a hack attempt!";
1271 $ilErr->raiseError($message, $ilErr->WARNING);
1272 }
1273
1274 $nodes = $this->std_request->getNodes();
1275
1276 if (count($nodes) === 0) {
1277 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_at_least_one_object'));
1278 switch ($command) {
1279 case 'link':
1280 case 'copy':
1281 case 'cut':
1282 $this->showPasteTreeObject();
1283 break;
1284 }
1285 return;
1286 }
1287
1288 // this loop does all checks
1289 $folder_objects_cache = [];
1290 foreach ($this->clipboard->getRefIds() as $ref_id) {
1292 $current_parent_id = $tree->getParentId($obj_data->getRefId());
1293
1294 foreach ($nodes as $folder_ref_id) {
1295 if (!array_key_exists($folder_ref_id, $folder_objects_cache)) {
1296 $folder_objects_cache[$folder_ref_id] = ilObjectFactory::getInstanceByRefId($folder_ref_id);
1297 }
1298
1299 // CHECK ACCESS
1300 if (!$rbacsystem->checkAccess('create', $folder_ref_id, $obj_data->getType())) {
1301 $no_paste[] = sprintf(
1302 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
1303 $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']',
1304 $folder_objects_cache[$folder_ref_id]->getTitle(
1305 ) . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']'
1306 );
1307 }
1308
1309 // CHECK IF REFERENCE ALREADY EXISTS
1310 if ($folder_ref_id == $current_parent_id) {
1311 $exists[] = sprintf(
1312 $this->lng->txt('msg_obj_exists_in_folder'),
1313 $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']',
1314 $folder_objects_cache[$folder_ref_id]->getTitle(
1315 ) . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']'
1316 );
1317 }
1318
1319 // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
1320 if ($ref_id == $folder_ref_id || $tree->isGrandChild($ref_id, $folder_ref_id)) {
1321 $is_child[] = sprintf(
1322 $this->lng->txt('msg_paste_object_not_in_itself'),
1323 $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']'
1324 );
1325 }
1326
1327 // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
1328 if (!array_key_exists(
1329 $obj_data->getType(),
1330 $folder_objects_cache[$folder_ref_id]->getPossibleSubObjects()
1331 )) {
1332 $not_allowed_subobject[] = sprintf(
1333 $this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
1334 $folder_objects_cache[$folder_ref_id]->getTitle(
1335 ) . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']',
1336 $lng->txt('obj_' . $obj_data->getType())
1337 );
1338 }
1339 }
1340 }
1341
1343 // process checking results
1344 $error = "";
1345 if ($command !== "copy" && count($exists)) {
1346 $error .= implode('<br />', $exists);
1347 }
1348
1349 if (count($is_child)) {
1350 $error .= $error !== '' ? '<br />' : '';
1351 $error .= implode('<br />', $is_child);
1352 }
1353
1354 if (count($not_allowed_subobject)) {
1355 $error .= $error !== '' ? '<br />' : '';
1356 $error .= implode('<br />', $not_allowed_subobject);
1357 }
1358
1359 if (count($no_paste)) {
1360 $error .= $error !== '' ? '<br />' : '';
1361 $error .= implode('<br />', $no_paste);
1362 }
1363
1364 if ($error !== '') {
1365 $this->tpl->setOnScreenMessage('failure', $error);
1366 switch ($command) {
1367 case 'link':
1368 case 'copy':
1369 case 'cut':
1370 $this->showPasteTreeObject();
1371 break;
1372 }
1373 return;
1374 }
1375
1376 // log pasteObject call
1377 $ilLog->write(__METHOD__ . ", cmd: " . $command);
1378
1380 // everything ok: now paste the objects to new location
1381
1382 // to prevent multiple actions via back/reload button
1383 $ref_ids = $this->clipboard->getRefIds();
1384 $this->clipboard->clear();
1385
1386
1387 // process COPY command
1388 if ($command === 'copy') {
1389 foreach ($nodes as $folder_ref_id) {
1390 foreach ($ref_ids as $ref_id) {
1391 $revIdMapping = [];
1392
1393 $oldNode_data = $tree->getNodeData($ref_id);
1394 if ($oldNode_data['parent'] == $folder_ref_id) {
1395 $newTitle = ilObjFileAccess::_appendNumberOfCopyToFilename($oldNode_data['title'], null);
1396 $newRef = $this->cloneNodes($ref_id, $folder_ref_id, $refIdMapping, $newTitle);
1397 } else {
1398 $newRef = $this->cloneNodes($ref_id, $folder_ref_id, $refIdMapping, null);
1399 }
1400
1401 // BEGIN ChangeEvent: Record copy event.
1402 $old_parent_data = $tree->getParentNodeData($ref_id);
1403 $newNode_data = $tree->getNodeData($newRef);
1405 $oldNode_data['type'],
1406 $ref_id,
1407 $oldNode_data['obj_id'],
1408 $ilUser->getId()
1409 );
1411 $newNode_data['obj_id'],
1412 $ilUser->getId(),
1413 'add',
1414 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1415 );
1416 // END PATCH ChangeEvent: Record cut event.
1417 }
1418 }
1419
1420 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_cloned'), true);
1421 } // END COPY
1422
1423 // process CUT command
1424 if ($command === 'cut') {
1425 foreach ($nodes as $folder_ref_id) {
1426 foreach ($ref_ids as $ref_id) {
1427 // Store old parent
1428 $old_parent = $tree->getParentId($ref_id);
1429 $tree->moveTree($ref_id, $folder_ref_id);
1430 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1431
1433 $availability = new ilObjectActivation();
1434 $availability->read($ref_id);
1435 $availability->update($ref_id, $folder_ref_id);
1436
1437 // BEGIN ChangeEvent: Record cut event.
1438 $node_data = $tree->getNodeData($ref_id);
1439 $old_parent_data = $tree->getNodeData($old_parent);
1441 $node_data['obj_id'],
1442 $ilUser->getId(),
1443 'remove',
1444 $old_parent_data['obj_id']
1445 );
1447 $node_data['obj_id'],
1448 $ilUser->getId(),
1449 'add',
1450 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1451 );
1452 // END PATCH ChangeEvent: Record cut event.
1453 }
1454
1455 // prevent multiple iterations for cut cmommand
1456 break;
1457 }
1458
1459 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_cut_copied'), true);
1460 } // END CUT
1461
1462 // process LINK command
1463 if ($command === 'link') {
1464 $subnodes = [];
1465 $linked_to_folders = [];
1466
1467 $rbac_log_active = ilRbacLog::isActive();
1468
1469 foreach ($nodes as $folder_ref_id) {
1470 $linked_to_folders[$folder_ref_id] = $ilObjDataCache->lookupTitle(
1471 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1472 );
1473
1474 foreach ($ref_ids as $ref_id) {
1475 // get node data
1476 $top_node = $tree->getNodeData($ref_id);
1477
1478 // get subnodes of top nodes
1479 $subnodes[$ref_id] = $tree->getSubTree($top_node);
1480 }
1481
1482 // now move all subtrees to new location
1483 foreach ($subnodes as $key => $subnode) {
1484 // first paste top_node....
1485 $obj_data = ilObjectFactory::getInstanceByRefId($key);
1486 $new_ref_id = $obj_data->createReference();
1487 $obj_data->putInTree($folder_ref_id);
1488 $obj_data->setPermissions($folder_ref_id);
1489
1490 // rbac log
1491 if ($rbac_log_active) {
1492 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, false);
1493 $rbac_log = ilRbacLog::gatherFaPa($new_ref_id, array_keys($rbac_log_roles), true);
1494 ilRbacLog::add(ilRbacLog::LINK_OBJECT, $new_ref_id, $rbac_log, $key);
1495 }
1496
1497 // BEGIN ChangeEvent: Record link event.
1498 $node_data = $tree->getNodeData($new_ref_id);
1500 $node_data['obj_id'],
1501 $ilUser->getId(),
1502 'add',
1503 $ilObjDataCache->lookupObjId((int) $folder_ref_id)
1504 );
1505 // END PATCH ChangeEvent: Record link event.
1506 }
1507
1508 $ilLog->write(__METHOD__ . ', link finished');
1509 }
1510
1511 $links = [];
1512 if (count($linked_to_folders)) {
1513 foreach ($linked_to_folders as $ref_id => $title) {
1514 $links[] = $ui->factory()->link()->standard($title, ilLink::_getLink($ref_id));
1515 }
1516 }
1517
1518 $suffix = 'p';
1519 if (count($ref_ids) === 1) {
1520 $suffix = 's';
1521 }
1522
1523 $mbox = $ui->factory()->messageBox()->success(
1524 $this->lng->txt('mgs_objects_linked_to_the_following_folders_' . $suffix)
1525 )
1526 ->withLinks($links);
1527
1528 $this->tpl->setOnScreenMessage('success', $ui->renderer()->render($mbox), true);
1529 } // END LINK
1530
1531 // clear clipboard
1532 $this->clearObject();
1533
1534 $this->ctrl->returnToParent($this);
1535 }
1536
1538 {
1539 $this->showPasteTreeObject();
1540 }
1541
1542 public function showPasteTreeObject(): void
1543 {
1544 $ilTabs = $this->tabs;
1545 $ilErr = $this->error;
1546
1547 $ilTabs->setTabActive('view_content');
1548
1549 if (!in_array($this->clipboard->getCmd(), ['link', 'copy', 'cut'])) {
1550 $message = __METHOD__ . ": Unknown action.";
1551 $ilErr->raiseError($message, $ilErr->WARNING);
1552 }
1553 $cmd = $this->clipboard->getCmd();
1554
1555 //
1556 $exp = $this->getTreeSelectorGUI($cmd);
1557 if ($exp->handleCommand()) {
1558 return;
1559 }
1560 $output = $exp->getHTML();
1561
1562 $txt_var = ($cmd === "copy")
1563 ? "copy"
1564 : "paste";
1565
1566 // toolbars
1567 $t = new ilToolbarGUI();
1568 $t->setFormAction($this->ctrl->getFormAction($this, "performPasteIntoMultipleObjects"));
1569
1570 $this->gui->button(
1571 $this->lng->txt($txt_var),
1572 "performPasteIntoMultipleObjects"
1573 )->submit()->toToolbar(true, $t);
1574
1575 $t->addSeparator();
1576 $this->lng->loadLanguageModule('obj');
1577 $t->addFormButton($this->lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard");
1578
1579 $t->addFormButton($this->lng->txt("cancel"), "cancelMoveLink");
1580 $t->setCloseFormTag(false);
1581 $t->setLeadingImage(ilUtil::getImagePath("nav/arrow_upright.svg"), " ");
1582 $output = $t->getHTML() . $output;
1583 $t->setLeadingImage(ilUtil::getImagePath("nav/arrow_downright.svg"), " ");
1584 $t->setCloseFormTag(true);
1585 $t->setOpenFormTag(false);
1586 $output .= "<br />" . $t->getHTML();
1587
1588 $this->tpl->setContent($output);
1589 }
1590
1595 public function cancelMoveLinkObject(): void
1596 {
1597 $ilCtrl = $this->ctrl;
1598
1599 $this->clipboard->clear();
1600 $ilCtrl->returnToParent($this);
1601 }
1602
1603 public function keepObjectsInClipboardObject(): void
1604 {
1605 $ilCtrl = $this->ctrl;
1606
1607 $this->tpl->setOnScreenMessage('success', $this->lng->txt("obj_inserted_clipboard"), true);
1608 $ilCtrl->returnToParent($this);
1609 }
1610
1612 {
1613 $this->showPasteTreeObject();
1614 }
1615
1617 {
1618 $this->showPasteTreeObject();
1619 }
1620
1625 public function pasteObject(): void
1626 {
1627 $rbacsystem = $this->rbacsystem;
1628 $rbacadmin = $this->rbacadmin;
1629 $ilLog = $this->log;
1630 $tree = $this->tree;
1631 $ilUser = $this->user;
1632 $ilCtrl = $this->ctrl;
1633 $ilErr = $this->error;
1634
1635 $exists = [];
1636 $no_paste = [];
1637 $is_child = [];
1638 $not_allowed_subobject = [];
1639
1640
1641 if (!in_array($this->clipboard->getCmd(), ["cut", "link", "copy"])) {
1642 $message = get_class(
1643 $this
1644 ) . "::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
1645 $ilErr->raiseError($message, $ilErr->WARNING);
1646 }
1647
1648 // this loop does all checks
1649 foreach ($this->clipboard->getRefIds() as $ref_id) {
1651
1652 // CHECK ACCESS
1653 if (!$rbacsystem->checkAccess('create', $this->object->getRefId(), $obj_data->getType())) {
1654 $no_paste[] = $ref_id;
1655 $no_paste_titles[] = $obj_data->getTitle();
1656 }
1657
1658 // CHECK IF REFERENCE ALREADY EXISTS
1659 if ($this->object->getRefId() === $this->tree->getParentId($obj_data->getRefId())) {
1660 $exists[] = $ref_id;
1661 break;
1662 }
1663
1664 // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
1665 if ($this->tree->isGrandChild($ref_id, $this->object->getRefId())) {
1667 }
1668
1669 if ($ref_id == $this->object->getRefId()) {
1671 }
1672
1673 // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
1674 $obj_type = $obj_data->getType();
1675
1676 if (!array_key_exists($obj_type, $this->object->getPossibleSubObjects())) {
1677 $not_allowed_subobject[] = $obj_data->getType();
1678 }
1679 }
1680
1682 // process checking results
1683 // BEGIN WebDAV: Copying an object into the same container is allowed
1684 if (count($exists) > 0 && $this->clipboard->getCmd() !== "copy") {
1685 // END WebDAV: Copying an object into the same container is allowed
1686 $ilErr->raiseError($this->lng->txt("msg_obj_exists"), $ilErr->MESSAGE);
1687 }
1688
1689 if (count($is_child) > 0) {
1690 $ilErr->raiseError(
1691 $this->lng->txt("msg_not_in_itself") . " " . implode(',', $is_child),
1692 $ilErr->MESSAGE
1693 );
1694 }
1695
1696 if (count($not_allowed_subobject) > 0) {
1697 $ilErr->raiseError(
1698 $this->lng->txt("msg_may_not_contain") . " " . implode(',', $not_allowed_subobject),
1699 $ilErr->MESSAGE
1700 );
1701 }
1702
1703 if (count($no_paste) > 0) {
1704 $ilErr->raiseError(
1705 $this->lng->txt("msg_no_perm_paste") . " " .
1706 implode(',', $no_paste),
1707 $ilErr->MESSAGE
1708 );
1709 }
1710
1711 // log pasteObject call
1712 $ilLog->write("ilObjectGUI::pasteObject(), cmd: " . $this->clipboard->getCmd());
1713
1715 // everything ok: now paste the objects to new location
1716
1717 // to prevent multiple actions via back/reload button
1718 $ref_ids = $this->clipboard->getRefIds();
1719
1720 // save cmd for correct message output after clearing the clipboard
1721 $last_cmd = $this->clipboard->getCmd();
1722
1723 // BEGIN WebDAV: Support a copy command in the repository
1724 // process COPY command
1725 if ($this->clipboard->getCmd() === "copy") {
1726 $this->clipboard->clear();
1727
1728 // new implementation, redirects to ilObjectCopyGUI
1729 $ilCtrl->setParameterByClass("ilobjectcopygui", "target", $this->object->getRefId());
1730 if (count($ref_ids) === 1) {
1731 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_id", $ref_ids[0]);
1732 } else {
1733 $ilCtrl->setParameterByClass("ilobjectcopygui", "source_ids", implode("_", $ref_ids));
1734 }
1735 $ilCtrl->redirectByClass("ilobjectcopygui", "saveTarget");
1736
1737 $ilLog->write("ilObjectGUI::pasteObject(), copy finished");
1738 }
1739 // END WebDAV: Support a Copy command in the repository
1740
1741 // process CUT command
1742 if ($this->clipboard->getCmd() === "cut") {
1743 foreach ($ref_ids as $ref_id) {
1744 // Store old parent
1745 $old_parent = $tree->getParentId($ref_id);
1746 $this->tree->moveTree($ref_id, $this->object->getRefId());
1747 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1748
1750 $availability = new ilObjectActivation();
1751 $availability->read($ref_id);
1752 $availability->update($ref_id, $this->object->getRefId());
1753
1754 // BEGIN ChangeEvent: Record cut event.
1755 $node_data = $tree->getNodeData($ref_id);
1756 $old_parent_data = $tree->getNodeData($old_parent);
1758 $node_data['obj_id'],
1759 $ilUser->getId(),
1760 'remove',
1761 $old_parent_data['obj_id']
1762 );
1764 $node_data['obj_id'],
1765 $ilUser->getId(),
1766 'add',
1767 $this->object->getId()
1768 );
1769 // END PATCH ChangeEvent: Record cut event.
1770 }
1771 } // END CUT
1772
1773 // process LINK command
1774 $ref_id = 0;
1775 $subnodes = [];
1776 if ($this->clipboard->getCmd() === "link") {
1777 foreach ($ref_ids as $ref_id) {
1778 // get node data
1779 $top_node = $this->tree->getNodeData($ref_id);
1780
1781 // get subnodes of top nodes
1782 $subnodes[$ref_id] = $this->tree->getSubTree($top_node);
1783 }
1784 // now move all subtrees to new location
1785 foreach ($subnodes as $key => $subnode) {
1786 // first paste top_node....
1787 $obj_data = ilObjectFactory::getInstanceByRefId($key);
1788 $new_ref_id = $obj_data->createReference();
1789 $obj_data->putInTree($this->requested_ref_id);
1790 $obj_data->setPermissions($this->requested_ref_id);
1791
1792 // BEGIN ChangeEvent: Record link event.
1793 $node_data = $tree->getNodeData($new_ref_id);
1795 $node_data['obj_id'],
1796 $ilUser->getId(),
1797 'add',
1798 $this->object->getId()
1799 );
1800 // END PATCH ChangeEvent: Record link event.
1801 }
1802
1803 $ilLog->write("ilObjectGUI::pasteObject(), link finished");
1804 } // END LINK
1805
1806
1807 // clear clipboard
1808 $this->clearObject();
1809
1810 if ($last_cmd === "cut") {
1811 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_cut_copied"), true);
1812 } // BEGIN WebDAV: Support a copy command in repository
1813 elseif ($last_cmd === "copy") {
1814 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_cloned"), true);
1815 } elseif ($last_cmd === 'link') {
1816 // END WebDAV: Support copy command in repository
1817 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_linked"), true);
1818 }
1819
1820 $this->ctrl->returnToParent($this);
1821 }
1822
1823 // show clipboard
1824 public function clipboardObject(): void
1825 {
1826 $ilErr = $this->error;
1827 $ilLog = $this->log;
1828 $ilTabs = $this->tabs;
1829 $tpl = $this->tpl;
1830 $ilToolbar = $this->toolbar;
1831 $ilCtrl = $this->ctrl;
1832 $lng = $this->lng;
1833
1834 $ilTabs->activateTab("clipboard");
1835
1836 // function should not be called if clipboard is empty
1837 if (!$this->clipboard->hasEntries()) {
1838 $message = sprintf('%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
1839 $ilLog->write($message, $ilLog->FATAL);
1840 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
1841 }
1842
1843 $data = [];
1844 foreach ($this->clipboard->getRefIds() as $ref_id) {
1845 if (!$tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id, false)) {
1846 continue;
1847 }
1848
1849 $data[] = [
1850 "type" => $tmp_obj->getType(),
1851 "type_txt" => $this->lng->txt("obj_" . $tmp_obj->getType()),
1852 "title" => $tmp_obj->getTitle(),
1853 "cmd" => ($this->clipboard->getCmd() === "cut") ? $this->lng->txt("move") : $this->lng->txt(
1854 $this->clipboard->getCmd()
1855 ),
1856 "ref_id" => $ref_id,
1857 "obj_id" => $tmp_obj->getId()
1858 ];
1859
1860 unset($tmp_obj);
1861 }
1862
1863 $tab = new ilObjClipboardTableGUI($this, "clipboard");
1864 $tab->setData($data);
1865 $tpl->setContent($tab->getHTML());
1866
1867 if (count($data) > 0) {
1868 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1869 $ilToolbar->addFormButton(
1870 $lng->txt("insert_object_here"),
1871 "paste"
1872 );
1873 $ilToolbar->addFormButton(
1874 $lng->txt("clear_clipboard"),
1875 "clear"
1876 );
1877 }
1878 }
1879
1880 public function isActiveAdministrationPanel(): bool
1881 {
1882 // #10081
1883 if ($this->object->getRefId() &&
1884 !$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
1885 return false;
1886 }
1887
1888 return $this->getModeManager()->isAdminMode();
1889 }
1890
1891 public function setColumnSettings(ilColumnGUI $column_gui): void
1892 {
1893 $ilAccess = $this->access;
1894 parent::setColumnSettings($column_gui);
1895
1896 $column_gui->setItemPresentationManager(
1897 $this->item_presentation
1898 );
1899
1900 //if ($ilAccess->checkAccess("write", "", $this->object->getRefId())
1901 // && $this->allowBlocksConfigure())
1902 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1903 $column_gui->setBlockProperty("news", "settings", '1');
1904 //$column_gui->setBlockProperty("news", "public_notifications_option", true);
1905 $column_gui->setBlockProperty("news", "default_visibility_option", '1');
1906 $column_gui->setBlockProperty("news", "hide_news_block_option", '1');
1907 }
1908
1909 if ($this->isActiveAdministrationPanel()) {
1910 $column_gui->setAdminCommands(true);
1911 }
1912 }
1913
1917 public function allowBlocksMoving(): bool
1918 {
1919 return true;
1920 }
1921
1925 public function allowBlocksConfigure(): bool
1926 {
1927 return true;
1928 }
1929
1930
1935 public function cloneAllObject(): void
1936 {
1937 $ilCtrl = $this->ctrl;
1938
1939 $ilAccess = $this->access;
1940 $ilErr = $this->error;
1941 $rbacsystem = $this->rbacsystem;
1942
1943 $new_type = $this->std_request->getNewType();
1945 $clone_source = $this->std_request->getCloneSource();
1946
1947 if (!$rbacsystem->checkAccess('create', $ref_id, $new_type)) {
1948 $ilErr->raiseError($this->lng->txt('permission_denied'));
1949 }
1950 if (!$clone_source) {
1951 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1952 $this->createObject();
1953 return;
1954 }
1955 if (!$ilAccess->checkAccess('write', '', $clone_source, $new_type)) {
1956 $ilErr->raiseError($this->lng->txt('permission_denied'));
1957 }
1958
1959 $options = $this->std_request->getCopyOptions();
1960 $orig = ilObjectFactory::getInstanceByRefId($clone_source);
1961 $result = $orig->cloneAllObject(
1962 $_COOKIE[session_name()],
1963 $_COOKIE['ilClientId'],
1964 $new_type,
1965 $ref_id,
1966 $clone_source,
1967 $options
1968 );
1969
1970 if (ilCopyWizardOptions::_isFinished($result['copy_id'])) {
1971 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_duplicated"), true);
1972 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $result['ref_id']);
1973 } else {
1974 $this->tpl->setOnScreenMessage('info', $this->lng->txt("object_copy_in_progress"), true);
1975 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
1976 }
1977 $ilCtrl->redirectByClass("ilrepositorygui", "");
1978 }
1979
1980 public function saveSortingObject(): void
1981 {
1982 $sorting = ilContainerSorting::_getInstance($this->object->getId());
1983
1984 // Allow comma
1985 $positions = $this->std_request->getPositions();
1986 $sorting->savePost($positions);
1987 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cntr_saved_sorting'), true);
1988 $this->ctrl->redirect($this, "editOrder");
1989 }
1990
1991 // BEGIN WebDAV: Support a copy command in the repository
1992
1996 public function cloneNodes(
1997 int $srcRef,
1998 int $dstRef,
1999 array &$mapping,
2000 ?string $newName = null
2001 ): int {
2002 $tree = $this->tree;
2003
2004 // clone the source node
2005 $srcObj = ilObjectFactory::getInstanceByRefId($srcRef);
2006 $newRef = $srcObj->cloneObject($dstRef)->getRefId();
2007
2008 // We must immediately apply a new name to the object, to
2009 // prevent confusion of WebDAV clients about having two objects with identical
2010 // name in the repository.
2011 if (!is_null($newName)) {
2012 $newObj = ilObjectFactory::getInstanceByRefId($newRef);
2013 $newObj->setTitle($newName);
2014 $newObj->update();
2015 unset($newObj);
2016 }
2017 unset($srcObj);
2018 $mapping[$newRef] = $srcRef;
2019
2020 // clone all children of the source node
2021 $children = $tree->getChilds($srcRef);
2022 foreach ($tree->getChilds($srcRef) as $child) {
2023 // Don't clone role folders, because it does not make sense to clone local roles
2024 // FIXME - Maybe it does make sense (?)
2025 if ($child["type"] !== 'rolf') {
2026 $this->cloneNodes($child["ref_id"], $newRef, $mapping);
2027 } elseif (count($rolf = $tree->getChildsByType($newRef, "rolf"))) {
2028 $mapping[$rolf[0]["ref_id"]] = $child["ref_id"];
2029 }
2030 }
2031 return $newRef;
2032 }
2033 // END PATCH WebDAV: Support a copy command in the repository
2034
2035 // Modify list gui for presentation in container
2036 public function modifyItemGUI(
2037 ilObjectListGUI $a_item_list_gui,
2038 array $a_item_data
2039 ): void {
2040 /* not really implemented buildPath does not exist
2041 $lng = $this->lng;
2042
2043 if ($a_show_path) {
2044 $a_item_list_gui->addCustomProperty(
2045 $lng->txt('path'),
2046 ilContainer::buildPath($a_item_data['ref_id'], $this->object->getRefId()),
2047 false,
2048 true
2049 );
2050 }
2051 */
2052 }
2053
2057 public static function _buildPath(
2058 int $a_ref_id,
2059 int $a_course_ref_id
2060 ): string {
2061 global $DIC;
2062
2063 $tree = $DIC->repositoryTree();
2064 $path = "";
2065
2066 $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
2067 $counter = 0;
2068 foreach ($path_arr as $data) {
2069 if ($counter++) {
2070 $path .= " > ";
2071 }
2072 $path .= $data['title'];
2073 }
2074
2075 return $path;
2076 }
2077
2078
2079 public function editStylePropertiesObject(): void
2080 {
2081 $this->content_style_gui
2082 ->redirectToObjectSettings();
2083 }
2084
2085 protected function showContainerPageTabs(): void
2086 {
2087 $ctrl = $this->ctrl;
2088 $tabs = $this->tabs;
2089 $tabs->clearTargets();
2090 $page_gui = new ilContainerPageGUI($this->object->getId());
2091 $tabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($page_gui, "edit"));
2092 }
2093
2094 protected function showPasswordInstructionObject(
2095 bool $a_init = true
2096 ): void {
2097 global $DIC;
2098 $tpl = $this->tpl;
2099 $ilToolbar = $this->toolbar;
2100
2101 if ($a_init) {
2102 $this->tpl->setOnScreenMessage('info', $this->lng->txt('webdav_pwd_instruction'));
2103 $this->initFormPasswordInstruction();
2104 }
2105
2106 global $DIC;
2108 $webdav = $DIC[ILIAS\WebDAV\Environment::class];
2109 $href = $webdav->getUriToMountInstructionModalByRef($this->object->getRefId());
2110
2111 $this->gui->button(
2112 $this->lng->txt("mount_webfolder"),
2113 "#"
2114 )->onClick("triggerWebDAVModal('$href'); return false;")->toToolbar();
2115
2116 $tpl->setContent($this->form->getHTML());
2117 }
2118
2123 {
2124 $this->form = new ilPropertyFormGUI();
2125 $this->form->setFormAction($this->ctrl->getFormAction($this));
2126
2127 // new password
2128 $ipass = new ilPasswordInputGUI($this->lng->txt("desired_password"), "new_password");
2129 $ipass->setRequired(true);
2130
2131 $this->form->addItem($ipass);
2132 $this->form->addCommandButton("savePassword", $this->lng->txt("save"));
2133 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
2134
2135 $this->form->setTitle($this->lng->txt("chg_ilias_and_webfolder_password"));
2136 $this->form->setFormAction($this->ctrl->getFormAction($this));
2137
2138 return $this->form;
2139 }
2140
2141 protected function savePasswordObject(): void
2142 {
2143 $ilUser = $this->user;
2144
2145 $form = $this->initFormPasswordInstruction();
2146 if ($form->checkInput()) {
2147 $ilUser->resetPassword($this->form->getInput('new_password'));
2148 $this->tpl->setOnScreenMessage('success', $this->lng->txt('webdav_pwd_instruction_success'), true);
2149 $this->showPasswordInstructionObject(false);
2150 return;
2151 }
2152 $form->setValuesByPost();
2153 $this->showPasswordInstructionObject();
2154 }
2155
2159 public function redrawListItemObject(): void
2160 {
2161 $tpl = $this->tpl;
2162
2163 $html = null;
2164
2165 $child_ref_id = $this->std_request->getChildRefId();
2166 $parent_ref_id = $this->std_request->getParentRefId();
2167
2168 $item_data = $this->object->getSubItems(false, false, $child_ref_id);
2169 $container_view = $this->getContentGUI();
2170
2171 // see #41377 (material not redrawn, when not a direct child)
2172 $sess_data = [];
2173 if (isset($this->object->items["sess"])) {
2174 $sess_data = $this->object->items["sess"]; // before #41377
2175 } elseif (ilObject::_lookupType($parent_ref_id, true) === "sess") {
2176 $sess_data[] = [
2177 "obj_id" => ilObject::_lookupObjectId($parent_ref_id)
2178 ]; // added with #41377
2179 }
2180
2181 // list item is session material (not part of "_all"-items - see below)
2182 $event_items = ilEventItems::_getItemsOfContainer($this->object->getRefId());
2183 if (in_array($child_ref_id, $event_items)) {
2184 foreach (($sess_data) as $id) {
2185 $items = ilObjectActivation::getItemsByEvent($id['obj_id']);
2186 foreach ($items as $event_item) {
2187 if ($event_item["child"] == $child_ref_id) {
2188 // sessions
2189 if ($parent_ref_id > 0) {
2190 $event_item["parent"] = $parent_ref_id;
2191 }
2192 $html = $container_view->renderItem($event_item);
2193 }
2194 }
2195 }
2196 }
2197
2198 // "normal" list item
2199 if (!$html) {
2200 foreach (($this->object->items["_all"] ?? []) as $id) {
2201 if ($id["child"] == $child_ref_id) {
2202 $html = $container_view->renderItem($id);
2203 }
2204 }
2205 }
2206
2207 if ($html) {
2208 echo $html;
2209
2210 // we need to add onload code manually (rating, comments, etc.)
2211 echo $tpl->getOnLoadCodeForAsynch();
2212 }
2213
2214 exit;
2215 }
2216
2217 protected function initEditForm(): ilPropertyFormGUI
2218 {
2219 $lng = $this->lng;
2220 $lng->loadLanguageModule($this->object->getType());
2221
2222 $form = new ilPropertyFormGUI();
2223 $form->setFormAction($this->ctrl->getFormAction($this, "update"));
2224 $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
2225
2226 $this->initFormTitleDescription($form);
2227
2228 $this->initEditCustomForm($form);
2229
2230 $form->addCommandButton("update", $this->lng->txt("save"));
2231
2232 return $form;
2233 }
2234
2238 public function initFormTitleDescription(ilPropertyFormGUI $form): void
2239 {
2240 $trans = null;
2241 if ($this->getCreationMode() === false) {
2243 $trans = $this->object->getObjectTranslation();
2244 }
2245 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
2246 $title->setRequired(true);
2247 $title->setSize(min(40, ilObject::TITLE_LENGTH));
2248 $title->setMaxLength(ilObject::TITLE_LENGTH);
2249 $form->addItem($title);
2250
2251 if ($this->getCreationMode() === false && count($trans->getLanguages()) > 1) {
2252 $languages = $this->domain->metadata()->getLOMLanguagesForSelectInputs();
2253 $title->setInfo(
2254 $this->lng->txt("language") . ": " . $languages[$trans->getDefaultLanguage()] .
2255 ' <a href="' . $this->ctrl->getLinkTargetByClass(TranslationGUI::class, "") .
2256 '">&raquo; ' . $this->lng->txt("obj_more_translations") . '</a>'
2257 );
2258
2259 unset($languages);
2260 }
2261 $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
2262 $desc->setRows(2);
2263 $desc->setCols(40);
2264 $desc->setMaxNumOfChars(ilObject::LONG_DESC_LENGTH);
2265 $form->addItem($desc);
2266
2267 if ($this->getCreationMode() === false) {
2268 $title->setValue($trans->getDefaultTitle());
2269 $desc->setValue($trans->getDefaultDescription());
2270 }
2271 }
2272
2276 protected function initSortingForm(
2277 ilPropertyFormGUI $form,
2278 array $a_sorting_settings
2280 $settings = new ilContainerSortingSettings($this->object->getId());
2281 $sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting");
2282
2283 if (in_array(ilContainer::SORT_INHERIT, $a_sorting_settings)) {
2284 $sort_inherit = new ilRadioOption();
2285 $sort_inherit->setTitle(
2286 $this->lng->txt('sort_inherit_prefix') .
2289 $this->object->getId()
2290 )
2291 ) . ') '
2292 );
2293 $sort_inherit->setValue((string) ilContainer::SORT_INHERIT);
2294 $sort_inherit->setInfo($this->lng->txt('sorting_info_inherit'));
2295 $sort->addOption($sort_inherit);
2296 }
2297 if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
2298 $sort_title = new ilRadioOption(
2299 $this->lng->txt('sorting_title_header'),
2301 );
2302 $sort_title->setInfo($this->lng->txt('sorting_info_title'));
2303
2304 $this->initSortingDirectionForm($settings, $sort_title, 'title');
2305 $sort->addOption($sort_title);
2306 }
2307 if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
2308 $sort_activation = new ilRadioOption(
2309 $this->lng->txt('sorting_creation_header'),
2311 );
2312 $sort_activation->setInfo($this->lng->txt('sorting_creation_info'));
2313 $this->initSortingDirectionForm($settings, $sort_activation, 'creation');
2314 $sort->addOption($sort_activation);
2315 }
2316 if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
2317 $sort_activation = new ilRadioOption($this->lng->txt('crs_sort_activation'), (string) ilContainer::SORT_ACTIVATION);
2318 $sort_activation->setInfo($this->lng->txt('crs_sort_timing_info'));
2319 $this->initSortingDirectionForm($settings, $sort_activation, 'activation');
2320 $sort->addOption($sort_activation);
2321 }
2322 if (in_array(ilContainer::SORT_MANUAL, $a_sorting_settings)) {
2323 $sort_manual = new ilRadioOption(
2324 $this->lng->txt('sorting_manual_header'),
2326 );
2327 $sort_manual->setInfo($this->lng->txt('sorting_info_manual'));
2328 $this->initManualSortingOptionForm($settings, $sort_manual, "manual", $a_sorting_settings);
2329 $sort->addOption($sort_manual);
2330 }
2331
2332 // Handle moved containers and there possibly invalid values
2333 if (in_array($settings->getSortMode(), $a_sorting_settings)) {
2334 $sort->setValue((string) $settings->getSortMode());
2335 } else {
2336 $sort->setValue((string) ilContainer::SORT_TITLE);
2337 }
2338 $form->addItem($sort);
2339
2340 return $form;
2341 }
2342
2347 {
2348 $lpres = new ilRadioGroupInputGUI($this->lng->txt('cont_list_presentation'), "list_presentation");
2349
2350 $item_list = new ilRadioOption($this->lng->txt('cont_item_list'), "");
2351 $item_list->setInfo($this->lng->txt('cont_item_list_info'));
2352 $lpres->addOption($item_list);
2353
2354 $tile_view = new ilRadioOption($this->lng->txt('cont_tile_view'), "tile");
2355 $tile_view->setInfo($this->lng->txt('cont_tile_view_info'));
2356 $lpres->addOption($tile_view);
2357
2358 // tile size
2359
2360 $si = new ilRadioGroupInputGUI($this->lng->txt("cont_tile_size"), "tile_size");
2361 foreach ($this->object->getTileSizes() as $key => $txt) {
2362 $op = new ilRadioOption($txt, $key);
2363 $si->addOption($op);
2364 }
2365 $tile_view->addSubItem($si);
2366 $si->setValue(
2367 (string) ((int) ilContainer::_lookupContainerSetting($this->object->getId(), "tile_size"))
2368 );
2369
2370 $lpres->setValue(
2371 ilContainer::_lookupContainerSetting($this->object->getId(), "list_presentation")
2372 );
2373
2374 $form->addItem($lpres);
2375
2376 return $form;
2377 }
2378
2379 protected function saveListPresentation(ilPropertyFormGUI $form): void
2380 {
2381 $val = ($form->getInput('list_presentation') === "tile")
2382 ? "tile"
2383 : "";
2384 ilContainer::_writeContainerSetting($this->object->getId(), "list_presentation", $val);
2386 $this->object->getId(),
2387 "tile_size",
2388 (string) ((int) $form->getInput('tile_size'))
2389 );
2390 }
2391
2395 protected function initSortingDirectionForm(
2396 ilContainerSortingSettings $sorting_settings,
2397 ilRadioOption $element,
2398 string $a_prefix
2399 ): ilRadioOption {
2400 if ($a_prefix === 'manual') {
2401 $txt = $this->lng->txt('sorting_new_items_direction');
2402 } else {
2403 $txt = $this->lng->txt('sorting_direction');
2404 }
2405
2406 $direction = new ilRadioGroupInputGUI($txt, $a_prefix . '_sorting_direction');
2407 $direction->setValue((string) $sorting_settings->getSortDirection());
2408 $direction->setRequired(true);
2409
2410 // asc
2411 $asc = new ilRadioOption(
2412 $this->lng->txt('sorting_asc'),
2414 );
2415 $direction->addOption($asc);
2416
2417 // desc
2418 $desc = new ilRadioOption(
2419 $this->lng->txt('sorting_desc'),
2421 );
2422 $direction->addOption($desc);
2423
2424 $element->addSubItem($direction);
2425
2426 return $element;
2427 }
2428
2434 ilRadioOption $element,
2435 string $a_prefix,
2436 array $a_sorting_settings
2437 ): ilRadioOption {
2438 $position = new ilRadioGroupInputGUI(
2439 $this->lng->txt('sorting_new_items_position'),
2440 $a_prefix . '_new_items_position'
2441 );
2442 $position->setValue((string) $settings->getSortNewItemsPosition());
2443 $position->setRequired(true);
2444
2445 //new items insert on top
2446 $new_top = new ilRadioOption(
2447 $this->lng->txt('sorting_new_items_at_top'),
2449 );
2450
2451 $position->addOption($new_top);
2452
2453 //new items insert at bottom
2454 $new_bottom = new ilRadioOption(
2455 $this->lng->txt('sorting_new_items_at_bottom'),
2457 );
2458
2459 $position->addOption($new_bottom);
2460
2461 $element->addSubItem($position);
2462
2463 $order = new ilRadioGroupInputGUI($this->lng->txt('sorting_new_items_order'), $a_prefix . '_new_items_order');
2464 $order->setValue((string) $settings->getSortNewItemsOrder());
2465 $order->setRequired(true);
2466
2467 if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
2468 //new items sort in alphabetical order
2469 $new_title = new ilRadioOption(
2470 $this->lng->txt('sorting_title_header'),
2472 );
2473
2474 $order->addOption($new_title);
2475 }
2476
2477 if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
2478 //new items sort by creation date
2479 $new_creation = new ilRadioOption(
2480 $this->lng->txt('sorting_creation_header'),
2482 );
2483
2484 $order->addOption($new_creation);
2485 }
2486
2487 if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
2488 //new items by activation
2489 $new_activation = new ilRadioOption(
2490 $this->lng->txt('crs_sort_activation'),
2492 );
2493
2494 $order->addOption($new_activation);
2495 }
2496
2497 $element->addSubItem($order);
2498
2499 $this->initSortingDirectionForm($settings, $element, 'manual');
2500
2501 return $element;
2502 }
2503
2504 protected function saveSortingSettings(ilPropertyFormGUI $form): void
2505 {
2506 $settings = new ilContainerSortingSettings($this->object->getId());
2507 $settings->setSortMode((int) $form->getInput("sorting"));
2508
2509 switch ($form->getInput('sorting')) {
2511 $settings->setSortDirection((int) $form->getInput('title_sorting_direction'));
2512 break;
2514 $settings->setSortDirection((int) $form->getInput('activation_sorting_direction'));
2515 break;
2517 $settings->setSortDirection((int) $form->getInput('creation_sorting_direction'));
2518 break;
2520 $settings->setSortNewItemsPosition($form->getInput('manual_new_items_position'));
2521 $settings->setSortNewItemsOrder($form->getInput('manual_new_items_order'));
2522 $settings->setSortDirection((int) $form->getInput('manual_sorting_direction'));
2523 break;
2524 }
2525
2526 $settings->update();
2527 }
2528
2532 public function trashObject(): void
2533 {
2534 $this->checkPermission("write");
2535 $tpl = $this->tpl;
2536
2537 $this->tabs_gui->activateTab('trash');
2538
2539 $this->lng->loadLanguageModule('cont');
2540 $tpl->setOnScreenMessage('info', $this->lng->txt('cont_trash_general_usage'));
2541
2542 $trash_table = new ilTrashTableGUI($this, 'trash', $this->object->getRefId());
2543 $trash_table->init();
2544 $trash_table->parse();
2545
2546 $trash_table->setFilterCommand('trashApplyFilter');
2547 $trash_table->setResetCommand('trashResetFilter');
2548
2549 $tpl->setContent($trash_table->getHTML());
2550 }
2551
2552 public function trashApplyFilterObject(): void
2553 {
2554 $this->trashHandleFilter(true, false);
2555 }
2556
2557 public function trashResetFilterObject(): void
2558 {
2559 $this->trashHandleFilter(false, true);
2560 }
2561
2562 protected function trashHandleFilter(bool $action_apply, bool $action_reset): void
2563 {
2564 $trash_table = new ilTrashTableGUI($this, 'trash', $this->object->getRefId());
2565 $trash_table->init();
2566 $trash_table->resetOffset();
2567 if ($action_reset) {
2568 $trash_table->resetFilter();
2569 }
2570 if ($action_apply) {
2571 $trash_table->writeFilterToSession();
2572 }
2573 $this->trashObject();
2574 }
2575
2576 public function removeFromSystemObject(): void
2577 {
2578 $this->checkPermission("write");
2579 $ru = new ilRepositoryTrashGUI($this);
2580 $ru->removeObjectsFromSystem($this->std_request->getTrashIds());
2581 $this->ctrl->redirect($this, "trash");
2582 }
2583
2584 protected function restoreToNewLocationObject(?ilPropertyFormGUI $form = null): void
2585 {
2586 $this->tabs_gui->activateTab('trash');
2587
2588 $ru = new ilRepositoryTrashGUI($this);
2589 $ru->restoreToNewLocation();
2590 }
2591
2595 public function undeleteObject(): void
2596 {
2597 $ru = new ilRepositoryTrashGUI($this);
2598 $ru->restoreObjects(
2599 $this->requested_ref_id,
2600 $this->std_request->getTrashIds()
2601 );
2602 $this->ctrl->redirect($this, "trash");
2603 }
2604
2605 public function confirmRemoveFromSystemObject(): void
2606 {
2607 $lng = $this->lng;
2608 $this->checkPermission("write");
2609 if (count($this->std_request->getTrashIds()) == 0) {
2610 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
2611 $this->ctrl->redirect($this, "trash");
2612 }
2613
2614 $ru = new ilRepositoryTrashGUI($this);
2615 $ru->confirmRemoveFromSystemObject($this->std_request->getTrashIds());
2616 }
2617
2618 protected function getTreeSelectorGUI(string $cmd): ilTreeExplorerGUI
2619 {
2620 $exp = new ilRepositorySelectorExplorerGUI($this, "showPasteTree");
2621 // TODO: The study programme 'prg' is not included here, as the
2622 // ilRepositorySelectorExplorerGUI only handles static rules for
2623 // parent-child-relations and not the dynamic relationsships
2624 // required for the SP (see #16909).
2625 $exp->setTypeWhiteList(["root", "cat", "grp", "crs", "fold"]);
2626
2627 // Not all types are allowed in the LearningSequence
2628 // Extend whitelist, if all selected types are possible subojects of LSO
2629 if (in_array($this->clipboard->getCmd(), ["link", "cut"])) {
2630 $lso_types = array_keys($this->obj_definition->getSubObjects('lso'));
2631 $refs = $this->clipboard->getRefIds();
2632 $allow_lso = true;
2633 foreach ($refs as $item_ref_id) {
2634 $type = ilObject::_lookupType($item_ref_id, true);
2635 if (!in_array($type, $lso_types)) {
2636 $allow_lso = false;
2637 }
2638 }
2639 if ($allow_lso) {
2640 $whitelist = $exp->getTypeWhiteList();
2641 $whitelist[] = 'lso';
2642 $exp->setTypeWhiteList($whitelist);
2643 }
2644 }
2645
2646 if ($cmd === "link") {
2647 $exp->setSelectMode("nodes", true);
2648 } else {
2649 $exp->setSelectMode("nodes[]", false);
2650 }
2651 return $exp;
2652 }
2653
2654 public function setSideColumnReturn(): void
2655 {
2656 $this->ctrl->setReturn($this, "");
2657 }
2658
2659 protected function initFilter(): void
2660 {
2661 global $DIC;
2662
2663 if (!$this->object || !ilContainer::_lookupContainerSetting($this->object->getId(), "filter", '0')) {
2664 return;
2665 }
2666
2667 if ($this->isActiveOrdering() || $this->ctrl->getCmd() === "editOrder") {
2668 return;
2669 }
2670
2671 $filter_service = $this->container_filter_service;
2672 $request = $DIC->http()->request();
2673
2674 $filter = $filter_service->util()->getFilterForRefId(
2675 $this->ref_id,
2676 $DIC->ctrl()->getLinkTarget($this, "render", "", true),
2677 $this->isActiveAdministrationPanel()
2678 );
2679
2680 $filter_data = $DIC->uiService()->filter()->getData($filter);
2681
2682 $this->container_user_filter = $filter_service->userFilter($filter_data);
2683 $this->ui_filter = $filter;
2684 }
2685
2686 protected function showContainerFilter(): void
2687 {
2688 global $DIC;
2689 if (!is_null($this->ui_filter)) {
2690 $renderer = $DIC->ui()->renderer();
2691
2692 $main_tpl = $this->tpl;
2693 $main_tpl->setFilter($renderer->render($this->ui_filter));
2694 if ($this->container_user_filter->isEmpty() && !ilContainer::_lookupContainerSetting(
2695 $this->object->getId(),
2696 "filter_show_empty",
2697 '0'
2698 )) {
2699 $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_filter_empty"));
2700 }
2701 }
2702 }
2703
2704 public function getAdminTabs(): void
2705 {
2706 if ($this->checkPermissionBool("visible,read")) {
2707 $this->tabs_gui->addTab(
2708 'view',
2709 $this->lng->txt('view'),
2710 $this->ctrl->getLinkTarget($this, 'view')
2711 );
2712 }
2713
2714 if ($this->checkPermissionBool("write")) {
2715 $this->tabs_gui->addTab(
2716 'trash',
2717 $this->lng->txt('trash'),
2718 $this->ctrl->getLinkTarget($this, 'trash')
2719 );
2720 }
2721
2722 if ($this->checkPermissionBool("edit_permission")) {
2723 $this->tabs_gui->addTab(
2724 'perm_settings',
2725 $this->lng->txt('perm_settings'),
2726 $this->ctrl->getLinkTargetByClass(
2727 [
2728 get_class($this),
2729 'ilpermissiongui'
2730 ],
2731 'perm'
2732 )
2733 );
2734 }
2735 }
2736
2737 public function competencesObject(): void
2738 {
2739 $ctrl = $this->ctrl;
2740
2741 $ctrl->redirectByClass(["ilContainerSkillGUI", "ilContSkillPresentationGUI"]);
2742 }
2743}
$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.
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.
Class ilObjectActivation.
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:37
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:26
global $ilSetting
Definition: privfeed.php:26
$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