19 declare(strict_types=1);
46 self::SUB_EMBED => false
53 protected URI $back_target,
54 protected bool $inline =
false,
55 protected ?
bool $edit = null,
56 ?
URI $ilias_base_url = null
60 $data_signer = $DIC[
'file_delivery.data_signer'];
62 $editable = $edit ?? ($this->action === null
64 : $this->action->getName() === ActionTarget::EDIT->value);
66 'resource_id' => $this->identification->serialize(),
67 'user_id' => $DIC->user()->getId(),
68 'stakeholder' => $this->stakeholder::class,
69 'editable' => $editable
72 $this->substitutions[self::SUB_EMBED] = !$editable;
73 $this->token = $data_signer->sign($payload,
'wopi',
new \
DateTimeImmutable(
"now + $this->ttl seconds"));
74 $this->ilias_base_url = $ilias_base_url ??
new URI(ILIAS_HTTP_PATH);
89 return $this->back_target;
99 if ($this->action === null) {
105 $url = rtrim((
string) $this->action->getLauncherUrl(),
'/?#')
110 rtrim((
string) $this->ilias_base_url,
'/')
114 . $this->identification->serialize()
117 if ($appendices !== []) {
118 $url .=
'&' . implode(
'&', $appendices);
130 $appendix = $this->action->getUrlAppendix();
133 if ($appendix !== null) {
134 preg_match_all(
'/([^<]*)=([^>&]*)/m', $appendix, $appendices, PREG_SET_ORDER, 0);
136 $appendices = array_filter($appendices,
static fn($appendix):
bool => isset($appendix[1], $appendix[2]));
139 $appendices = array_filter($appendices,
static fn($appendix):
bool => strtolower((
string) $appendix[1]) !==
'wopisrc');
142 $appendices =
array_map(
function ($appendix): array {
143 $key = strtolower((
string) $appendix[1]);
144 if (isset($this->substitutions[$key])) {
145 $appendix[2] = (string) $this->substitutions[$key];
151 $appendices = array_filter($appendices,
static fn($appendix):
bool => $appendix[0] !== $appendix[1] .
'=' . $appendix[2]);
155 $appendices =
array_map(
static fn($appendix):
string => $appendix[1] .
'=' . $appendix[2], $appendices);
if(count($parts) !=3) $payload
__construct()
Constructor setup ILIAS global object public.
Class ResourceIdentification.
The scope of this class is split ilias-conform URI's into components.
ActionTarget
Officialy supported action targets, see https://learn.microsoft.com/en-us/openspecs/office_protocols/...
Interface ResourceStakeholder.