ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilWOPIEmbeddedApplicationGUI Class Reference
+ Collaboration diagram for ilWOPIEmbeddedApplicationGUI:

Public Member Functions

 __construct (private EmbeddedApplication $application,)
 
 executeCommand ()
 

Data Fields

const CMD_EDIT = 'edit'
 
const CMD_VIEW = 'view'
 
const CMD_RETURN = 'return'
 
const P_RETURN_TO = 'return_to'
 

Private Member Functions

 view ()
 
 edit ()
 
 return ()
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 
ilTabsGUI $tabs
 
Services $global_screen
 
Renderer $renderer
 
ILIAS UI Renderer $ui_renderer
 
ArrayBasedRequestWrapper $http
 
Factory $refinery
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWOPIEmbeddedApplicationGUI::__construct ( private EmbeddedApplication  $application)

Definition at line 74 of file class.ilWOPIEmbeddedApplicationGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\tabs().

76  {
77  global $DIC;
78  $this->main_tpl = $DIC->ui()->mainTemplate();
79  $this->tabs = $DIC->tabs();
80  $this->global_screen = $DIC->globalScreen();
81  $this->global_screen->layout()->meta()->addJs('./assets/js/wopi.min.js');
82  $this->global_screen->layout()->meta()->addOnloadCode('il.WOPI.init();');
83  $this->renderer = new Renderer($this->application);
84  $this->ui_renderer = $DIC->ui()->renderer();
85  $this->http = $DIC->http()->wrapper()->query();
86  $this->refinery = $DIC->refinery();
87  $this->ctrl = $DIC->ctrl();
88  $this->lng = $DIC->language();
89  $this->lng->loadLanguageModule('wopi');
90  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

Member Function Documentation

◆ edit()

ilWOPIEmbeddedApplicationGUI::edit ( )
private

Definition at line 119 of file class.ilWOPIEmbeddedApplicationGUI.php.

Referenced by executeCommand().

119  : void
120  {
121  $this->main_tpl->setContent(
122  $this->ui_renderer->render($this->renderer->getComponent())
123  );
124  }
+ Here is the caller graph for this function:

◆ executeCommand()

ilWOPIEmbeddedApplicationGUI::executeCommand ( )

Definition at line 92 of file class.ilWOPIEmbeddedApplicationGUI.php.

References ILIAS\Repository\ctrl(), edit(), ILIAS\Repository\tabs(), and view().

92  : void
93  {
94  if (!$this->application->isInline()) {
95  $this->tabs->clearTargets();
96  }
97  $this->global_screen->tool()->context()->current()->addAdditionalData(
98  EmbeddedApplicationGSProvider::EMBEDDED_APPLICATION,
99  $this->application
100  );
101  $a_value = bin2hex((string) $this->application->getBackTarget());
102  $this->ctrl->setParameter($this, self::P_RETURN_TO, $a_value);
103 
104  match ($this->ctrl->getCmd()) {
105  default => $this->edit(),
106  self::CMD_EDIT => $this->edit(),
107  self::CMD_VIEW => $this->view(),
108  self::CMD_RETURN => $this->return(),
109  };
110  }
+ Here is the call graph for this function:

◆ return()

ilWOPIEmbeddedApplicationGUI::return ( )
private

Definition at line 126 of file class.ilWOPIEmbeddedApplicationGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\Repository\lng().

126  : void
127  {
128  $return_to = $this->http->has(self::P_RETURN_TO)
129  ? hex2bin((string) $this->http->retrieve(self::P_RETURN_TO, $this->refinery->kindlyTo()->string()))
130  : null;
131 
132  if ($return_to === null) {
133  $return_to = (string) $this->application->getBackTarget();
134  }
135 
136  $this->main_tpl->setOnScreenMessage(
137  'info',
138  $this->lng->txt('close_wopi_editor_info'),
139  true
140  );
141 
142  $this->ctrl->redirectToURL($return_to);
143  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ view()

ilWOPIEmbeddedApplicationGUI::view ( )
private

Definition at line 112 of file class.ilWOPIEmbeddedApplicationGUI.php.

Referenced by executeCommand().

112  : void
113  {
114  $this->main_tpl->setContent(
115  $this->ui_renderer->render($this->renderer->getComponent())
116  );
117  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ilWOPIEmbeddedApplicationGUI::$ctrl
private

Definition at line 68 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $global_screen

Services ilWOPIEmbeddedApplicationGUI::$global_screen
private

Definition at line 48 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $http

ArrayBasedRequestWrapper ilWOPIEmbeddedApplicationGUI::$http
private

Definition at line 60 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $lng

ilLanguage ilWOPIEmbeddedApplicationGUI::$lng
private

Definition at line 72 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilWOPIEmbeddedApplicationGUI::$main_tpl
private

Definition at line 40 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $refinery

Factory ilWOPIEmbeddedApplicationGUI::$refinery
private

Definition at line 64 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $renderer

Renderer ilWOPIEmbeddedApplicationGUI::$renderer
private

Definition at line 52 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $tabs

ilTabsGUI ilWOPIEmbeddedApplicationGUI::$tabs
private

Definition at line 44 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ $ui_renderer

ILIAS UI Renderer ilWOPIEmbeddedApplicationGUI::$ui_renderer
private

Definition at line 56 of file class.ilWOPIEmbeddedApplicationGUI.php.

◆ CMD_EDIT

◆ CMD_RETURN

const ilWOPIEmbeddedApplicationGUI::CMD_RETURN = 'return'

◆ CMD_VIEW

const ilWOPIEmbeddedApplicationGUI::CMD_VIEW = 'view'

◆ P_RETURN_TO

const ilWOPIEmbeddedApplicationGUI::P_RETURN_TO = 'return_to'

Definition at line 36 of file class.ilWOPIEmbeddedApplicationGUI.php.


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