ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilFavouritesListGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11{
15 protected $block_view;
16
20 protected $ui;
21
25 protected $ctrl;
26
27
31 public function __construct($user = null)
32 {
33 global $DIC;
34
35 if (is_null($user)) {
36 $user = $DIC->user();
37 }
38
39 $settings = new ilPDSelectedItemsBlockViewSettings($user);
40 $settings->parse();
41 $this->block_view = ilPDSelectedItemsBlockViewGUI::bySettings($settings);
42 $this->ui = $DIC->ui();
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->lng->loadLanguageModule("rep");
46 }
47
53 public function render()
54 {
55 $f = $this->ui->factory();
56 $item_groups = [];
58 foreach ($this->block_view->getItemGroups() as $group) {
59 $items = [];
60 foreach ($group->getItems() as $item) {
61 $items[] = $f->item()->standard(
62 $f->link()->standard($item["title"], ilLink::_getLink($item["ref_id"]))
63 )->withLeadIcon($f->symbol()->icon()->custom(ilObject::_getIcon($item["obj_id"]), $item["title"]));
64 }
65 if (count($items) > 0) {
66 $item_groups[] = $f->item()->group((string) $group->getLabel(), $items);
67 }
68 }
69 if (count($item_groups) > 0) {
70 $ctrl->setParameterByClass("ilPDSelectedItemsBlockGUI", "view", "0");
71 $ctrl->setParameterByClass("ilPDSelectedItemsBlockGUI", "col_side", "center");
72 $ctrl->setParameterByClass("ilPDSelectedItemsBlockGUI", "block_type", "pditems");
73 $panel = $f->panel()->secondary()->listing("", $item_groups);
74 $panel = $panel->withActions($f->dropdown()->standard([$f->link()->standard(
75 $this->lng->txt("rep_configure"),
76 $ctrl->getLinkTargetByClass(
77 ["ilDashboardGUI", "ilColumnGUI", "ilPDSelectedItemsBlockGUI"],
78 "manage"
79 )
80 )
81 ]));
82 return $this->ui->renderer()->render([$panel]);
83 } else {
84 $pdblock = new ilPDSelectedItemsBlockGUI();
85 return $pdblock->getNoItemFoundContent();
86 }
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
__construct($user=null)
Constructor.
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
@ilCtrl_IsCalledBy ilPDSelectedItemsBlockGUI: ilColumnGUI @ilCtrl_Calls ilPDSelectedItemsBlockGUI: il...
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)
global $DIC
Definition: goto.php:24
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:138
ui()
Definition: ui.php:5