ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDashboardRecommendedContentGUI Class Reference
+ Inheritance diagram for ilDashboardRecommendedContentGUI:
+ Collaboration diagram for ilDashboardRecommendedContentGUI:

Public Member Functions

 __construct ()
 
 initViewSettings ()
 
 emptyHandling ()
 
 initData ()
 
 getBlockType ()
 
 addCustomCommandsToActionMenu (ilObjectListGUI $itemListGui, int $ref_id)
 
 confirmedRemove (array $ids)
 
 removeMultipleEnabled ()
 
 getRemoveMultipleActionText ()
 
- Public Member Functions inherited from ilDashboardBlockGUI
 __construct ()
 
 initViewSettings ()
 
 initData ()
 
 emptyHandling ()
 
 addCustomCommandsToActionMenu (ilObjectListGUI $itemListGui, int $ref_id)
 
 getNoItemFoundContent ()
 
 getViewSettings ()
 
 init ()
 
 getHTML ()
 
 setData (array $a_data)
 
 getData ()
 
 addCommandActions ()
 
 getRemoveModal ()
 
 executeCommand ()
 
 manually ()
 
 getViewControlsForPanel ()
 
 viewDashboardObject ()
 
 changePDItemSortingObject ()
 
 changePDItemPresentationObject ()
 
 getItemGroups ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 removeMultipleEnabled ()
 
 getRemoveMultipleActionText ()
 
 confirmedRemove (array $ids)
 
 byType (string $a_type)
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 checkOffset (int $offset)
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 getNoItemFoundContent ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Protected Member Functions

 removeRecommendationObject ()
 
- Protected Member Functions inherited from ilDashboardBlockGUI
 getCardForData (BlockDTO $data)
 
 getListItemGroups ()
 Get items. More...
 
 getListItemForDataDTO (BlockDTO $data)
 
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 initAndShow ()
 
 isRootNode (int $refId)
 
 getRepositoryTitle ()
 
 getManageFields ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 
- Protected Attributes inherited from ilDashboardBlockGUI
ilFavouritesManager $favourites_manager
 
int $requested_item_ref_id
 
ilSetting $settings
 
ilLogger $logging
 
Services $http
 
ilPDSelectedItemsBlockViewSettings $viewSettings
 
array $data
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
object $gui_object
 
ILIAS Container Block StandardGUIRequest $request
 
ILIAS Container Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilDashboardRecommendedContentGUI::__construct ( )

Reimplemented from ilDashboardBlockGUI.

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

26 {
27 global $DIC;
29 $request = $DIC->repository()->internal()->gui()->standardRequest();
30 }
ILIAS Container Block StandardGUIRequest $request
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilBlockGUI\$request, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomCommandsToActionMenu()

ilDashboardRecommendedContentGUI::addCustomCommandsToActionMenu ( ilObjectListGUI  $itemListGui,
int  $ref_id 
)

Reimplemented from ilDashboardBlockGUI.

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

108 : void
109 {
110 $this->ctrl->setParameter($this, "item_ref_id", $ref_id);
111 $itemListGui->addCustomCommand(
112 $this->ctrl->getLinkTarget($this, "removeRecommendation"),
113 "dash_remove_from_list"
114 );
115 }
addCustomCommand(string $link, string $lang_var, string $frame='', string $onclick='')
$ref_id
Definition: ltiauth.php:66

References $ref_id, ilObjectListGUI\addCustomCommand(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmedRemove()

ilDashboardRecommendedContentGUI::confirmedRemove ( array  $ids)
Parameters
int[]$ids

Reimplemented from ilDashboardBlockGUI.

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

117 : void
118 {
119 $rec_manager = new ilRecommendedContentManager();
120 foreach ($ids as $ref_id) {
121 $rec_manager->declineObjectRecommendation($this->user->getId(), $ref_id);
122 }
123 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('pd_remove_multi_confirm'), true);
124 $this->ctrl->returnToParent($this);
125 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ref_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ emptyHandling()

ilDashboardRecommendedContentGUI::emptyHandling ( )

Reimplemented from ilDashboardBlockGUI.

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

50 : string
51 {
52 return '';
53 }

◆ getBlockType()

ilDashboardRecommendedContentGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

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

103 : string
104 {
105 return 'pdrecc';
106 }

◆ getRemoveMultipleActionText()

ilDashboardRecommendedContentGUI::getRemoveMultipleActionText ( )

Reimplemented from ilDashboardBlockGUI.

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

132 : string
133 {
134 return $this->lng->txt('pd_remove_multiple');
135 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initData()

ilDashboardRecommendedContentGUI::initData ( )

Reimplemented from ilDashboardBlockGUI.

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

55 : void
56 {
57 $rec_manager = new ilRecommendedContentManager();
58 $recommendations = $rec_manager->getOpenRecommendationsOfUser($this->user->getId());
59
60 $short_desc = $this->settings->get("rep_shorten_description");
61 $short_desc_max_length = (int) $this->settings->get("rep_shorten_description_length");
63
64 $recommendations = array_map(static function (int $ref_id) use ($short_desc, $short_desc_max_length): BlockDTO {
66 $desc = ilObject::_lookupDescription($obj_id);
67 if ($short_desc && $short_desc_max_length !== 0) {
68 $desc = ilStr::shortenTextExtended($desc, $short_desc_max_length, true);
69 }
71 $start = null;
72 $end = null;
73 if ($obj) {
74 switch (get_class($obj)) {
75 case ilObjGroup::class:
76 $start = new ilDateTime($obj->getStart());
77 $end = new ilDateTime($obj->getEnd());
78 break;
79 case ilObjCourse::class:
80 $start = new ilDateTime($obj->getActivationStart());
81 $end = new ilDateTime($obj->getActivationEnd());
82 break;
83 case ilObjTest::class:
84 $start = new ilDateTime($obj->getStartingTime());
85 $end = new ilDateTime($obj->getEndingTime());
86 break;
87 }
88 }
89 return new BlockDTO(
90 ilObject::_lookupType($obj_id),
91 $ref_id,
92 $obj_id,
94 $desc,
95 $start,
96 $end,
97 );
98 }, $recommendations);
99
100 $this->setData(['' => $recommendations]);
101 }
@classDescription Date and time handling
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
static _lookupDescription(int $obj_id)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)

References ilBlockGUI\$ctrl, $ref_id, ilObject\_lookupDescription(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilObjectFactory\getInstanceByRefId(), ILIAS\Repository\int(), ilDashboardBlockGUI\setData(), ILIAS\Repository\settings(), ilStr\shortenTextExtended(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ initViewSettings()

ilDashboardRecommendedContentGUI::initViewSettings ( )

Reimplemented from ilDashboardBlockGUI.

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

40 : void
41 {
42 $this->viewSettings = new ilPDSelectedItemsBlockViewSettings(
43 $this->user,
45 );
46
47 $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
48 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\user(), and ilPDSelectedItemsBlockConstants\VIEW_RECOMMENDED_CONTENT.

+ Here is the call graph for this function:

◆ removeMultipleEnabled()

ilDashboardRecommendedContentGUI::removeMultipleEnabled ( )

Reimplemented from ilDashboardBlockGUI.

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

127 : bool
128 {
129 return true;
130 }

◆ removeRecommendationObject()

ilDashboardRecommendedContentGUI::removeRecommendationObject ( )
protected

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

32 : void
33 {
34 $rec_manager = new ilRecommendedContentManager();
35 $rec_manager->declineObjectRecommendation($this->user->getId(), $this->requested_item_ref_id);
36 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("dash_item_removed"), true);
37 $this->ctrl->returnToParent($this);
38 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

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