ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\components\WOPI\Embed\EmbeddedApplication Class Reference
+ Collaboration diagram for ILIAS\components\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
 
string $token
 
array $substitutions
 

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\components\WOPI\Embed\EmbeddedApplication::getActionLauncherURL ( )

Definition at line 98 of file EmbeddedApplication.php.

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

98  : ?URI
99  {
100  if ($this->action === null) {
101  return null;
102  }
103 
104  $appendices = $this->getAppendices();
105 
106  $url = rtrim((string) $this->action->getLauncherUrl(), '/?#')
107  . '?'
108  . self::WOPI_SRC
109  . '='
110  . urlencode(
111  rtrim((string) $this->ilias_base_url, '/')
114  . '/'
115  . $this->identification->serialize()
116  );
117 
118  if ($appendices !== []) {
119  $url .= '&' . implode('&', $appendices);
120  }
121 
122  return new URI($url);
123  }
$url
Definition: shib_logout.php:68
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getAppendices()

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

Definition at line 128 of file EmbeddedApplication.php.

References null.

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

128  : array
129  {
130  // appendix sanitizer
131  $appendix = $this->action->getUrlAppendix();
132  $appendices = [];
133  try {
134  if ($appendix !== null) {
135  preg_match_all('/([^<]*)=([^>&]*)/m', $appendix, $appendices, PREG_SET_ORDER, 0);
136 
137  $appendices = array_filter($appendices, static fn($appendix): bool => isset($appendix[1], $appendix[2]));
138 
139  // we set the wopisrc ourselves
140  $appendices = array_filter($appendices, static fn($appendix): bool => strtolower((string) $appendix[1]) !== 'wopisrc');
141 
142  // try substitutions
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];
147  }
148  return $appendix;
149  }, $appendices);
150 
151  // we remove all those placeholders
152  $appendices = array_filter($appendices, static fn($appendix): bool => $appendix[0] !== $appendix[1] . '=' . $appendix[2]);
153 
154  $here = 1;
155 
156  $appendices = array_map(static fn($appendix): string => $appendix[1] . '=' . $appendix[2], $appendices);
157  }
158  } catch (\Throwable $t) {
159  return [];
160  }
161 
162  return $appendices;
163  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getBackTarget()

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

Definition at line 88 of file EmbeddedApplication.php.

Referenced by ILIAS\components\WOPI\Embed\EmbeddedApplicationGSProvider\buildCloseButton().

88  : URI
89  {
90  return $this->back_target;
91  }
+ Here is the caller graph for this function:

◆ getToken()

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

◆ getTTL()

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

◆ isInline()

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

Definition at line 93 of file EmbeddedApplication.php.

93  : bool
94  {
95  return $this->inline;
96  }

Field Documentation

◆ $substitutions

array ILIAS\components\WOPI\Embed\EmbeddedApplication::$substitutions
private
Initial value:
= [
self::SUB_THM => 1

Definition at line 45 of file EmbeddedApplication.php.

◆ $token

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

◆ $ttl

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

◆ SUB_DCHAT

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

Definition at line 41 of file EmbeddedApplication.php.

◆ SUB_EMBED

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

Definition at line 42 of file EmbeddedApplication.php.

◆ SUB_THM

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

Definition at line 40 of file EmbeddedApplication.php.

◆ WOPI_SRC

const ILIAS\components\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: