ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Glossary\Media\TermPageRetrieval Class Reference
+ Inheritance diagram for ILIAS\Glossary\Media\TermPageRetrieval:
+ Collaboration diagram for ILIAS\Glossary\Media\TermPageRetrieval:

Public Member Functions

 __construct (protected ilObjGlossary $glossary, protected ilCtrl $ctrl)
 
 getPossibleTypes ()
 
 getAllIDsForType (string $type)
 
 getLinkToSubObject (string $type, int $id)
 
 getTitleOfSubObject (string $type, int $id)
 
 getPossibleTypes ()
 
 getAllIDsForType (string $type)
 
 getLinkToSubObject (string $type, int $id)
 
 getTitleOfSubObject (string $type, int $id)
 

Protected Member Functions

 getTermData ()
 

Protected Attributes

array $term_data
 

Detailed Description

Definition at line 31 of file TermPageRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Glossary\Media\TermPageRetrieval::__construct ( protected ilObjGlossary  $glossary,
protected ilCtrl  $ctrl 
)

Definition at line 35 of file TermPageRetrieval.php.

38 {
39 }

Member Function Documentation

◆ getAllIDsForType()

ILIAS\Glossary\Media\TermPageRetrieval::getAllIDsForType ( string  $type)
Returns
int[]

Implements ILIAS\MediaObjects\OverviewGUI\SubObjectRetrieval.

Definition at line 64 of file TermPageRetrieval.php.

64 : Generator
65 {
66 if ($type !== 'term:pg') {
67 return;
68 }
69 foreach ($this->getTermData() as $term) {
70 yield (int) $term['id'];
71 }
72 }

References ILIAS\Glossary\Media\TermPageRetrieval\getTermData().

+ Here is the call graph for this function:

◆ getLinkToSubObject()

ILIAS\Glossary\Media\TermPageRetrieval::getLinkToSubObject ( string  $type,
int  $id 
)

Implements ILIAS\MediaObjects\OverviewGUI\SubObjectRetrieval.

Definition at line 74 of file TermPageRetrieval.php.

74 : string
75 {
76 if ($type !== 'term:pg') {
77 return '';
78 }
79
80 $this->ctrl->setParameterByClass(ilGlossaryDefPageGUI::class, 'term_id', $id);
81 $link = $this->ctrl->getLinkTargetByClass([
82 ilGlossaryTermGUI::class,
83 ilTermDefinitionEditorGUI::class,
84 ilGlossaryDefPageGUI::class
85 ], 'edit');
86 $this->ctrl->clearParameterByClass(ilGlossaryDefPageGUI::class, 'term_id');
87 return $link;
88 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getPossibleTypes()

ILIAS\Glossary\Media\TermPageRetrieval::getPossibleTypes ( )
Returns
string[]

Implements ILIAS\MediaObjects\OverviewGUI\SubObjectRetrieval.

Definition at line 56 of file TermPageRetrieval.php.

56 : Generator
57 {
58 yield 'term:pg';
59 }

◆ getTermData()

ILIAS\Glossary\Media\TermPageRetrieval::getTermData ( )
protected

Definition at line 41 of file TermPageRetrieval.php.

41 : array
42 {
43 if (isset($this->term_data)) {
44 return $this->term_data;
45 }
46 $this->term_data = [];
47 foreach ($this->glossary->getTermList() as $term) {
48 $this->term_data[$term['id']] = $term;
49 }
50 return $this->term_data;
51 }

References ILIAS\Glossary\Media\TermPageRetrieval\$term_data.

Referenced by ILIAS\Glossary\Media\TermPageRetrieval\getAllIDsForType(), and ILIAS\Glossary\Media\TermPageRetrieval\getTitleOfSubObject().

+ Here is the caller graph for this function:

◆ getTitleOfSubObject()

ILIAS\Glossary\Media\TermPageRetrieval::getTitleOfSubObject ( string  $type,
int  $id 
)

Implements ILIAS\MediaObjects\OverviewGUI\SubObjectRetrieval.

Definition at line 90 of file TermPageRetrieval.php.

90 : string
91 {
92 if ($type !== 'term:pg') {
93 return '';
94 }
95 return $this->getTermData()[$id]['term'] ?? '';
96 }

References $id, and ILIAS\Glossary\Media\TermPageRetrieval\getTermData().

+ Here is the call graph for this function:

Field Documentation

◆ $term_data

array ILIAS\Glossary\Media\TermPageRetrieval::$term_data
protected

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