ILIAS  trunk Revision v13.0_alpha-52-g21c366bbdd4
NavigationGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Blog\Navigation;
22
30use ilObjBlogGUI;
31
33{
34 public function __construct(
35 protected InternalDomainService $domain,
36 protected InternalGUIService $gui,
37 protected BlogGUIContext $context
38 ) {
39 }
40
41 public function setTabs(): void
42 {
43 $context = $this->context;
44 $tabs = $this->gui->tabs();
45 $ctrl = $this->gui->ctrl();
46 $lng = $this->domain->lng();
47 $perm = $context->getPermission();
48
49 if (!$context->isRepositoryNode()) {
50 $ctrl->setParameterByClass(ilObjBlogGUI::class, "wsp_id", $context->getNodeId());
51 }
52
53 $this->gui->help()->setScreenIdComponent("blog");
54
55 if ($perm->mayContribute()) {
56 $ctrl->setParameterByClass(ilObjBlogGUI::class, "bmn", null);
57 $tabs->addTab(
58 "content",
59 $lng->txt("content"),
60 $ctrl->getLinkTargetByClass(EditingGUI::class, "")
61 );
62 }
63 if ($perm->canRead()) {
64 $tabs->addTab(
65 "id_info",
66 $lng->txt("info_short"),
67 $ctrl->getLinkTargetByClass(
68 [ilObjBlogGUI::class, "ilinfoscreengui"],
69 "showSummary"
70 )
71 );
72 }
73
74 if ($perm->canWrite()) {
75 $tabs->addTab(
76 "settings",
77 $lng->txt("settings"),
78 $ctrl->getLinkTargetByClass(SettingsGUI::class, "")
79 );
80
81 if ($context->isRepositoryNode()) {
82 $tabs->addTab(
83 "contributors",
84 $lng->txt("blog_contributors"),
85 $ctrl->getLinkTargetByClass(ContributorGUI::class, "contributors")
86 );
87
88 $blog = $context->getObject();
89 if ($blog !== null) {
90 $mdgui = new \ilObjectMetaDataGUI(
91 $blog,
92 null,
93 null,
94 $context->isCallByReference()
95 );
96 $mdtab = $mdgui->getTab();
97 if ($mdtab) {
98 $tabs->addTab(
99 "meta_data",
100 $lng->txt("meta_data"),
101 $mdtab
102 );
103 }
104 }
105 $tabs->addTab(
106 "export",
107 $lng->txt("export"),
108 $ctrl->getLinkTargetByClass("ilexportgui", "")
109 );
110 }
111 }
112
113 if ($perm->mayContribute()) {
114 $tabs->addNonTabbedLink(
115 "preview",
116 $lng->txt("blog_preview"),
117 $ctrl->getLinkTargetByClass(
118 [ilObjBlogGUI::class, \ILIAS\Blog\Presentation\PresentationGUI::class],
119 "preview"
120 )
121 );
122 }
123 }
124
125 public function setSettingsSubTabs(
126 string $active
127 ): void {
128 $context = $this->context;
129 $tabs = $this->gui->tabs();
130 $ctrl = $this->gui->ctrl();
131 $lng = $this->domain->lng();
132 $blog = $context->getBlog();
133
134 $tabs->addSubTab(
135 "properties",
136 $lng->txt("general"),
137 $ctrl->getLinkTargetByClass(ilObjBlogGUI::class, "edit")
138 );
139 $tabs->addSubTab(
140 "side_blocks",
141 $lng->txt("blog_side_blocks"),
142 $ctrl->getLinkTargetByClass(
143 [ilObjBlogGUI::class, \ILIAS\Blog\Settings\BlockSettingsGUI::class],
144 ""
145 )
146 );
147 $tabs->addSubTab(
148 "style",
149 $lng->txt("obj_sty"),
150 $ctrl->getLinkTargetByClass("ilobjectcontentstylesettingsgui", "")
151 );
152
153 if ($context->isRepositoryNode()) {
154 $tree = $this->domain->repositoryTree();
155 $grp_ref_id = $tree->checkForParentType($blog->getRefId(), "grp");
156 $crs_ref_id = $tree->checkForParentType($blog->getRefId(), "crs");
157 if (($grp_ref_id > 0 || $crs_ref_id > 0) &&
158 $context->getPermission()->getAccessHandler()->checkAccess("write", "", $blog->getRefId())) {
159 $tabs->addSubTab(
160 "notifications",
161 $lng->txt("notifications"),
162 $ctrl->getLinkTargetByClass("ilobjnotificationsettingsgui", "")
163 );
164 }
165 }
166
167 $tabs->activateSubTab($active);
168 }
169
170 public function addLocatorItems(): void
171 {
172 $context = $this->context;
173 $blog = $context->getObject();
174 if ($blog === null) {
175 return;
176 }
177
178 $this->gui->locator()->addItem(
179 $blog->getTitle(),
180 $this->gui->ctrl()->getLinkTargetByClass(ilObjBlogGUI::class, "preview"),
181 "",
182 $context->getNodeId()
183 );
184 }
185
186 public function prepareHeaderAction(
187 ?ilObjectListGUI $list_gui,
188 bool $presentation = false
189 ): ?ilObjectListGUI {
190 $context = $this->context;
191 if ($list_gui === null) {
192 return null;
193 }
194
195 $list_gui->enableComments(false);
196 $list_gui->enableNotes(false);
197 if (!$presentation || $context->getObject() === null) {
198 return $list_gui;
199 }
200
201 return $this->presentationHeader(
202 $context->getObject(),
203 $context->getPermission()
204 )->get($list_gui, $context->getRequest()->getBlogPage());
205 }
206
207 protected function presentationHeader(
208 \ilObjBlog $blog,
209 \ILIAS\Blog\Permission\PermissionManager $permission
211 return $this->gui->navigation()->presentationHeader($blog, $permission);
212 }
213}
@ilCtrl_Calls ILIAS\Blog\Contributor\ContributorGUI: ilRepositorySearchGUI
@ilCtrl_Calls ILIAS\Blog\Editing\EditingGUI: ilRepositorySearchGUI, ilBlogPostingGUI
Definition: EditingGUI.php:37
prepareHeaderAction(?ilObjectListGUI $list_gui, bool $presentation=false)
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected BlogGUIContext $context)
presentationHeader(\ilObjBlog $blog, \ILIAS\Blog\Permission\PermissionManager $permission)
alles nur in presentation aufrufen! (rest macht nur ) ilObjBlogGUI->addHeaderActionForCommand (called...
@ilCtrl_Calls ilObjBlogGUI: ilWorkspaceAccessGUI @ilCtrl_Calls ilObjBlogGUI: ilInfoScreenGUI,...
enableComments(bool $value, bool $enable_comments_settings=true)
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'vtt', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:26