ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBiblEntryDetailPresentationGUI.php
Go to the documentation of this file.
1<?php
2
21
29{
33 public function __construct(
34 public \ilBiblEntry $entry,
35 protected ilBiblFactoryFacade $facade,
36 protected ilCtrlInterface $ctrl,
37 protected ilHelpGUI $help,
38 protected ilLanguage $lng,
39 protected ilGlobalTemplateInterface $main_tpl,
40 protected ilTabsGUI $tabs,
41 protected UIServices $ui
42 ) {
43 $this->initHelp();
44 $this->initTabs();
45 $this->initPermanentLink();
46 }
47
48
49 private function initHelp(): void
50 {
51 $this->help->setScreenIdComponent('bibl');
52 }
53
54
55 private function initTabs(): void
56 {
57 $this->tabs->clearTargets();
58 $this->tabs->setBackTarget(
59 $this->lng->txt("back"),
60 $this->ctrl->getLinkTargetByClass(ilObjBibliographicGUI::class, ilObjBibliographicGUI::CMD_SHOW_CONTENT)
61 );
62 }
63
64 private function initPermanentLink(): void
65 {
66 $this->main_tpl->setPermanentLink(
67 "bibl",
68 $this->facade->iliasRefId(),
69 "_" . $this->entry->getId()
70 );
71 }
72
73
74 public function getHTML(): string
75 {
76 $sub_panels = [
77 $this->getOverviewPanel()
78 ];
79
80 if (($libraries = $this->getLibrariesDeck()) !== null) {
81 $sub_panels[] = $libraries;
82 }
83
84 return $this->ui->renderer()->render(
85 $this->ui->factory()->panel()->report($this->lng->txt('detail_view'), $sub_panels)
86 );
87 }
88
89 private function getLibrariesDeck(): ?Sub
90 {
91 $settings = $this->facade->libraryFactory()->getAll();
92 if ($settings === []) {
93 return null;
94 }
95
96 $data = [];
97
98 foreach ($settings as $set) {
99 $presentation = new ilBiblLibraryPresentationGUI($set, $this->facade, $this->ctrl, $this->lng, $this->ui);
100 $data[$set->getName()] = $presentation->getButton($this->facade, $this->entry);
101 }
102
103 return $this->ui->factory()->panel()->sub(
104 $this->lng->txt('bibl_settings_libraries'),
105 $this->ui->factory()->listing()->characteristicValue()->text($data)
106 );
107 }
108
109 private function getOverviewPanel(): Sub
110 {
111 $attributes = $this->facade->attributeFactory()->getAttributesForEntry($this->entry);
112 $sorted = $this->facade->attributeFactory()->sortAttributes($attributes);
113 $data = [];
114 foreach ($sorted as $attribute) {
115 $translated = $this->facade->translationFactory()->translateAttribute($attribute);
116 $data[$translated] = $attribute->getValue();
117 }
118
119 $content = $this->ui->factory()->listing()->characteristicValue()->text($data);
120
121 return $this->ui->factory()->panel()->sub('', $content);
122 }
123}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
__construct(public \ilBiblEntry $entry, protected ilBiblFactoryFacade $facade, protected ilCtrlInterface $ctrl, protected ilHelpGUI $help, protected ilLanguage $lng, protected ilGlobalTemplateInterface $main_tpl, protected ilTabsGUI $tabs, protected UIServices $ui)
ilBiblEntryPresentationGUI constructor.
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...
Class ilBiblLibraryPresentationGUI.
Help GUI class.
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes a Sub Panel.
Definition: Sub.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $lng
Definition: privfeed.php:31