ILIAS  release_8 Revision v8.24
class.ilFavouritesListGUI.php
Go to the documentation of this file.
1<?php
2
25{
27 protected \ILIAS\DI\UIServices $ui;
28 protected ilCtrl $ctrl;
29 protected ilLanguage $lng;
30
31 public function __construct(?ilObjUser $user = null)
32 {
33 global $DIC;
34
35 if (is_null($user)) {
36 $user = $DIC->user();
37 }
38
40 $settings->parse();
42 $this->ui = $DIC->ui();
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->lng->loadLanguageModule("rep");
46 }
47
48 public function render(): string
49 {
50 $f = $this->ui->factory();
51 $item_groups = [];
53 foreach ($this->block_view->getItemGroups() as $group) {
54 $items = [];
55 foreach ($group->getItems() as $item) {
56 $items[] = $f->item()->standard(
57 $f->link()->standard($item["title"], ilLink::_getLink($item["ref_id"]))
58 )->withLeadIcon($f->symbol()->icon()->custom(ilObject::_getIcon((int) $item["obj_id"]), $item["title"]));
59 }
60 if (count($items) > 0) {
61 $item_groups[] = $f->item()->group($group->getLabel(), $items);
62 }
63 }
64 if (count($item_groups) > 0) {
65 $ctrl->setParameterByClass("ilPDSelectedItemsBlockGUI", "view", "0");
66 $ctrl->setParameterByClass("ilPDSelectedItemsBlockGUI", "col_side", "center");
67 $ctrl->setParameterByClass("ilPDSelectedItemsBlockGUI", "block_type", "pditems");
68
69 // see PR discussion at https://github.com/ILIAS-eLearning/ILIAS/pull/5247/files
70 $config_item = $f->item()->standard(
71 $f->link()->standard(
72 $this->lng->txt("rep_configure"),
73 $this->ctrl->getLinkTargetByClass(["ilDashboardGUI", "ilColumnGUI", "ilPDSelectedItemsBlockGUI"], "manage")
74 )
75 );
76 array_unshift($item_groups, $f->item()->group($this->lng->txt(""), [$config_item]));
77 $panel = $f->panel()->secondary()->listing("", $item_groups);
78 return $this->ui->renderer()->render([$panel]);
79 }
80
81 $pdblock = new ilPDSelectedItemsBlockGUI();
82 return $pdblock->getNoItemFoundContent();
83 }
84}
Class ilCtrl provides processing control methods.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPDSelectedItemsBlockViewGUI $block_view
__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.
@ilCtrl_IsCalledBy ilPDSelectedItemsBlockGUI: ilColumnGUI @ilCtrl_Calls ilPDSelectedItemsBlockGUI: il...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)
global $DIC
Definition: feed.php:28
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200