Dashboard recommended content UI.
More...
◆ __construct()
ilDashboardRecommendedContentGUI::__construct |
( |
| ) |
|
Constructor.
Definition at line 61 of file class.ilDashboardRecommendedContentGUI.php.
62 {
64
65 $this->
user = $DIC->user();
68 $this->objDefinition =
$DIC[
"objDefinition"];
69 $this->
ui = $DIC->ui();
70 $this->lng =
$DIC->language();
71 $this->ctrl =
$DIC->ctrl();
73
74 $this->lng->loadLanguageModule("rep");
75
76 $this->requested_item_ref_id = (int)
$_GET[
"item_ref_id"];
77
78 $this->recommendations = $this->rec_manager->getOpenRecommendationsOfUser($this->
user->getId());
79 }
Manages favourites, currently the interface for other components, needs discussion.
Recommended content manager (business logic)
References $_GET, $DIC, settings(), ui(), and user().
◆ executeCommand()
ilDashboardRecommendedContentGUI::executeCommand |
( |
| ) |
|
Execute command.
Definition at line 84 of file class.ilDashboardRecommendedContentGUI.php.
85 {
87
88 $next_class =
$ctrl->getNextClass($this);
89 $cmd =
$ctrl->getCmd();
90
91 switch ($next_class) {
92 default:
93 if (in_array($cmd, array("remove", "makeFavourite"))) {
94 $this->$cmd();
95 }
96 }
97 }
References $ctrl.
◆ getListItemGroups()
ilDashboardRecommendedContentGUI::getListItemGroups |
( |
| ) |
|
|
protected |
Get items.
- Returns
- \ILIAS\UI\Component\Item\Group[]
Definition at line 122 of file class.ilDashboardRecommendedContentGUI.php.
122 : array
123 {
126
127 $item_groups = [];
128 $list_items = [];
129
130 foreach ($this->recommendations as $ref_id) {
131 try {
132 if (!
$DIC->access()->checkAccess(
'visible',
'', $ref_id)) {
133 continue;
134 }
135 $list_items[] = $this->getListItemForData($ref_id);
137 continue;
138 }
139 }
140
141 $item_groups[] =
$factory->item()->group(
"", $list_items);
142
143 return $item_groups;
144 }
Base class for ILIAS Exception handling.
References $DIC, Vendor\Package\$e, and $factory.
◆ makeFavourite()
ilDashboardRecommendedContentGUI::makeFavourite |
( |
| ) |
|
|
protected |
◆ remove()
ilDashboardRecommendedContentGUI::remove |
( |
| ) |
|
|
protected |
◆ render()
ilDashboardRecommendedContentGUI::render |
( |
| ) |
|
Render.
- Returns
- string
Definition at line 104 of file class.ilDashboardRecommendedContentGUI.php.
105 {
106 if (count($this->recommendations) == 0) {
107 return "";
108 }
109 return $this->
ui->renderer()->render(
110 $this->
ui->factory()->panel()->listing()->standard(
111 $this->lng->txt("rep_recommended_content"),
112 $this->getListItemGroups()
113 )
114 );
115 }
References ui().
◆ $ctrl
ilDashboardRecommendedContentGUI::$ctrl |
|
protected |
◆ $fav_manager
ilDashboardRecommendedContentGUI::$fav_manager |
|
protected |
◆ $list_by_type
ilDashboardRecommendedContentGUI::$list_by_type = [] |
|
static |
◆ $lng
ilDashboardRecommendedContentGUI::$lng |
|
protected |
◆ $rec_manager
ilDashboardRecommendedContentGUI::$rec_manager |
|
protected |
◆ $recommendations
ilDashboardRecommendedContentGUI::$recommendations |
|
protected |
◆ $settings
ilDashboardRecommendedContentGUI::$settings |
|
protected |
◆ $ui
ilDashboardRecommendedContentGUI::$ui |
|
protected |
◆ $user
ilDashboardRecommendedContentGUI::$user |
|
protected |
The documentation for this class was generated from the following file: