ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ContextRepository.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\ScreenContext
;
22
23
use
ILIAS\Data\ReferenceId
;
24
use
ILIAS\HTTP\Wrapper\WrapperFactory
;
25
use
ILIAS\Refinery\Factory
;
26
34
final
class
ContextRepository
35
{
36
private
array
$contexts
= [];
40
private
const
C_MAIN
=
'main'
;
44
private
const
C_DESKTOP
=
'desktop'
;
48
private
const
C_REPO
=
'repo'
;
52
private
const
C_ADMINISTRATION
=
'administration'
;
56
private
const
C_LTI
=
'lti'
;
57
58
protected
WrapperFactory
$wrapper
;
59
protected
Factory
$refinery
;
60
61
public
function
__construct
()
62
{
63
global
$DIC
;
64
$this->wrapper = $DIC->http()->wrapper();
65
$this->
refinery
= $DIC->refinery();
66
}
67
68
public
function
main
():
ScreenContext
69
{
70
return
$this->
get
(BasicScreenContext::class, self::C_MAIN);
71
}
72
73
public
function
internal
():
ScreenContext
74
{
75
return
$this->
get
(BasicScreenContext::class,
'internal'
);
76
}
77
78
public
function
external
():
ScreenContext
79
{
80
return
$this->
get
(BasicScreenContext::class,
'external'
);
81
}
82
83
public
function
desktop
():
ScreenContext
84
{
85
return
$this->
get
(BasicScreenContext::class, self::C_DESKTOP);
86
}
87
88
public
function
repository
():
ScreenContext
89
{
90
$context
= $this->
get
(BasicScreenContext::class, self::C_REPO);
91
$ref_id
= $this->wrapper->query()->has(
'ref_id'
)
92
? $this->wrapper->query()->retrieve(
'ref_id'
, $this->
refinery
->kindlyTo()->int())
93
:
null
;
94
if
(
$ref_id
) {
95
return
$context
->withReferenceId(
new
ReferenceId
(
$ref_id
));
96
}
97
98
return
$context
;
99
}
100
101
public
function
administration
():
ScreenContext
102
{
103
return
$this->
get
(BasicScreenContext::class, self::C_ADMINISTRATION);
104
}
105
106
public
function
lti
():
ScreenContext
107
{
108
return
$this->
get
(BasicScreenContext::class, self::C_LTI);
109
}
110
111
private
function
get
(
string
$class_name,
string
$identifier):
ScreenContext
112
{
113
if
(!isset($this->contexts[$identifier])) {
114
$this->contexts[$identifier] =
new
$class_name($identifier);
115
}
116
117
return
$this->contexts[$identifier];
118
}
119
}
$context
$context
Definition:
webdav.php:31
ILIAS\GlobalScreen\ScreenContext\ContextRepository\external
function external()
Definition:
ContextRepository.php:78
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_DESKTOP
const C_DESKTOP
Definition:
ContextRepository.php:44
ILIAS\Data\ReferenceId
Definition:
ReferenceId.php:32
ILIAS\GlobalScreen\ScreenContext\ContextRepository\administration
administration()
Definition:
ContextRepository.php:101
ILIAS\GlobalScreen\ScreenContext\ContextRepository\$refinery
Factory $refinery
Definition:
ContextRepository.php:59
ILIAS\MetaData\Vocabularies\Controlled\Database\Wrapper\WrapperFactory
Class WrapperFactory.
Definition:
WrapperFactory.php:29
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_REPO
const C_REPO
Definition:
ContextRepository.php:48
ILIAS\GlobalScreen\ScreenContext\ContextRepository\__construct
__construct()
Definition:
ContextRepository.php:61
ILIAS\GlobalScreen\ScreenContext\ContextRepository\lti
lti()
Definition:
ContextRepository.php:106
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_MAIN
const C_MAIN
Definition:
ContextRepository.php:40
ILIAS\GlobalScreen\ScreenContext\ContextRepository\main
main()
Definition:
ContextRepository.php:68
ILIAS\GlobalScreen\ScreenContext\ContextRepository
The Collection of all available Contexts in the System.
Definition:
ContextRepository.php:34
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ILIAS\Repository\refinery
refinery()
Definition:
trait.GlobalDICDomainServices.php:76
$ref_id
$ref_id
Definition:
ltiauth.php:65
ILIAS\GlobalScreen\ScreenContext
Factory
ILIAS\Refinery\Factory
Definition:
Factory.php:25
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_ADMINISTRATION
const C_ADMINISTRATION
Definition:
ContextRepository.php:52
$DIC
global $DIC
Definition:
shib_login.php:26
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_LTI
const C_LTI
Definition:
ContextRepository.php:56
ReferenceId
ILIAS\GlobalScreen\ScreenContext\ContextRepository\$wrapper
WrapperFactory $wrapper
Definition:
ContextRepository.php:58
WrapperFactory
ILIAS\GlobalScreen\ScreenContext\ContextRepository\$contexts
array $contexts
Definition:
ContextRepository.php:36
ILIAS\GlobalScreen\ScreenContext\ContextRepository\repository
repository()
Definition:
ContextRepository.php:88
ILIAS\GlobalScreen\ScreenContext\ContextRepository\desktop
desktop()
Definition:
ContextRepository.php:83
ILIAS\GlobalScreen\ScreenContext\ScreenContext
Interface ScreenContext.
Definition:
ScreenContext.php:29
components
ILIAS
GlobalScreen
src
ScreenContext
ContextRepository.php
Generated on Sun Aug 31 2025 23:03:03 for ILIAS by
1.8.13 (using
Doxyfile
)