ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
Context.php
Go to the documentation of this file.
1
<?php
2
19
namespace
ILIAS\StaticURL
;
20
21
use
ILIAS\HTTP\Services
;
22
use
ILIAS\DI\Container
;
23
use
ILIAS\Refinery\Factory
;
24
28
final
class
Context
29
{
30
public
function
__construct
(
private
Container
$container
)
31
{
32
}
33
34
public
function
getUserLanguage
(): string
35
{
36
return
$this->container->user()->getCurrentLanguage();
37
}
38
39
public
function
refinery
():
Factory
40
{
41
return
$this->container->refinery();
42
}
43
44
public
function
lng
(): \
ilLanguage
45
{
46
return
$this->container->language();
47
}
48
49
public
function
mainTemplate
(): \
ilGlobalTemplateInterface
50
{
51
return
$this->container->ui()->mainTemplate();
52
}
53
54
public
function
http
():
Services
55
{
56
return
$this->container->http();
57
}
58
59
public
function
ctrl
(): \
ilCtrlInterface
60
{
61
return
$this->container->ctrl();
62
}
63
64
public
function
checkPermission
(
string
$permission,
int
$ref_id
): bool
65
{
66
return
$this->container->access()->checkAccess($permission,
''
, $ref_id);
67
}
68
69
public
function
getParentRefId
(
int
$ref_id
): ?
int
70
{
71
return
$this->container->repositoryTree()->getParentId($ref_id);
72
}
73
74
public
function
exists
(
int
$ref_id
): bool
75
{
76
return
$this->container->repositoryTree()->isInTree($ref_id);
77
}
78
79
public
function
getUserId
():
int
80
{
81
return
$this->container->user()->getId();
82
}
83
84
public
function
isUserLoggedIn
(): bool
85
{
86
return
!$this->container->user()->isAnonymous() && $this->container->user()->getId() !== 0;
87
}
88
89
public
function
isPublicSectionActive
(): bool
90
{
91
return
(
bool
) ($this->container->settings()->get(
'pub_section'
) ??
false
);
92
}
93
}
ILIAS\StaticURL\Context\refinery
refinery()
Definition:
Context.php:39
ILIAS\StaticURL\Context\getUserId
getUserId()
Definition:
Context.php:79
ILIAS\StaticURL\Context\checkPermission
checkPermission(string $permission, int $ref_id)
Definition:
Context.php:64
ilLanguage
ILIAS\StaticURL\Context\getUserLanguage
getUserLanguage()
Definition:
Context.php:34
ilGlobalTemplateInterface
ILIAS\StaticURL\Context\ctrl
ctrl()
Definition:
Context.php:59
ILIAS\StaticURL\Context
Definition:
Context.php:28
ILIAS\StaticURL\Context\http
http()
Definition:
Context.php:54
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:35
$container
$container
Definition:
wac.php:36
Services
ILIAS\StaticURL
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
ArtifactObjective.php:21
Container
ILIAS\StaticURL\Context\isUserLoggedIn
isUserLoggedIn()
Definition:
Context.php:84
$ref_id
$ref_id
Definition:
ltiauth.php:65
Factory
ILIAS\StaticURL\Context\__construct
__construct(private Container $container)
Definition:
Context.php:30
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:35
ILIAS\StaticURL\Context\exists
exists(int $ref_id)
Definition:
Context.php:74
ILIAS\StaticURL\Context\mainTemplate
mainTemplate()
Definition:
Context.php:49
ILIAS\StaticURL\Context\lng
lng()
Definition:
Context.php:44
ILIAS\StaticURL\Context\getParentRefId
getParentRefId(int $ref_id)
Definition:
Context.php:69
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ilCtrlInterface
ILIAS\StaticURL\Context\isPublicSectionActive
isPublicSectionActive()
Definition:
Context.php:89
components
ILIAS
StaticURL
src
Context.php
Generated on Sun Aug 31 2025 23:02:39 for ILIAS by
1.8.13 (using
Doxyfile
)