ILIAS  release_8 Revision v8.23
ilDashboardRecommendedContentGUI Class Reference

Dashboard recommended content UI. More...

+ Collaboration diagram for ilDashboardRecommendedContentGUI:

Public Member Functions

 executeCommand ()
 
 render ()
 

Static Public Attributes

static array $list_by_type = []
 

Protected Member Functions

 getListItemGroups ()
 
 remove ()
 
 makeFavourite ()
 

Protected Attributes

ilObjUser $user
 
ilRecommendedContentManager $rec_manager
 
array $recommendations
 
ILIAS DI UIServices $ui
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilSetting $settings
 
ilFavouritesManager $fav_manager
 
ilObjectDefinition $objDefinition
 
int $requested_item_ref_id
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Dashboard recommended content UI.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 27 of file class.ilDashboardRecommendedContentGUI.php.

Member Function Documentation

◆ executeCommand()

ilDashboardRecommendedContentGUI::executeCommand ( )

Definition at line 66 of file class.ilDashboardRecommendedContentGUI.php.

References $ctrl, ilCtrl\getCmd(), and ilCtrl\getNextClass().

66  : void
67  {
69 
70  $next_class = $ctrl->getNextClass($this);
71  $cmd = $ctrl->getCmd();
72 
73  switch ($next_class) {
74  default:
75  if (in_array($cmd, ["remove", "makeFavourite"])) {
76  $this->$cmd();
77  }
78  }
79  }
getCmd(string $fallback_command=null)
getNextClass($a_gui_class=null)
+ Here is the call graph for this function:

◆ getListItemGroups()

ilDashboardRecommendedContentGUI::getListItemGroups ( )
protected
Returns
Group[]

Definition at line 97 of file class.ilDashboardRecommendedContentGUI.php.

References $ctrl, $DIC, Vendor\Package\$e, $factory, $location, $ref_id, $type, ilObject\_lookupDescription(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilObjectActivation\addListGUIActivationProperty(), ilCtrl\clearParameterByClass(), ilCtrl\getLinkTarget(), ILIAS\Repository\int(), ilCtrl\setParameter(), ILIAS\Repository\settings(), and ilStr\shortenTextExtended().

Referenced by render().

97  : array
98  {
99  global $DIC;
100  $factory = $DIC->ui()->factory();
101 
102  $item_groups = [];
103  $list_items = [];
104 
105  foreach ($this->recommendations as $ref_id) {
106  try {
107  if (!$DIC->access()->checkAccess('visible', '', $ref_id)) {
108  continue;
109  }
110  $list_items[] = $this->getListItemForData($ref_id);
111  } catch (ilException $e) {
112  continue;
113  }
114  }
115 
116  $item_groups[] = $factory->item()->group("", $list_items);
117 
118  return $item_groups;
119  }
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeFavourite()

ilDashboardRecommendedContentGUI::makeFavourite ( )
protected

Definition at line 222 of file class.ilDashboardRecommendedContentGUI.php.

References $ctrl, $lng, $requested_item_ref_id, ilCtrl\returnToParent(), ilLanguage\txt(), and ILIAS\Repository\user().

222  : void
223  {
224  $ctrl = $this->ctrl;
225  $lng = $this->lng;
226  $this->fav_manager->add($this->user->getId(), $this->requested_item_ref_id);
227  $this->main_tpl->setOnScreenMessage('success', $lng->txt("dash_added_to_favs"), true);
228  $ctrl->returnToParent($this);
229  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
returnToParent(object $a_gui_obj, string $a_anchor=null)
+ Here is the call graph for this function:

◆ remove()

ilDashboardRecommendedContentGUI::remove ( )
protected

Definition at line 213 of file class.ilDashboardRecommendedContentGUI.php.

References $ctrl, $lng, $requested_item_ref_id, ilCtrl\returnToParent(), ilLanguage\txt(), and ILIAS\Repository\user().

213  : void
214  {
215  $ctrl = $this->ctrl;
216  $lng = $this->lng;
217  $this->rec_manager->declineObjectRecommendation($this->user->getId(), $this->requested_item_ref_id);
218  $this->main_tpl->setOnScreenMessage('success', $lng->txt("dash_item_removed"), true);
219  $ctrl->returnToParent($this);
220  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
returnToParent(object $a_gui_obj, string $a_anchor=null)
+ Here is the call graph for this function:

◆ render()

ilDashboardRecommendedContentGUI::render ( )

Definition at line 81 of file class.ilDashboardRecommendedContentGUI.php.

References getListItemGroups(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

81  : string
82  {
83  if (count($this->recommendations) === 0) {
84  return "";
85  }
86  return $this->ui->renderer()->render(
87  $this->ui->factory()->panel()->listing()->standard(
88  $this->lng->txt("rep_recommended_content"),
89  $this->getListItemGroups()
90  )
91  );
92  }
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilDashboardRecommendedContentGUI::$ctrl
protected

◆ $fav_manager

ilFavouritesManager ilDashboardRecommendedContentGUI::$fav_manager
protected

Definition at line 38 of file class.ilDashboardRecommendedContentGUI.php.

◆ $list_by_type

array ilDashboardRecommendedContentGUI::$list_by_type = []
static

Definition at line 33 of file class.ilDashboardRecommendedContentGUI.php.

◆ $lng

ilLanguage ilDashboardRecommendedContentGUI::$lng
protected

Definition at line 35 of file class.ilDashboardRecommendedContentGUI.php.

Referenced by makeFavourite(), and remove().

◆ $main_tpl

ilGlobalTemplateInterface ilDashboardRecommendedContentGUI::$main_tpl
private

Definition at line 41 of file class.ilDashboardRecommendedContentGUI.php.

◆ $objDefinition

ilObjectDefinition ilDashboardRecommendedContentGUI::$objDefinition
protected

Definition at line 39 of file class.ilDashboardRecommendedContentGUI.php.

◆ $rec_manager

ilRecommendedContentManager ilDashboardRecommendedContentGUI::$rec_manager
protected

Definition at line 30 of file class.ilDashboardRecommendedContentGUI.php.

◆ $recommendations

array ilDashboardRecommendedContentGUI::$recommendations
protected

Definition at line 32 of file class.ilDashboardRecommendedContentGUI.php.

◆ $requested_item_ref_id

int ilDashboardRecommendedContentGUI::$requested_item_ref_id
protected

Definition at line 40 of file class.ilDashboardRecommendedContentGUI.php.

Referenced by makeFavourite(), and remove().

◆ $settings

ilSetting ilDashboardRecommendedContentGUI::$settings
protected

Definition at line 37 of file class.ilDashboardRecommendedContentGUI.php.

◆ $ui

ILIAS DI UIServices ilDashboardRecommendedContentGUI::$ui
protected

Definition at line 34 of file class.ilDashboardRecommendedContentGUI.php.

◆ $user

ilObjUser ilDashboardRecommendedContentGUI::$user
protected

Definition at line 29 of file class.ilDashboardRecommendedContentGUI.php.


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