ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilWebDAVMountInstructionsModalGUI Class Reference
+ Collaboration diagram for ilWebDAVMountInstructionsModalGUI:

Static Public Member Functions

static maybeRenderWebDAVModalInGlobalTpl ()
 

Private Member Functions

 __construct (protected ilWebDAVMountInstructionsRepositoryImpl $repository, protected Factory $ui_factory, protected Renderer $ui_renderer, protected ilLanguage $lng)
 
 getRenderedModal ()
 
 getModalShowSignalId ()
 

Private Attributes

const MOUNT_INSTRUCTIONS_CONTENT_ID = 'webdav_mount_instructions_content'
 
Lightbox $modal
 

Static Private Attributes

static bool $modal_already_rendered = false
 

Detailed Description

Definition at line 25 of file class.ilWebDAVMountInstructionsModalGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVMountInstructionsModalGUI::__construct ( protected ilWebDAVMountInstructionsRepositoryImpl  $repository,
protected Factory  $ui_factory,
protected Renderer  $ui_renderer,
protected ilLanguage  $lng 
)
private

Definition at line 30 of file class.ilWebDAVMountInstructionsModalGUI.php.

References ILIAS\Repository\lng(), ILIAS\Repository\modal(), and ILIAS\UI\examples\Deck\repository().

35  {
36  try {
37  $document = $this->repository->getMountInstructionsByLanguage($this->lng->getUserLanguage());
38  $title = $document->getTitle();
39  } catch (InvalidArgumentException) {
40  $title = $this->lng->txt('webfolder_instructions_titletext');
41  }
42 
43  $content_div = '<div id="' . self::MOUNT_INSTRUCTIONS_CONTENT_ID . '"></div>';
44  $page = $this->ui_factory->modal()->lightboxTextPage($content_div, $title);
45  $this->modal = $this->ui_factory->modal()->lightbox($page);
46  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
modal(string $title="", string $cancel_label="")
+ Here is the call graph for this function:

Member Function Documentation

◆ getModalShowSignalId()

ilWebDAVMountInstructionsModalGUI::getModalShowSignalId ( )
private

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

References ILIAS\Repository\modal().

53  : string
54  {
55  return $this->modal->getShowSignal()->getId();
56  }
modal(string $title="", string $cancel_label="")
+ Here is the call graph for this function:

◆ getRenderedModal()

ilWebDAVMountInstructionsModalGUI::getRenderedModal ( )
private

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

References ILIAS\Repository\modal().

48  : string
49  {
50  return $this->ui_renderer->render($this->modal);
51  }
modal(string $title="", string $cancel_label="")
+ Here is the call graph for this function:

◆ maybeRenderWebDAVModalInGlobalTpl()

static ilWebDAVMountInstructionsModalGUI::maybeRenderWebDAVModalInGlobalTpl ( )
static

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

References $DIC.

Referenced by ilWebDAVMountInstructionsDocumentTableGUI\__construct(), and ilObjectListGUI\insertCommand().

60  : void
61  {
62  if (self::$modal_already_rendered) {
63  return;
64  }
65 
66  global $DIC;
67  $repository = new ilWebDAVMountInstructionsRepositoryImpl($DIC->database());
68  $instance = new ilWebDAVMountInstructionsModalGUI(
69  $repository,
70  $DIC->ui()->factory(),
71  $DIC->ui()->renderer(),
72  $DIC->language()
73  );
74 
75  self::$modal_already_rendered = true;
76  $js_function = '<script>function triggerWebDAVModal(api_url){ $.ajax(api_url).done(function(data){ $(document).trigger("' . $instance->getModalShowSignalId(
77  ) . '", "{}"); $("#' . self::MOUNT_INSTRUCTIONS_CONTENT_ID . '").html(data);}) }</script>';
78 
79  $webdav_modal_html = $instance->getRenderedModal() . $js_function;
80 
81  $tpl = $DIC->ui()->mainTemplate();
82  $tpl->setVariable('WEBDAV_MODAL', $webdav_modal_html);
83  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

Field Documentation

◆ $modal

Lightbox ilWebDAVMountInstructionsModalGUI::$modal
private

Definition at line 28 of file class.ilWebDAVMountInstructionsModalGUI.php.

◆ $modal_already_rendered

bool ilWebDAVMountInstructionsModalGUI::$modal_already_rendered = false
staticprivate

Definition at line 58 of file class.ilWebDAVMountInstructionsModalGUI.php.

◆ MOUNT_INSTRUCTIONS_CONTENT_ID

const ilWebDAVMountInstructionsModalGUI::MOUNT_INSTRUCTIONS_CONTENT_ID = 'webdav_mount_instructions_content'
private

Definition at line 27 of file class.ilWebDAVMountInstructionsModalGUI.php.


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