ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
class.ilContentStyleStakeholder.php
Go to the documentation of this file.
1
<?php
2
19
use
ILIAS\ResourceStorage\Identification\ResourceIdentification
;
20
use
ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
;
21
22
class
ilContentStyleStakeholder
extends
AbstractResourceStakeholder
23
{
24
protected
?
ilDBInterface
$database
=
null
;
25
26
27
public
function
getId
(): string
28
{
29
return
'styl_content'
;
30
}
31
32
public
function
getOwnerOfNewResources
():
int
33
{
34
return
$this->default_owner
;
35
}
36
37
public
function
canBeAccessedByCurrentUser
(
ResourceIdentification
$identification): bool
38
{
39
global
$DIC
;
40
41
// css is not accessed checked
42
return
true
;
43
44
/*
45
$object_id = $this->resolveObjectId($identification);
46
if ($object_id === null) {
47
return true;
48
}
49
50
$ref_ids = ilObject2::_getAllReferences($object_id);
51
foreach ($ref_ids as $ref_id) {
52
// one must have read permissions on the exercise to see the instruction files
53
if ($DIC->access()->checkAccessOfUser($this->current_user, 'read', '', $ref_id)) {
54
return true;
55
}
56
}
57
58
return false;*/
59
}
60
61
public
function
resourceHasBeenDeleted
(
ResourceIdentification
$identification): bool
62
{
63
// at this place we could handle de deletion of a resource. not needed for instruction files IMO.
64
65
return
true
;
66
}
67
68
public
function
getLocationURIForResourceUsage
(
ResourceIdentification
$identification): ?string
69
{
70
/* since styles are not repo objects, we currently do not have a link here.
71
$this->initDB();
72
$object_id = $this->resolveObjectId($identification);
73
if ($object_id !== null) {
74
$references = ilObject::_getAllReferences($object_id);
75
$ref_id = array_shift($references);
76
77
// we currently deliver the goto-url of the exercise in which the resource is used. if possible, you could deliver a more speficic url wo the assignment as well.
78
return ilLink::_getLink($ref_id, 'exc');
79
}*/
80
return
null
;
81
}
82
83
/*
84
private function resolveObjectId(ResourceIdentification $identification): ?int
85
{
86
$this->initDB();
87
$r = $this->database->queryF(
88
"SELECT exc_id FROM exc_assignment WHERE exc_assignment.solution_rid = %s;",
89
['text'],
90
[$identification->serialize()]
91
);
92
$d = $this->database->fetchObject($r);
93
94
return (isset($d->exc_id) ? (int) $d->exc_id : null);
95
}*/
96
97
private
function
initDB
(): void
98
{
99
global
$DIC
;
100
if
($this->
database
===
null
) {
101
$this->
database
= $DIC->database();
102
}
103
}
104
}
ilContentStyleStakeholder\resourceHasBeenDeleted
resourceHasBeenDeleted(ResourceIdentification $identification)
Definition:
class.ilContentStyleStakeholder.php:61
ilContentStyleStakeholder\initDB
initDB()
Definition:
class.ilContentStyleStakeholder.php:97
ResourceIdentification
ilContentStyleStakeholder\getId
getId()
Definition:
class.ilContentStyleStakeholder.php:27
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ilContentStyleStakeholder\canBeAccessedByCurrentUser
canBeAccessedByCurrentUser(ResourceIdentification $identification)
Definition:
class.ilContentStyleStakeholder.php:37
ilContentStyleStakeholder\$database
ilDBInterface $database
Definition:
class.ilContentStyleStakeholder.php:24
ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder\$default_owner
int $default_owner
Definition:
AbstractResourceStakeholder.php:33
ILIAS\ResourceStorage\Identification\ResourceIdentification
Class ResourceIdentification.
Definition:
ResourceIdentification.php:30
ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
Definition:
AbstractResourceStakeholder.php:29
$DIC
global $DIC
Definition:
shib_login.php:26
ilDBInterface
ILIAS\Repository\database
database()
Definition:
trait.GlobalDICDomainServices.php:146
ilContentStyleStakeholder\getLocationURIForResourceUsage
getLocationURIForResourceUsage(ResourceIdentification $identification)
Definition:
class.ilContentStyleStakeholder.php:68
ilContentStyleStakeholder\getOwnerOfNewResources
getOwnerOfNewResources()
Definition:
class.ilContentStyleStakeholder.php:32
AbstractResourceStakeholder
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ilContentStyleStakeholder
Definition:
class.ilContentStyleStakeholder.php:22
components
ILIAS
Style
Content
Style
class.ilContentStyleStakeholder.php
Generated on Sun Aug 31 2025 23:03:51 for ILIAS by
1.8.13 (using
Doxyfile
)