ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilContentStyleStakeholder.php
Go to the documentation of this file.
1<?php
2
21
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 {
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}
getLocationURIForResourceUsage(ResourceIdentification $identification)
canBeAccessedByCurrentUser(ResourceIdentification $identification)
resourceHasBeenDeleted(ResourceIdentification $identification)
Interface ilDBInterface.
global $DIC
Definition: shib_login.php:26