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

Public Member Functions

 __construct (ilObjUser $actor)
 
 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.

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

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  }
global $DIC
Definition: shib_login.php:26
+ 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.

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
+ 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: