ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 75 of file class.ilWOPIEmbeddedApplicationGUI.php.

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

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

Member Function Documentation

◆ edit()

ilWOPIEmbeddedApplicationGUI::edit ( )
private

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

Referenced by executeCommand().

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

◆ executeCommand()

ilWOPIEmbeddedApplicationGUI::executeCommand ( )

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

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

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

◆ return()

ilWOPIEmbeddedApplicationGUI::return ( )
private

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

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

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

◆ view()

ilWOPIEmbeddedApplicationGUI::view ( )
private

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

Referenced by executeCommand().

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

Field Documentation

◆ $ctrl

ilCtrlInterface ilWOPIEmbeddedApplicationGUI::$ctrl
private

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

◆ $global_screen

Services ilWOPIEmbeddedApplicationGUI::$global_screen
private

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

◆ $http

ArrayBasedRequestWrapper ilWOPIEmbeddedApplicationGUI::$http
private

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

◆ $lng

ilLanguage ilWOPIEmbeddedApplicationGUI::$lng
private

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

◆ $main_tpl

ilGlobalTemplateInterface ilWOPIEmbeddedApplicationGUI::$main_tpl
private

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

◆ $refinery

Factory ilWOPIEmbeddedApplicationGUI::$refinery
private

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

◆ $renderer

Renderer ilWOPIEmbeddedApplicationGUI::$renderer
private

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

◆ $tabs

ilTabsGUI ilWOPIEmbeddedApplicationGUI::$tabs
private

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

◆ $ui_renderer

ILIAS UI Renderer ilWOPIEmbeddedApplicationGUI::$ui_renderer
private

Definition at line 57 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 37 of file class.ilWOPIEmbeddedApplicationGUI.php.


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