19declare(strict_types=1);
27use InvalidArgumentException;
43 $document = $this->
repository->getMountInstructionsByLanguage($this->
lng->getUserLanguage());
44 $title = $document->getTitle();
45 }
catch (InvalidArgumentException) {
46 $title = $this->
lng->txt(
'webfolder_instructions_titletext');
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);
56 return $this->ui_renderer->render($this->
modal);
61 return $this->
modal->getShowSignal()->getId();
66 if (self::$modal_already_rendered) {
74 $DIC->ui()->factory(),
75 $DIC->ui()->renderer(),
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>';
84 $webdav_modal_html = $instance->getRenderedModal() . $js_function;
86 $tpl =
$DIC->ui()->mainTemplate();
87 $tpl->setVariable(
'WEBDAV_MODAL', $webdav_modal_html);
Builds a Color from either hex- or rgb values.
static maybeRenderWebDAVModalInGlobalTpl()
static bool $modal_already_rendered
__construct(protected Repository $repository, protected Factory $ui_factory, protected Renderer $ui_renderer, protected ilLanguage $lng)
const string MOUNT_INSTRUCTIONS_CONTENT_ID
This is how the factory for UI elements looks.
An entity that renders components to a string output.
modal(string $title="", string $cancel_label="")