ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Blog\Presentation\PresentationGUI Class Reference

@ilCtrl_Calls ILIAS\Blog\Presentation\PresentationGUI: ilBlogPostingGUI More...

+ Collaboration diagram for ILIAS\Blog\Presentation\PresentationGUI:

Public Member Functions

 __construct (protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected BlogGUIContext $context, protected \ILIAS\Style\Content\Object\ObjectFacade $content_style_domain, protected ?\Closure $add_header_callback=null)
 
 executeCommand ()
 
 renderToolbarNavigation (array $a_items, bool $single_posting=false)
 Toolbar navigation. More...
 
 preview ()
 Render fullscreen presentation. More...
 
 renderFullscreenHeader (\ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
 
 setContentStyleSheet (?\ilGlobalTemplateInterface $a_tpl=null)
 

Protected Member Functions

 getLinkBuilder ()
 
 forwardPosting ()
 
 setNotification ()
 
 renderFullScreen (string $a_content, string $a_navigation)
 Build fullscreen context. More...
 

Protected Attributes

ILIAS Style Content GUIService $content_style_gui
 
ILIAS Notes Service $notes
 
ILIAS Repository Profile ProfileGUI $profile_gui
 
ILIAS Blog Settings Settings $blog_settings
 
ilCtrl $ctrl
 
ilObjUser $user
 

Detailed Description

@ilCtrl_Calls ILIAS\Blog\Presentation\PresentationGUI: ilBlogPostingGUI

Definition at line 34 of file PresentationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Blog\Presentation\PresentationGUI::__construct ( protected InternalDataService  $data,
protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected BlogGUIContext  $context,
protected \ILIAS\Style\Content\Object\ObjectFacade  $content_style_domain,
protected ?\Closure  $add_header_callback = null 
)

Definition at line 43 of file PresentationGUI.php.

50 {
51 global $DIC;
52 $this->notes = $DIC->notes();
53
54 $this->content_style_gui = $DIC->contentStyle()->gui();
55 $this->user = $this->domain->user();
56 $this->ctrl = $this->gui->ctrl();
57 $this->blog_settings = $domain->blogSettings()->getByObjId($context->getBlog()->getId());
58 $this->profile_gui = $gui->profile();
59 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Blog\InternalDomainService\blogSettings(), ILIAS\Repository\ctrl(), ILIAS\Blog\BlogGUIContext\getBlog(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ILIAS\Blog\Presentation\PresentationGUI::executeCommand ( )

Definition at line 66 of file PresentationGUI.php.

66 : void
67 {
68 $next_class = $this->gui->ctrl()->getNextClass($this);
69 $cmd = $this->gui->ctrl()->getCmd("preview");
70
71 switch ($next_class) {
72 case strtolower(ilBlogPostingGUI::class):
73 $this->forwardPosting();
74 break;
75
76 default:
77 $this->$cmd();
78 break;
79 }
80 }

References ILIAS\Blog\Presentation\PresentationGUI\forwardPosting().

+ Here is the call graph for this function:

◆ forwardPosting()

ILIAS\Blog\Presentation\PresentationGUI::forwardPosting ( )
protected

Definition at line 102 of file PresentationGUI.php.

102 : void
103 {
104 $ilCtrl = $this->gui->ctrl();
105 $req = $this->context->getRequest();
106
107 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
108
109 $notes_status = $this->notes->domain()->commentsActive($this->context->getBlog()->getId());
110 $bpost_gui = new ilBlogPostingGUI(
111 $this->context->getNodeId(),
112 $this->context->getPermission()->getAccessHandler(),
113 $req->getBlogPage(),
114 $req->getOldNr(),
115 $notes_status,
116 $this->context->getPermission()->mayEditPosting($req->getBlogPage()),
117 $style_sheet_id
118 );
119
120 $ilCtrl->setParameter($this, "prvm", "fsc");
121
122 $items = $this->domain->postingList($this->context->getBlog()->getId())->getPostingsGroupedByMonth();
123 $this->renderToolbarNavigation($items, true);
124
125 $ret = $ilCtrl->forwardCommand($bpost_gui);
126
127 if ($ret != "") {
128 $is_owner = $this->context->getPermission()->mayContribute();
129 $is_active = $bpost_gui->getBlogPosting()->getActive();
130
131 // do not show inactive postings
132 $cmd = $ilCtrl->getCmd();
133 if (($cmd === "previewFullscreen")
134 && !$is_owner && !$is_active) {
135 $ilCtrl->redirectByClass(\ilObjBlogGUI::class, "preview");
136 }
137
138 if ($cmd === "previewFullscreen") {
139 if ($this->add_header_callback) {
140 ($this->add_header_callback)();
141 }
142 $nav = $this->gui->navigation()->sideBar(
143 $this->context->getPermission(),
144 $this->getLinkBuilder(),
146 $this->context->getNodeId(),
147 $this->context->getIdType()
148 )->render(
149 $this->domain->postingList($this->context->getBlog()->getId(), false)->getPostingsGroupedByMonth()
150 );
151 $this->renderFullScreen($ret, $nav);
152 }
153 }
154 }
renderFullScreen(string $a_content, string $a_navigation)
Build fullscreen context.
renderToolbarNavigation(array $a_items, bool $single_posting=false)
Toolbar navigation.
ILIAS Blog Settings Settings $blog_settings
Class ilBlogPosting GUI class.
catch(\Exception $e) $req
Definition: xapiproxy.php:81

References XapiProxy\$req.

Referenced by ILIAS\Blog\Presentation\PresentationGUI\executeCommand().

+ Here is the caller graph for this function:

◆ getLinkBuilder()

ILIAS\Blog\Presentation\PresentationGUI::getLinkBuilder ( )
protected

Definition at line 61 of file PresentationGUI.php.

61 : LinkBuilder
62 {
63 return $this->gui->navigation()->presentationLink();
64 }

◆ preview()

ILIAS\Blog\Presentation\PresentationGUI::preview ( )

Render fullscreen presentation.

Definition at line 159 of file PresentationGUI.php.

159 : void
160 {
161 $lng = $this->domain->lng();
162 $tpl = $this->gui->ui()->mainTemplate();
163
164 if (!$this->context->getPermission()->canRead()) {
165 $tpl->setOnScreenMessage('info', $lng->txt("no_permission"));
166 return;
167 }
168 $list_items = $this->domain->postingList($this->context->getBlog()->getId())
169 ->getPostingsForView(
170 $this->context->getAuthor() ?? 0,
171 $this->keyword ?? "",
172 $this->context->getMonth()
173 );
174
175
176 $list = $nav = "";
177 $items = $this->domain->postingList($this->context->getBlog()->getId(), false)->getPostingsGroupedByMonth();
178 if ($list_items) {
179 $list = $this->gui->posting()->postingList(
180 $this->context->getBlog()->getId(),
181 $this->context->getPermission(),
182 $this->context->getMonth(),
183 $this->context->getNodeId(),
184 $this->context->getIdType(),
185 )->render(
186 $list_items,
187 "previewFullscreen"
188 );
189 $nav = $this->gui->navigation()->sideBar(
190 $this->context->getPermission(),
191 $this->getLinkBuilder(),
192 $this->blog_settings,
193 $this->context->getNodeId(),
194 $this->context->getIdType()
195 )->render(
196 $items,
197 );
198 $this->renderToolbarNavigation($items);
199 }
200
201 $this->renderFullScreen($list, $nav);
202 }
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
readonly ilGlobalTemplateInterface $tpl
global $lng
Definition: privfeed.php:26

References $lng, ILIAS\News\Common\Table\$tpl, and ILIAS\UICore\GlobalTemplate\setOnScreenMessage().

+ Here is the call graph for this function:

◆ renderFullScreen()

ILIAS\Blog\Presentation\PresentationGUI::renderFullScreen ( string  $a_content,
string  $a_navigation 
)
protected

Build fullscreen context.

Definition at line 294 of file PresentationGUI.php.

297 : void {
298 $tpl = $this->gui->ui()->mainTemplate();
299 $ilTabs = $this->gui->tabs();
300 $ilTabs->clearTargets();
301 $tpl->setLocator();
302
303 $this->renderFullscreenHeader($tpl, $this->context->getBlog()->getOwner());
304
305 // #13564
306 $this->ctrl->setParameter($this, "bmn", "");
307 //$tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
308 $this->ctrl->setParameter($this, "bmn", $this->context->getMonth());
309
310 $this->setContentStyleSheet();
311
312 // content
313 $tpl->setContent($a_content);
314 $tpl->setRightContent($a_navigation);
315 }
setContentStyleSheet(?\ilGlobalTemplateInterface $a_tpl=null)
renderFullscreenHeader(\ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
setLocator()
Insert locator.
setRightContent(string $a_html)
Sets content of right column.
setContent(string $a_html)
Sets content for standard template.

◆ renderFullscreenHeader()

ILIAS\Blog\Presentation\PresentationGUI::renderFullscreenHeader ( \ilGlobalTemplateInterface  $a_tpl,
int  $a_user_id,
bool  $a_export = false 
)

Definition at line 231 of file PresentationGUI.php.

235 : void {
236 $ilUser = $this->user;
237
238 if (!$a_export) {
240 "blog",
241 $this->context->getNodeId(),
242 $this->context->getBlog()->getId(),
243 $ilUser->getId()
244 );
245 }
246
247 // repository blogs are multi-author
248 $name = "";
249 if (!$this->context->isRepositoryNode()) {
250 $name = \ilObjUser::_lookupName($a_user_id);
251 $name = $name["lastname"] . ", " . $name["firstname"];
252 }
253
254 $ppic = "";
255 if ($this->blog_settings?->getProfilePicture() && !$a_export) {
256 // repository (multi-user)
257 if ($this->context->isRepositoryNode()) {
258 // #15030
259 if ($this->context->getRequest()->getBlogPage() > 0 && !$a_export) {
260 $post = new \ilBlogPosting($this->context->getRequest()->getBlogPage());
261 $author_id = $post->getAuthor();
262 if ($author_id) {
263 $ppic = $this->profile_gui->getPicturePath($author_id);
264 $name = $this->profile_gui->getNamePresentation($author_id);
265 //$name = $name["lastname"] . ", " . $name["firstname"];
266 }
267 }
268 }
269 // workspace (author == owner)
270 else {
271 $ppic = \ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true);
272 if ($a_export) {
273 $ppic = basename($ppic);
274 }
275 }
276 } else {
277 $ppic = \ilUtil::getImagePath("standard/icon_blog.svg");
278 }
279 $a_tpl->resetHeaderBlock(false);
280 $a_tpl->setTitleIcon($ppic);
281 $title = \ilObject::_lookupTitle($this->context->getBlog()->getId());
282 $desc = \ilObject::getLongDescriptions([$this->context->getBlog()->getId()]);
283 $a_tpl->setTitle($title);
284 if ($this->context->isRepositoryNode()) {
285 $a_tpl->setDescription(current($desc));
286 } else {
287 $a_tpl->setDescription($name);
288 }
289 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $a_ext_rc=null, $a_ext_time=null)
static _getPersonalPicturePath(int $usr_id, string $size='small', bool $force_pic=false)
static _lookupName(int $a_user_id)
static getLongDescriptions(array $obj_ids)
static _lookupTitle(int $obj_id)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilChangeEvent\_recordReadEvent().

+ Here is the call graph for this function:

◆ renderToolbarNavigation()

ILIAS\Blog\Presentation\PresentationGUI::renderToolbarNavigation ( array  $a_items,
bool  $single_posting = false 
)

Toolbar navigation.

Definition at line 85 of file PresentationGUI.php.

88 : void {
89 $nav_renderer = $this->gui->navigation()->toolbarNavigationRenderer(
90 $this->getLinkBuilder(),
91 );
92 $nav_renderer->renderToolbarNavigation(
93 $this->context->getPermission(),
94 $a_items,
95 $this->context->getRequest()->getBlogPage(),
96 $single_posting,
97 $this->context->getMonth(),
98 $this->context->getRequest()->getUserPage()
99 );
100 }

◆ setContentStyleSheet()

ILIAS\Blog\Presentation\PresentationGUI::setContentStyleSheet ( ?\ilGlobalTemplateInterface  $a_tpl = null)

Definition at line 317 of file PresentationGUI.php.

319 : void {
320 $tpl = $this->gui->ui()->mainTemplate();
321
322 if ($a_tpl) {
323 $ctpl = $a_tpl;
324 } else {
325 $ctpl = $tpl;
326 }
327
328 $this->content_style_gui->addCss(
329 $ctpl,
330 $this->context->getNodeId(),
331 $this->context->getBlog()->getId()
332 );
333 }
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.

◆ setNotification()

ILIAS\Blog\Presentation\PresentationGUI::setNotification ( )
protected

Definition at line 204 of file PresentationGUI.php.

204 : void
205 {
206 $ilUser = $this->user;
207 $ilCtrl = $this->ctrl;
208 switch ($this->context->getRequest()->getNotification()) {
209 case 1:
212 $ilUser->getId(),
213 $this->context->getBlog()->getId(),
214 false
215 );
216 break;
217
218 case 2:
221 $ilUser->getId(),
222 $this->context->getBlog()->getId(),
223 true
224 );
225 break;
226 }
227
228 $ilCtrl->redirect($this, "");
229 }
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.

References ilNotification\setNotification(), and ilNotification\TYPE_BLOG.

+ Here is the call graph for this function:

Field Documentation

◆ $blog_settings

ILIAS Blog Settings Settings ILIAS\Blog\Presentation\PresentationGUI::$blog_settings
protected

Definition at line 39 of file PresentationGUI.php.

◆ $content_style_gui

ILIAS Style Content GUIService ILIAS\Blog\Presentation\PresentationGUI::$content_style_gui
protected

Definition at line 36 of file PresentationGUI.php.

◆ $ctrl

ilCtrl ILIAS\Blog\Presentation\PresentationGUI::$ctrl
protected

Definition at line 40 of file PresentationGUI.php.

◆ $notes

ILIAS Notes Service ILIAS\Blog\Presentation\PresentationGUI::$notes
protected

Definition at line 37 of file PresentationGUI.php.

◆ $profile_gui

ILIAS Repository Profile ProfileGUI ILIAS\Blog\Presentation\PresentationGUI::$profile_gui
protected

Definition at line 38 of file PresentationGUI.php.

◆ $user

ilObjUser ILIAS\Blog\Presentation\PresentationGUI::$user
protected

Definition at line 41 of file PresentationGUI.php.


The documentation for this class was generated from the following file: