ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilFavouritesListGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
24 protected ilCtrl $ctrl;
25 protected ilLanguage $lng;
27
28 public function __construct(?ilObjUser $user = null)
29 {
30 global $DIC;
31
32 if (is_null($user)) {
33 $user = $DIC->user();
34 }
35
37 $settings->parse();
38 $this->ui = $DIC->ui();
39 $this->ctrl = $DIC->ctrl();
40 $this->lng = $DIC->language();
41 $this->favoritesManager = new ilSelectedItemsBlockGUI();
42 $this->lng->loadLanguageModule('rep');
43
44 }
45
46 public function render(): string
47 {
48 $f = $this->ui->factory();
49 $items = [];
50 foreach ($this->favoritesManager->getItemGroups() as $key => $group) {
51 foreach ($group as $item) {
52 $items[] = $f->item()->standard(
53 $f->link()->standard($item->getTitle(), ilLink::_getLink($item->getRefId()))
54 )->withLeadIcon($f->symbol()->icon()->custom(ilObject::_getIcon((int) $item->getObjId()), $item->getTitle()));
55 }
56 }
57 return $items === [] ? '' : $this->ui->renderer()->render($f->panel()->secondary()->listing('', [$f->item()->group('', $items)]));
58 }
59}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
ilObjUser $user
Class ilCtrl provides processing control methods.
ilSelectedItemsBlockGUI $favoritesManager
__construct(?ilObjUser $user=null)
language handling
User class.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
global $DIC
Definition: shib_login.php:26