ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ 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
use
ILIAS\GlobalScreen\Identification\IdentificationInterface
;
27
35
final
class
ContextRepository
36
{
37
private
array
$contexts
= [];
38
private
const
C_MAIN
=
'main'
;
39
private
const
C_DESKTOP
=
'desktop'
;
40
private
const
C_REPO
=
'repo'
;
41
private
const
C_ADMINISTRATION
=
'administration'
;
42
private
const
C_LTI
=
'lti'
;
43
44
protected
WrapperFactory
$wrapper
;
45
protected
Factory
$refinery
;
46
47
public
function
__construct
()
48
{
49
global
$DIC
;
50
$this->wrapper = $DIC->http()->wrapper();
51
$this->
refinery
= $DIC->refinery();
52
}
53
54
public
function
main
():
ScreenContext
55
{
56
return
$this->
get
(BasicScreenContext::class, self::C_MAIN);
57
}
58
59
public
function
internal
():
ScreenContext
60
{
61
return
$this->
get
(BasicScreenContext::class,
'internal'
);
62
}
63
64
public
function
external
():
ScreenContext
65
{
66
return
$this->
get
(BasicScreenContext::class,
'external'
);
67
}
68
69
public
function
desktop
():
ScreenContext
70
{
71
return
$this->
get
(BasicScreenContext::class, self::C_DESKTOP);
72
}
73
74
public
function
repository
():
ScreenContext
75
{
76
$context
= $this->
get
(BasicScreenContext::class, self::C_REPO);
77
$ref_id
= $this->wrapper->query()->has(
'ref_id'
)
78
? $this->wrapper->query()->retrieve(
'ref_id'
, $this->
refinery
->kindlyTo()->int())
79
: null;
80
if
(
$ref_id
) {
81
$context
=
$context
->withReferenceId(
new
ReferenceId
(
$ref_id
));
82
}
83
84
return
$context
;
85
}
86
87
public
function
administration
():
ScreenContext
88
{
89
return
$this->
get
(BasicScreenContext::class, self::C_ADMINISTRATION);
90
}
91
92
public
function
lti
():
ScreenContext
93
{
94
return
$this->
get
(BasicScreenContext::class, self::C_LTI);
95
}
96
97
private
function
get
(
string
$class_name,
string
$identifier):
ScreenContext
98
{
99
if
(!isset($this->contexts[$identifier])) {
100
$this->contexts[$identifier] =
new
$class_name($identifier);
101
}
102
103
return
$this->contexts[$identifier];
104
}
105
}
$context
$context
Definition:
webdav.php:31
ILIAS\GlobalScreen\ScreenContext\ContextRepository\external
function external()
Definition:
ContextRepository.php:64
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_DESKTOP
const C_DESKTOP
Definition:
ContextRepository.php:39
ILIAS\Data\ReferenceId
Definition:
ReferenceId.php:16
ILIAS\GlobalScreen\ScreenContext\ContextRepository\administration
administration()
Definition:
ContextRepository.php:87
ILIAS\GlobalScreen\ScreenContext\ContextRepository\$refinery
Factory $refinery
Definition:
ContextRepository.php:45
ILIAS\HTTP\Wrapper\WrapperFactory
Class WrapperFactory.
Definition:
WrapperFactory.php:26
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_REPO
const C_REPO
Definition:
ContextRepository.php:40
ILIAS\GlobalScreen\ScreenContext\ContextRepository\__construct
__construct()
Definition:
ContextRepository.php:47
ILIAS\GlobalScreen\ScreenContext\ContextRepository\lti
lti()
Definition:
ContextRepository.php:92
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_MAIN
const C_MAIN
Definition:
ContextRepository.php:38
ILIAS\GlobalScreen\ScreenContext\ContextRepository\main
main()
Definition:
ContextRepository.php:54
ILIAS\GlobalScreen\ScreenContext\ContextRepository
The Collection of all available Contexts in the System.
Definition:
ContextRepository.php:35
$DIC
global $DIC
Definition:
feed.php:28
ILIAS\Repository\refinery
refinery()
Definition:
trait.GlobalDICDomainServices.php:73
$ref_id
$ref_id
Definition:
ltiauth.php:67
IdentificationInterface
ILIAS\GlobalScreen\ScreenContext
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Factory
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_ADMINISTRATION
const C_ADMINISTRATION
Definition:
ContextRepository.php:41
ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_LTI
const C_LTI
Definition:
ContextRepository.php:42
ReferenceId
ILIAS\GlobalScreen\ScreenContext\ContextRepository\$wrapper
WrapperFactory $wrapper
Definition:
ContextRepository.php:44
WrapperFactory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\GlobalScreen\ScreenContext\ContextRepository\$contexts
array $contexts
Definition:
ContextRepository.php:37
ILIAS\GlobalScreen\ScreenContext\ContextRepository\repository
repository()
Definition:
ContextRepository.php:74
ILIAS\GlobalScreen\ScreenContext\ContextRepository\desktop
desktop()
Definition:
ContextRepository.php:69
ILIAS\GlobalScreen\ScreenContext\ScreenContext
Interface ScreenContext.
Definition:
ScreenContext.php:29
src
GlobalScreen
ScreenContext
ContextRepository.php
Generated on Wed Sep 10 2025 14:12:06 for ILIAS by
1.8.13 (using
Doxyfile
)