ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilPDSelectedItemsBlockSelectedItemsProvider Class Reference
+ Inheritance diagram for ilPDSelectedItemsBlockSelectedItemsProvider:
+ Collaboration diagram for ilPDSelectedItemsBlockSelectedItemsProvider:

Public Member Functions

 __construct (protected readonly ilObjUser $actor)
 
 getItems (array $object_type_white_list=[])
 
 getItems (array $object_type_white_list=[])
 

Protected Attributes

readonly ilFavouritesManager $fav_manager
 
readonly ilAccessHandler $access
 
readonly ilSetting $settings
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDSelectedItemsBlockSelectedItemsProvider::__construct ( protected readonly ilObjUser  $actor)

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

28 {
29 global $DIC;
30
31 $this->fav_manager = new ilFavouritesManager();
32 $this->access = $DIC->access();
33 $this->settings = $DIC->settings();
34 }
Manages favourites, currently the interface for other components, needs discussion.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\access(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getItems()

ilPDSelectedItemsBlockSelectedItemsProvider::getItems ( array  $object_type_white_list = [])

Implements ilPDSelectedItemsBlockProvider.

Definition at line 36 of file class.ilPDSelectedItemsBlockSelectedItemsProvider.php.

36 : array
37 {
38 $short_desc = $this->settings->get('rep_shorten_description');
39 $short_desc_max_length = (int) $this->settings->get('rep_shorten_description_length');
40
41 $favourites = $this->fav_manager->getFavouritesOfUser(
42 $this->actor->getId(),
43 count($object_type_white_list) > 0 ? $object_type_white_list : null
44 );
45 $access_granted_favourites = [];
46 foreach ($favourites as $idx => $favourite) {
47 if (!$this->access->checkAccess('visible', '', $favourite['ref_id'])) {
48 continue;
49 }
50
51 if ($short_desc && $short_desc_max_length !== 0) {
52 $favourite['description'] = ilStr::shortenTextExtended($favourite['description'], $short_desc_max_length, true);
53 }
54
55 $access_granted_favourites[$idx] = $favourite;
56 }
57 return $access_granted_favourites;
58 }
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)

References ILIAS\Repository\access(), ILIAS\Repository\int(), ILIAS\Repository\settings(), and ilStr\shortenTextExtended().

+ Here is the call graph for this function:

Field Documentation

◆ $access

readonly ilAccessHandler ilPDSelectedItemsBlockSelectedItemsProvider::$access
protected

◆ $fav_manager

readonly ilFavouritesManager ilPDSelectedItemsBlockSelectedItemsProvider::$fav_manager
protected

◆ $settings

readonly ilSetting ilPDSelectedItemsBlockSelectedItemsProvider::$settings
protected

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