ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\WebDAV\Mount\ModalGUI Class Reference
+ Collaboration diagram for ILIAS\WebDAV\Mount\ModalGUI:

Static Public Member Functions

static maybeRenderWebDAVModalInGlobalTpl ()
 

Private Member Functions

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

Private Attributes

const string MOUNT_INSTRUCTIONS_CONTENT_ID = 'webdav_mount_instructions_content'
 
Lightbox $modal
 

Static Private Attributes

static bool $modal_already_rendered = false
 

Detailed Description

Definition at line 29 of file ModalGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\WebDAV\Mount\ModalGUI::__construct ( protected Repository  $repository,
protected Factory  $ui_factory,
protected Renderer  $ui_renderer,
protected ilLanguage  $lng 
)
private

Definition at line 36 of file ModalGUI.php.

41 {
42 try {
43 $document = $this->repository->getMountInstructionsByLanguage($this->lng->getUserLanguage());
44 $title = $document->getTitle();
45 } catch (InvalidArgumentException) {
46 $title = $this->lng->txt('webfolder_instructions_titletext');
47 }
48
49 $content_div = '<div id="' . self::MOUNT_INSTRUCTIONS_CONTENT_ID . '"></div>';
50 $page = $this->ui_factory->modal()->lightboxTextPage($content_div, $title);
51 $this->modal = $this->ui_factory->modal()->lightbox($page);
52 }
modal(string $title="", string $cancel_label="")

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getModalShowSignalId()

ILIAS\WebDAV\Mount\ModalGUI::getModalShowSignalId ( )
private

Definition at line 59 of file ModalGUI.php.

59 : string
60 {
61 return $this->modal->getShowSignal()->getId();
62 }

References ILIAS\Repository\modal().

+ Here is the call graph for this function:

◆ getRenderedModal()

ILIAS\WebDAV\Mount\ModalGUI::getRenderedModal ( )
private

Definition at line 54 of file ModalGUI.php.

54 : string
55 {
56 return $this->ui_renderer->render($this->modal);
57 }

References ILIAS\Repository\modal().

+ Here is the call graph for this function:

◆ maybeRenderWebDAVModalInGlobalTpl()

static ILIAS\WebDAV\Mount\ModalGUI::maybeRenderWebDAVModalInGlobalTpl ( )
static

Definition at line 64 of file ModalGUI.php.

64 : void
65 {
66 if (self::$modal_already_rendered) {
67 return;
68 }
69
70 global $DIC;
71 $repository = new RepositoryDB($DIC->database());
72 $instance = new self(
73 $repository,
74 $DIC->ui()->factory(),
75 $DIC->ui()->renderer(),
76 $DIC->language()
77 );
78
79 self::$modal_already_rendered = true;
80 $js_function = '<script>function triggerWebDAVModal(api_url){ $.ajax(api_url).done(function(data){ $(document).trigger("'
81 . $instance->getModalShowSignalId()
82 . '", "{}"); $("#' . self::MOUNT_INSTRUCTIONS_CONTENT_ID . '").html(data);}) }</script>';
83
84 $webdav_modal_html = $instance->getRenderedModal() . $js_function;
85
86 $tpl = $DIC->ui()->mainTemplate();
87 $tpl->setVariable('WEBDAV_MODAL', $webdav_modal_html);
88 }
global $DIC
Definition: shib_login.php:26

References $DIC.

Referenced by ILIAS\WebDAV\Mount\DocumentTableGUI\__construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $modal

Lightbox ILIAS\WebDAV\Mount\ModalGUI::$modal
private

Definition at line 34 of file ModalGUI.php.

◆ $modal_already_rendered

bool ILIAS\WebDAV\Mount\ModalGUI::$modal_already_rendered = false
staticprivate

Definition at line 32 of file ModalGUI.php.

◆ MOUNT_INSTRUCTIONS_CONTENT_ID

const string ILIAS\WebDAV\Mount\ModalGUI::MOUNT_INSTRUCTIONS_CONTENT_ID = 'webdav_mount_instructions_content'
private

Definition at line 31 of file ModalGUI.php.


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