ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWebDAVMountInstructionsModalGUI Class Reference

Class ilWebDAVMountInstructionsModalGUI. More...

+ Collaboration diagram for ilWebDAVMountInstructionsModalGUI:

Public Member Functions

 __construct (ILIAS\UI\Factory $a_ui_factory, ILIAS\UI\Renderer $a_ui_renderer, ilLanguage $a_lng)
 ilWebDAVMountInstructionsModalGUI constructor. More...
 
 getRenderedModal ()
 
 getModalShowSignalId ()
 

Static Public Member Functions

static maybeRenderWebDAVModalInGlobalTpl ()
 This is kind of a singleton pattern. More...
 

Data Fields

const MOUNT_INSTRUCTIONS_CONTENT_ID = 'webdav_mount_instructions_content'
 ID of the. More...
 

Static Private Attributes

static $instance = null
 
static $modal_already_rendered = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVMountInstructionsModalGUI::__construct ( ILIAS\UI\Factory  $a_ui_factory,
ILIAS\UI\Renderer  $a_ui_renderer,
ilLanguage  $a_lng 
)

ilWebDAVMountInstructionsModalGUI constructor.

Parameters
\ILIAS\UI\Factory$a_ui_factory
\ILIAS\UI\Renderer$a_ui_renderer
ilLanguage$a_lng

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

20 {
21 global $DIC;
23 $this->ui_factory = $a_ui_factory;
24 $this->ui_renderer = $a_ui_renderer;
25 $this->lng = $a_lng;
26
27 try {
28 $document = $this->repository->getMountInstructionsByLanguage($this->lng->getUserLanguage());
29 $title = $document->getTitle();
30 } catch (InvalidArgumentException $e) {
31 $title = $this->lng->txt('webfolder_instructions_titletext');
32 }
33
34 $content_div = '<div id="' . self::MOUNT_INSTRUCTIONS_CONTENT_ID . '"></div>';
35 $page = $this->ui_factory->modal()->lightboxTextPage($content_div, $title);
36 $this->modal = $this->ui_factory->modal()->lightbox($page);
37 }
modal()
This second example shows a scenario in which the Close Button is used in an overlay as indicated in ...
Definition: modal.php:7
repository()
Definition: repository.php:5
$DIC
Definition: xapitoken.php:46

References $DIC, Vendor\Package\$e, modal(), and repository().

+ Here is the call graph for this function:

Member Function Documentation

◆ getModalShowSignalId()

ilWebDAVMountInstructionsModalGUI::getModalShowSignalId ( )
Returns
string

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

51 {
52 return $this->modal->getShowSignal()->getId();
53 }

References modal().

+ Here is the call graph for this function:

◆ getRenderedModal()

ilWebDAVMountInstructionsModalGUI::getRenderedModal ( )
Returns
string

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

43 {
44 return $this->ui_renderer->render($this->modal);
45 }

References modal().

+ Here is the call graph for this function:

◆ maybeRenderWebDAVModalInGlobalTpl()

static ilWebDAVMountInstructionsModalGUI::maybeRenderWebDAVModalInGlobalTpl ( )
static

This is kind of a singleton pattern.

But instead of getting creating only one instance of this class, an object will be created which will only be rendered once into the global template.

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

64 {
65 global $DIC;
66 if (!self::$modal_already_rendered) {
67 if (self::$instance == null) {
68 global $DIC;
69 self::$instance = new ilWebDAVMountInstructionsModalGUI($DIC->ui()->factory(), $DIC->ui()->renderer(), $DIC->language());
70 }
71
72 self::$modal_already_rendered = true;
73 $js_function = '<script>function triggerWebDAVModal(api_url){ $.ajax(api_url).done(function(data){ $(document).trigger("' . self::$instance->getModalShowSignalId() . '", "{}"); $("#' . self::MOUNT_INSTRUCTIONS_CONTENT_ID . '").html(data);}) }</script>';
74
75 $webdav_modal_html = self::$instance->getRenderedModal() . $js_function;
76
77 $tpl = $DIC->ui()->mainTemplate();
78 $tpl->setVariable('WEBDAV_MODAL', $webdav_modal_html);
79 }
80 }
Class ilWebDAVMountInstructionsModalGUI.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

References $DIC, and $tpl.

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

+ Here is the caller graph for this function:

Field Documentation

◆ $instance

ilWebDAVMountInstructionsModalGUI::$instance = null
staticprivate

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

◆ $modal_already_rendered

ilWebDAVMountInstructionsModalGUI::$modal_already_rendered = false
staticprivate

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

◆ MOUNT_INSTRUCTIONS_CONTENT_ID

const ilWebDAVMountInstructionsModalGUI::MOUNT_INSTRUCTIONS_CONTENT_ID = 'webdav_mount_instructions_content'

ID of the.

-element, which contains the mount instructions

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


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