ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 73 of file class.ilWOPIEmbeddedApplicationGUI.php.

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

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

Member Function Documentation

◆ edit()

ilWOPIEmbeddedApplicationGUI::edit ( )
private

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

Referenced by executeCommand().

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

◆ executeCommand()

ilWOPIEmbeddedApplicationGUI::executeCommand ( )

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

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

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

◆ return()

ilWOPIEmbeddedApplicationGUI::return ( )
private

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

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

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

◆ view()

ilWOPIEmbeddedApplicationGUI::view ( )
private

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

Referenced by executeCommand().

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

Field Documentation

◆ $ctrl

ilCtrlInterface ilWOPIEmbeddedApplicationGUI::$ctrl
private

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

◆ $global_screen

Services ilWOPIEmbeddedApplicationGUI::$global_screen
private

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

◆ $http

ArrayBasedRequestWrapper ilWOPIEmbeddedApplicationGUI::$http
private

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

◆ $lng

ilLanguage ilWOPIEmbeddedApplicationGUI::$lng
private

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

◆ $main_tpl

ilGlobalTemplateInterface ilWOPIEmbeddedApplicationGUI::$main_tpl
private

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

◆ $refinery

Factory ilWOPIEmbeddedApplicationGUI::$refinery
private

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

◆ $renderer

Renderer ilWOPIEmbeddedApplicationGUI::$renderer
private

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

◆ $tabs

ilTabsGUI ilWOPIEmbeddedApplicationGUI::$tabs
private

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

◆ $ui_renderer

ILIAS UI Renderer ilWOPIEmbeddedApplicationGUI::$ui_renderer
private

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


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