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