ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPDSelectedItemsBlockSelectedItemsProvider Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPDSelectedItemsBlockSelectedItemsProvider:
+ Collaboration diagram for ilPDSelectedItemsBlockSelectedItemsProvider:

Public Member Functions

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

Protected Attributes

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

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Constructor & Destructor Documentation

◆ __construct()

ilPDSelectedItemsBlockSelectedItemsProvider::__construct ( ilObjUser  $actor)

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

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

27  {
28  global $DIC;
29 
30  $this->actor = $actor;
31  $this->fav_manager = new ilFavouritesManager();
32  $this->access = $DIC->access();
33  $this->settings = $DIC->settings();
34  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getItems()

ilPDSelectedItemsBlockSelectedItemsProvider::getItems ( array  $object_type_white_list = array())
Parameters
array$object_type_white_listAn optional array of object_types used for filter purposes
Returns
array An array of repository items, each given as a structured array

Implements ilPDSelectedItemsBlockProvider.

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

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

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)
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilPDSelectedItemsBlockSelectedItemsProvider::$access
protected

◆ $actor

ilObjUser ilPDSelectedItemsBlockSelectedItemsProvider::$actor
protected

Definition at line 21 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: