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

Public Member Functions

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

Protected Attributes

ilObjUser $actor
 
ilFavouritesManager $fav_manager
 
ilAccessHandler $access
 
ilSetting $settings
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDSelectedItemsBlockSelectedItemsProvider::__construct ( ilObjUser  $actor)

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

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

References $actor, $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 38 of file class.ilPDSelectedItemsBlockSelectedItemsProvider.php.

38 : array
39 {
40 $short_desc = $this->settings->get('rep_shorten_description');
41 $short_desc_max_length = (int) $this->settings->get('rep_shorten_description_length');
42
43 $favourites = $this->fav_manager->getFavouritesOfUser(
44 $this->actor->getId(),
45 count($object_type_white_list) > 0 ? $object_type_white_list : null
46 );
47 $access_granted_favourites = [];
48 foreach ($favourites as $idx => $favourite) {
49 if (!$this->access->checkAccess('visible', '', $favourite['ref_id'])) {
50 continue;
51 }
52
53 if ($short_desc && $short_desc_max_length !== 0) {
54 $favourite['description'] = ilStr::shortenTextExtended($favourite['description'], $short_desc_max_length, true);
55 }
56
57 $access_granted_favourites[$idx] = $favourite;
58 }
59 return $access_granted_favourites;
60 }
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

ilAccessHandler ilPDSelectedItemsBlockSelectedItemsProvider::$access
protected

◆ $actor

ilObjUser ilPDSelectedItemsBlockSelectedItemsProvider::$actor
protected

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

Referenced by __construct().

◆ $fav_manager

ilFavouritesManager ilPDSelectedItemsBlockSelectedItemsProvider::$fav_manager
protected

◆ $settings

ilSetting ilPDSelectedItemsBlockSelectedItemsProvider::$settings
protected

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