ILIAS
trunk Revision v12.0_alpha-16-g3e876e53c80
◀ ilDoc Overview
TermPageRetrieval.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Glossary\Media
;
22
23
use Generator;
24
use
ilCtrl
;
25
use
ilObjGlossary
;
26
use
ILIAS\MediaObjects\OverviewGUI\SubObjectRetrieval
;
27
use
ilGlossaryDefPageGUI
;
28
use
ilGlossaryTermGUI
;
29
use
ilTermDefinitionEditorGUI
;
30
31
class
TermPageRetrieval
implements
SubObjectRetrieval
32
{
33
protected
array
$term_data
;
34
35
public
function
__construct
(
36
protected
ilObjGlossary
$glossary,
37
protected
ilCtrl
$ctrl
38
) {
39
}
40
41
protected
function
getTermData
(): 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
}
52
56
public
function
getPossibleTypes
(): Generator
57
{
58
yield
'term:pg'
;
59
}
60
64
public
function
getAllIDsForType
(
string
$type): Generator
65
{
66
if
($type !==
'term:pg'
) {
67
return
;
68
}
69
foreach
($this->
getTermData
() as $term) {
70
yield (
int
) $term[
'id'
];
71
}
72
}
73
74
public
function
getLinkToSubObject
(
string
$type,
int
$id
): 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
}
89
90
public
function
getTitleOfSubObject
(
string
$type,
int
$id
): string
91
{
92
if
($type !==
'term:pg'
) {
93
return
''
;
94
}
95
return
$this->
getTermData
()[
$id
][
'term'
] ??
''
;
96
}
97
}
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
ILIAS\Glossary\Media\TermPageRetrieval
Definition:
TermPageRetrieval.php:32
ILIAS\Glossary\Media\TermPageRetrieval\getLinkToSubObject
getLinkToSubObject(string $type, int $id)
Definition:
TermPageRetrieval.php:74
ILIAS\Glossary\Media\TermPageRetrieval\__construct
__construct(protected ilObjGlossary $glossary, protected ilCtrl $ctrl)
Definition:
TermPageRetrieval.php:35
ILIAS\Glossary\Media\TermPageRetrieval\getPossibleTypes
getPossibleTypes()
Definition:
TermPageRetrieval.php:56
ILIAS\Glossary\Media\TermPageRetrieval\$term_data
array $term_data
Definition:
TermPageRetrieval.php:33
ILIAS\Glossary\Media\TermPageRetrieval\getTitleOfSubObject
getTitleOfSubObject(string $type, int $id)
Definition:
TermPageRetrieval.php:90
ILIAS\Glossary\Media\TermPageRetrieval\getTermData
getTermData()
Definition:
TermPageRetrieval.php:41
ILIAS\Glossary\Media\TermPageRetrieval\getAllIDsForType
getAllIDsForType(string $type)
Definition:
TermPageRetrieval.php:64
ilCtrl
Class ilCtrl provides processing control methods.
Definition:
class.ilCtrl.php:36
ilGlossaryDefPageGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilGlossaryDefPageGUI.php:27
ilGlossaryTermGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilGlossaryTermGUI.php:26
ilObjGlossary
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilObjGlossary.php:23
ilTermDefinitionEditorGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilTermDefinitionEditorGUI.php:25
ILIAS\MediaObjects\OverviewGUI\SubObjectRetrieval
Definition:
SubObjectRetrieval.php:26
ILIAS\Glossary\Media
Definition:
TermPageRetrieval.php:21
ILIAS\Repository\ctrl
ctrl()
Definition:
trait.GlobalDICGUIServices.php:62
components
ILIAS
Glossary
Media
TermPageRetrieval.php
Generated on Sun Nov 2 2025 23:02:33 for ILIAS by
1.9.4 (using
Doxyfile
)