19 declare(strict_types=1);
48 self::SUB_EMBED => false
55 protected URI $back_target,
56 protected bool $inline =
false,
57 protected ?
bool $edit =
null,
58 private URI $ilias_base_url =
new URI(ILIAS_HTTP_PATH)
62 $data_signer = $DIC[
'file_delivery.data_signer'];
64 $editable = $edit ?? ($this->action ===
null 66 : $this->action->getName() === ActionTarget::EDIT->value);
68 'resource_id' => $this->identification->serialize(),
69 'user_id' => $DIC->user()->getId(),
70 'stakeholder' => $this->stakeholder::class,
71 'editable' => $editable
74 $this->substitutions[self::SUB_EMBED] = !$editable;
75 $this->token = $data_signer->sign($payload,
'wopi',
new \
DateTimeImmutable(
"now + $this->ttl seconds"));
90 return $this->back_target;
100 if ($this->action ===
null) {
106 $url = rtrim((
string) $this->action->getLauncherUrl(),
'/?#')
111 rtrim((
string) $this->ilias_base_url,
'/')
115 . $this->identification->serialize()
118 if ($appendices !== []) {
119 $url .=
'&' . implode(
'&', $appendices);
131 $appendix = $this->action->getUrlAppendix();
134 if ($appendix !==
null) {
135 preg_match_all(
'/([^<]*)=([^>&]*)/m', $appendix, $appendices, PREG_SET_ORDER, 0);
137 $appendices = array_filter($appendices,
static fn($appendix):
bool => isset($appendix[1], $appendix[2]));
140 $appendices = array_filter($appendices,
static fn($appendix):
bool => strtolower((
string) $appendix[1]) !==
'wopisrc');
143 $appendices =
array_map(
function ($appendix): array {
144 $key = strtolower((
string) $appendix[1]);
145 if (isset($this->substitutions[$key])) {
146 $appendix[2] = (string) $this->substitutions[$key];
152 $appendices = array_filter($appendices,
static fn($appendix):
bool => $appendix[0] !== $appendix[1] .
'=' . $appendix[2]);
156 $appendices =
array_map(
static fn($appendix):
string => $appendix[1] .
'=' . $appendix[2], $appendices);
if(count($parts) !=3) $payload
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.
Class ResourceIdentification.
ActionTarget
Officialy supported action targets, see https://learn.microsoft.com/en-us/openspecs/office_protocols/...
Interface ResourceStakeholder.