ILIAS
trunk Revision v11.0_alpha-1689-g66c127b4ae8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
▼
ILIAS
Test List
Todo List
Deprecated List
►
Modules
►
Namespaces
►
Data Structures
▼
Files
►
File List
►
Globals
►
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
ViewContent.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\File\Capabilities\Check
;
22
23
use
ILIAS\File\Capabilities\Capability
;
24
use
ILIAS\File\Capabilities\Capabilities
;
25
use
ILIAS\File\Capabilities\Context
;
26
30
class
ViewContent
extends
BaseCheck
implements
Check
31
{
32
public
function
canUnlock
():
Capabilities
33
{
34
return
Capabilities::VIEW_EXTERNAL;
35
}
36
37
public
function
maybeUnlock
(
38
Capability
$capability,
39
CheckHelpers
$helpers,
40
\
ilObjFileInfo
$info,
41
Context
$context
,
42
):
Capability
{
43
if
($context->
getContext
() !==
Context::CONTEXT_REPO
) {
44
return
$capability->
withUnlocked
(
false
);
45
}
46
if
(!$this->
hasPermission
($helpers, $context, ...$capability->
getPermissions
())) {
47
return
$capability->
withUnlocked
(
false
);
48
}
49
50
return
$capability->
withUnlocked
($this->
hasWopiViewAction
($helpers, $info->
getSuffix
()));
51
}
52
53
public
function
maybeBuildURI
(
Capability
$capability,
CheckHelpers
$helpers,
Context
$context
):
Capability
54
{
55
if
(!$capability->
isUnlocked
()) {
56
return
$capability;
57
}
58
return
$capability->
withURI
(
59
$helpers->
fromTarget
(
60
$helpers->ctrl->getLinkTargetByClass(
61
[
62
$this->baseClass($context),
63
\ilObjFileGUI::class,
64
\ilWOPIEmbeddedApplicationGUI::class
65
],
66
\ilWOPIEmbeddedApplicationGUI::CMD_VIEW
67
)
68
)
69
);
70
}
71
72
}
ILIAS\File\Capabilities\Capability\withUnlocked
withUnlocked(bool $unlocked)
Definition:
Capability.php:42
ilObjFileInfo\getSuffix
getSuffix()
Definition:
class.ilObjFileInfo.php:48
$context
$context
Definition:
webdav.php:31
ILIAS\File\Capabilities\Context\CONTEXT_REPO
const CONTEXT_REPO
Definition:
Context.php:28
ILIAS\File\Capabilities\Check\CheckHelpers\fromTarget
fromTarget(string $target)
Definition:
CheckHelpers.php:41
ILIAS\File\Capabilities\Context\getContext
getContext()
Definition:
Context.php:52
ILIAS\File\Capabilities\Check\ViewContent\maybeBuildURI
maybeBuildURI(Capability $capability, CheckHelpers $helpers, Context $context)
Definition:
ViewContent.php:53
ILIAS\File\Capabilities\Check\Check
Definition:
Check.php:28
ilWOPIEmbeddedApplicationGUI\CMD_VIEW
const CMD_VIEW
Definition:
class.ilWOPIEmbeddedApplicationGUI.php:33
ILIAS\File\Capabilities\Capability
Definition:
Capability.php:26
ILIAS\File\Capabilities\Check\CheckHelpers
Definition:
CheckHelpers.php:29
Context
ILIAS\File\Capabilities\Check\BaseCheck\hasPermission
hasPermission(CheckHelpers $helpers, Context $context, Permissions ... $permission)
Definition:
BaseCheck.php:36
ILIAS\File\Capabilities\Check\ViewContent\maybeUnlock
maybeUnlock(Capability $capability, CheckHelpers $helpers, \ilObjFileInfo $info, Context $context,)
Definition:
ViewContent.php:37
ilObjFileInfo
Definition:
class.ilObjFileInfo.php:25
ILIAS\File\Capabilities\Check
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
BaseCheck.php:21
ILIAS\File\Capabilities\Capabilities
Capabilities
Definition:
Capabilities.php:24
ILIAS\File\Capabilities\Capability\isUnlocked
isUnlocked()
Definition:
Capability.php:54
ILIAS\File\Capabilities\Capability\withURI
withURI(?URI $uri)
Definition:
Capability.php:48
ILIAS\File\Capabilities\Check\BaseCheck
Definition:
BaseCheck.php:30
ILIAS\File\Capabilities\Check\BaseCheck\hasWopiViewAction
hasWopiViewAction(CheckHelpers $helpers, string $suffix)
Definition:
BaseCheck.php:75
Capability
ILIAS\File\Capabilities\Context
Definition:
Context.php:26
ILIAS\File\Capabilities\Capability\getPermissions
getPermissions()
Definition:
Capability.php:69
ILIAS\File\Capabilities\Check\ViewContent
Definition:
ViewContent.php:30
ILIAS\File\Capabilities\Check\ViewContent\canUnlock
canUnlock()
Definition:
ViewContent.php:32
components
ILIAS
File
classes
Capabilities
Check
ViewContent.php
Generated on Wed Apr 2 2025 23:02:49 for ILIAS by
1.8.13 (using
Doxyfile
)