ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Wiki\Search\SubitemPropertiesReader Class Reference
+ Inheritance diagram for ILIAS\Wiki\Search\SubitemPropertiesReader:
+ Collaboration diagram for ILIAS\Wiki\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 Member Functions

 getPropertiesForWikiPage (PropertiesFactory $factory, int $parent_ref_id, ID $subitem_id, string $title)
 
 getPropertiesForFile (PropertiesFactory $factory, int $parent_ref_id, ID $subitem_id)
 

Protected Attributes

ilLanguage $lng
 
DataFactory $data_factory
 
ilCtrlInterface $ctrl
 

Detailed Description

Definition at line 38 of file SubitemPropertiesReader.php.

Member Function Documentation

◆ getPropertiesForFile()

ILIAS\Wiki\Search\SubitemPropertiesReader::getPropertiesForFile ( PropertiesFactory  $factory,
int  $parent_ref_id,
ID  $subitem_id 
)
protected

Definition at line 97 of file SubitemPropertiesReader.php.

101 : Properties {
102 $this->ctrl->setParameterByClass(ilWikiPageGUI::class, 'file_id', 'il__file_' . $subitem_id->id());
103 $this->ctrl->setParameterByClass(ilWikiPageGUI::class, 'ref_id', $parent_ref_id);
104 $link = rtrim(ILIAS_HTTP_PATH, '/') . '/' .
105 $this->ctrl->getLinkTargetByClass([ilWikiHandlerGUI::class, ilObjWikiGUI::class, ilWikiPageGUI::class], 'downloadFile');
106 $this->ctrl->clearParameterByClass(ilWikiPageGUI::class, 'file_id');
107 $this->ctrl->clearParameterByClass(ilWikiPageGUI::class, 'ref_id');
108 return $factory->get(
109 $subitem_id,
110 ilObject::_lookupTitle((int) $subitem_id->id()),
111 $this->data_factory->uri($link),
112 false,
113 $this->lng->txt('obj_file')
114 );
115 }
static _lookupTitle(int $obj_id)

Referenced by ILIAS\Wiki\Search\SubitemPropertiesReader\getSubitemProperties().

+ Here is the caller graph for this function:

◆ getPropertiesForWikiPage()

ILIAS\Wiki\Search\SubitemPropertiesReader::getPropertiesForWikiPage ( PropertiesFactory  $factory,
int  $parent_ref_id,
ID  $subitem_id,
string  $title 
)
protected

Definition at line 80 of file SubitemPropertiesReader.php.

85 : Properties {
86 $link = rtrim(ILIAS_HTTP_PATH, '/') . '/' .
87 ilObjWikiGUI::getGotoLink($parent_ref_id, $title) . '&srcstring=1';
88 return $factory->get(
89 $subitem_id,
90 $title,
91 $this->data_factory->uri($link),
92 false,
93 $this->lng->txt('obj_pg')
94 );
95 }
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")

Referenced by ILIAS\Wiki\Search\SubitemPropertiesReader\getSubitemProperties().

+ Here is the caller graph for this function:

◆ getSubitemProperties()

ILIAS\Wiki\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 $obj_id = ilObject::_lookupObjId($parent_ref_id);
62 foreach ($subitem_ids as $subitem_id) {
63 switch ($subitem_id->type()) {
64 case 'file':
65 if (ilObject::_exists((int) $subitem_id->id())) {
66 yield $this->getPropertiesForFile($factory, $parent_ref_id, $subitem_id);
67 }
68 break;
69
70 case 'wpg':
71 $title = (string) ilWikiPage::lookupTitle((int) $subitem_id->id());
72 if ($title !== '') {
73 yield $this->getPropertiesForWikiPage($factory, $parent_ref_id, $subitem_id, $title);
74 }
75 break;
76 }
77 }
78 }
getPropertiesForFile(PropertiesFactory $factory, int $parent_ref_id, ID $subitem_id)
getPropertiesForWikiPage(PropertiesFactory $factory, int $parent_ref_id, ID $subitem_id, string $title)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupObjId(int $ref_id)
static lookupTitle(int $a_page_id, string $lang="-")

References ilObject\_exists(), ILIAS\Wiki\Search\SubitemPropertiesReader\getPropertiesForFile(), ILIAS\Wiki\Search\SubitemPropertiesReader\getPropertiesForWikiPage(), and ilWikiPage\lookupTitle().

+ Here is the call graph for this function:

◆ init()

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

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

Definition at line 49 of file SubitemPropertiesReader.php.

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

References 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\Wiki\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 44 of file SubitemPropertiesReader.php.

44 : string
45 {
46 return 'wiki';
47 }

Field Documentation

◆ $ctrl

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

Definition at line 42 of file SubitemPropertiesReader.php.

◆ $data_factory

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

Definition at line 41 of file SubitemPropertiesReader.php.

◆ $lng

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

Definition at line 40 of file SubitemPropertiesReader.php.


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