ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\MediaPool\Search\SubitemPropertiesReader Class Reference
+ Inheritance diagram for ILIAS\MediaPool\Search\SubitemPropertiesReader:
+ Collaboration diagram for ILIAS\MediaPool\Search\SubitemPropertiesReader:

Public Member Functions

 init (Container $dic)
 
 getSubitemProperties (PropertiesFactory $factory, int $parent_ref_id, ID ... $subitem_ids)
 Order of the output should respect the order of the subitem_ids. More...
 
 init (Container $dic)
 
 getSubitemProperties (PropertiesFactory $factory, int $parent_ref_id, ID ... $subitem_ids)
 Order of the output should respect the order of the subitem_ids. More...
 

Static Public Member Functions

static type ()
 Type of the parent object. More...
 
static type ()
 Type of the parent object. More...
 

Protected Attributes

ilLanguage $lng
 
DataFactory $data_factory
 
StaticURL $static_url
 
ilCtrlInterface $ctrl
 

Detailed Description

Definition at line 36 of file SubitemPropertiesReader.php.

Member Function Documentation

◆ getSubitemProperties()

ILIAS\MediaPool\Search\SubitemPropertiesReader::getSubitemProperties ( PropertiesFactory  $factory,
int  $parent_ref_id,
ID ...  $subitem_ids 
)

Order of the output should respect the order of the subitem_ids.

Subitems that should not be shown in the search results should not be included in the output (read access on the parent object is already checked).

Returns
Properties[]

Implements ILIAS\Search\Presentation\Result\Subitem\PropertiesReader.

Definition at line 56 of file SubitemPropertiesReader.php.

60 : Generator {
61 foreach ($subitem_ids as $subitem_id) {
62 $link = null;
63 switch ($subitem_id->type()) {
64 case 'fold':
65 $link = $this->static_url->builder()->build(
66 'mep',
67 $this->data_factory->refId($parent_ref_id),
68 [$subitem_id->id()]
69 );
70 break;
71
72 case 'mob':
73 $this->ctrl->setParameterByClass(ilMediaPoolPresentationGUI::class, 'ref_id', $parent_ref_id);
74 $this->ctrl->setParameterByClass(ilMediaPoolPresentationGUI::class, 'force_filter', $subitem_id->id());
75 $link = $this->data_factory->uri(rtrim(ILIAS_HTTP_PATH, '/') . '/' .
76 $this->ctrl->getLinkTargetByClass(ilMediaPoolPresentationGUI::class, 'allMedia'));
77 $this->ctrl->clearParameterByClass(ilMediaPoolPresentationGUI::class, 'force_filter');
78 $this->ctrl->clearParameterByClass(ilMediaPoolPresentationGUI::class, 'ref_id');
79 break;
80
81 case 'pg':
82 $pool = new ilObjMediaPool($parent_ref_id);
83 $parent_id = $pool->getParentId((int) $subitem_id->id());
84 $link = $this->static_url->builder()->build(
85 'mep',
86 $this->data_factory->refId($parent_ref_id),
87 $parent_id === null ? [] : [$parent_id]
88 );
89 break;
90 }
91 if ($link === null) {
92 continue;
93 }
94 yield $factory->get(
95 $subitem_id,
96 ilMediaPoolItem::lookupTitle((int) $subitem_id->id()),
97 $link,
98 false,
99 $this->lng->txt('obj_' . $subitem_id->type())
100 );
101 }
102 }
static lookupTitle(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ILIAS\Search\Presentation\Result\Subitem\PropertiesFactory\get(), and ilMediaPoolItem\lookupTitle().

+ Here is the call graph for this function:

◆ init()

ILIAS\MediaPool\Search\SubitemPropertiesReader::init ( Container  $dic)

Implements ILIAS\Search\Presentation\Result\Subitem\PropertiesReader.

Definition at line 48 of file SubitemPropertiesReader.php.

48 : void
49 {
50 $this->lng = $dic->language();
51 $this->data_factory = new DataFactory();
52 $this->static_url = $dic['static_url'];
53 $this->ctrl = $dic->ctrl();
54 }
$dic
Definition: ltiresult.php:33

References $dic, ILIAS\DI\Container\ctrl(), ILIAS\Repository\ctrl(), ILIAS\DI\Container\language(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ type()

static ILIAS\MediaPool\Search\SubitemPropertiesReader::type ( )
static

Type of the parent object.

Should do nothing but return a string, is called during setup.

Implements ILIAS\Search\Presentation\Result\Subitem\PropertiesReader.

Definition at line 43 of file SubitemPropertiesReader.php.

43 : string
44 {
45 return 'mep';
46 }

Field Documentation

◆ $ctrl

ilCtrlInterface ILIAS\MediaPool\Search\SubitemPropertiesReader::$ctrl
protected

Definition at line 41 of file SubitemPropertiesReader.php.

◆ $data_factory

DataFactory ILIAS\MediaPool\Search\SubitemPropertiesReader::$data_factory
protected

Definition at line 39 of file SubitemPropertiesReader.php.

◆ $lng

ilLanguage ILIAS\MediaPool\Search\SubitemPropertiesReader::$lng
protected

Definition at line 38 of file SubitemPropertiesReader.php.

◆ $static_url

StaticURL ILIAS\MediaPool\Search\SubitemPropertiesReader::$static_url
protected

Definition at line 40 of file SubitemPropertiesReader.php.


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