ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\WOPI\Embed\EmbeddedApplication Class Reference
+ Collaboration diagram for ILIAS\WOPI\Embed\EmbeddedApplication:

Public Member Functions

 getToken ()
 
 getTTL ()
 
 getBackTarget ()
 
 isInline ()
 
 getActionLauncherURL ()
 

Protected Member Functions

 getAppendices ()
 

Private Attributes

const WOPI_SRC = 'WOPISrc'
 
const SUB_THM = 'thm'
 
const SUB_DCHAT = 'dchat'
 
const SUB_EMBED = 'embed'
 
int $ttl = 3600 * 8
 
string $token
 
array $substitutions
 
URI $ilias_base_url
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 34 of file EmbeddedApplication.php.

Member Function Documentation

◆ getActionLauncherURL()

ILIAS\WOPI\Embed\EmbeddedApplication::getActionLauncherURL ( )

Definition at line 101 of file EmbeddedApplication.php.

101 : ?URI
102 {
103 if ($this->action === null) {
104 return null;
105 }
106
107 $appendices = $this->getAppendices();
108
109 $url = rtrim((string) $this->action->getLauncherUrl(), '/?#')
110 . '?'
111 . self::WOPI_SRC
112 . '='
113 . urlencode(
114 rtrim((string) $this->ilias_base_url, '/')
117 . '/'
118 . $this->identification->serialize()
119 );
120
121 if ($appendices !== []) {
122 $url .= '&' . implode('&', $appendices);
123 }
124
125 return new URI($url);
126 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
$url
Definition: shib_logout.php:68

References $url, ILIAS\WOPI\Embed\EmbeddedApplication\getAppendices(), ILIAS\WOPI\Handler\RequestHandler\NAMESPACE_FILES, and ILIAS\WOPI\Handler\RequestHandler\WOPI_BASE_URL.

+ Here is the call graph for this function:

◆ getAppendices()

ILIAS\WOPI\Embed\EmbeddedApplication::getAppendices ( )
protected
Returns
array|string[]

Definition at line 131 of file EmbeddedApplication.php.

131 : array
132 {
133 // appendix sanitizer
134 $appendix = $this->action->getUrlAppendix();
135 $appendices = [];
136 try {
137 if ($appendix !== null) {
138 preg_match_all('/([^<]*)=([^>&]*)/m', $appendix, $appendices, PREG_SET_ORDER, 0);
139
140 $appendices = array_filter($appendices, static fn(array $appendix): bool => isset($appendix[1], $appendix[2]));
141
142 // we set the wopisrc ourselves
143 $appendices = array_filter($appendices, static fn(array $appendix): bool => strtolower($appendix[1]) !== 'wopisrc');
144
145 // try substitutions
146 $appendices = array_map(function (array $appendix): array {
147 $key = strtolower($appendix[1]);
148 if (isset($this->substitutions[$key])) {
149 $appendix[2] = (string) $this->substitutions[$key];
150 }
151 return $appendix;
152 }, $appendices);
153
154 // we remove all those placeholders
155 $appendices = array_filter($appendices, static fn(array $appendix): bool => $appendix[0] !== $appendix[1] . '=' . $appendix[2]);
156
157 $here = 1;
158
159 $appendices = array_map(static fn(array $appendix): string => $appendix[1] . '=' . $appendix[2], $appendices);
160 }
161 } catch (\Throwable $t) {
162 return [];
163 }
164
165 return $appendices;
166 }

Referenced by ILIAS\WOPI\Embed\EmbeddedApplication\getActionLauncherURL().

+ Here is the caller graph for this function:

◆ getBackTarget()

ILIAS\WOPI\Embed\EmbeddedApplication::getBackTarget ( )

Definition at line 91 of file EmbeddedApplication.php.

91 : URI
92 {
93 return $this->back_target;
94 }

◆ getToken()

ILIAS\WOPI\Embed\EmbeddedApplication::getToken ( )

Definition at line 81 of file EmbeddedApplication.php.

81 : string
82 {
83 return $this->token;
84 }

References ILIAS\WOPI\Embed\EmbeddedApplication\$token.

◆ getTTL()

ILIAS\WOPI\Embed\EmbeddedApplication::getTTL ( )

Definition at line 86 of file EmbeddedApplication.php.

86 : int
87 {
88 return $this->ttl;
89 }

References ILIAS\WOPI\Embed\EmbeddedApplication\$ttl.

◆ isInline()

ILIAS\WOPI\Embed\EmbeddedApplication::isInline ( )

Definition at line 96 of file EmbeddedApplication.php.

96 : bool
97 {
98 return $this->inline;
99 }

Field Documentation

◆ $ilias_base_url

URI ILIAS\WOPI\Embed\EmbeddedApplication::$ilias_base_url
private

Definition at line 50 of file EmbeddedApplication.php.

◆ $substitutions

array ILIAS\WOPI\Embed\EmbeddedApplication::$substitutions
private
Initial value:
= [
self::SUB_THM => 1,
self::SUB_DCHAT => 0,
self::SUB_EMBED => false
]

Definition at line 45 of file EmbeddedApplication.php.

◆ $token

string ILIAS\WOPI\Embed\EmbeddedApplication::$token
private

◆ $ttl

int ILIAS\WOPI\Embed\EmbeddedApplication::$ttl = 3600 * 8
private

Definition at line 43 of file EmbeddedApplication.php.

Referenced by ILIAS\WOPI\Embed\EmbeddedApplication\getTTL().

◆ SUB_DCHAT

const ILIAS\WOPI\Embed\EmbeddedApplication::SUB_DCHAT = 'dchat'
private

Definition at line 41 of file EmbeddedApplication.php.

◆ SUB_EMBED

const ILIAS\WOPI\Embed\EmbeddedApplication::SUB_EMBED = 'embed'
private

Definition at line 42 of file EmbeddedApplication.php.

◆ SUB_THM

const ILIAS\WOPI\Embed\EmbeddedApplication::SUB_THM = 'thm'
private

Definition at line 40 of file EmbeddedApplication.php.

◆ WOPI_SRC

const ILIAS\WOPI\Embed\EmbeddedApplication::WOPI_SRC = 'WOPISrc'
private

Definition at line 39 of file EmbeddedApplication.php.


The documentation for this class was generated from the following file: