19declare(strict_types=1);
50 $f = $this->
ui->factory();
51 $r = $this->
ui->renderer();
55 $js_function_legacy =
$f->legacy(
57 .
'il.UI.showMountInstructions = function (e, id){'
58 .
"obj = $(e['target']);"
59 .
"obj.siblings().removeClass('engaged disabled ilSubmitInactive').attr('aria-pressed', 'false');"
60 .
"obj.siblings().removeAttr('disabled');"
61 .
"obj.addClass('engaged ilSubmitInactive').attr('aria-pressed', 'true');"
62 .
'$(".instructions").hide();'
63 .
'$("#"+id).show();}</script>'
66 if (count($mount_instructions) === 1) {
67 $content =
$f->legacy(
"<div class='instructions'>" . array_shift($mount_instructions) .
"</div>");
69 return $render_async ? $r->renderAsync($content) : $r->render($content);
72 $view_control_actions = [];
74 $selected = array_key_first($mount_instructions);
76 foreach ($mount_instructions as $title => $text) {
77 foreach ($os as $os_string) {
78 if (stristr($title, (
string) $os_string) !==
false) {
85 foreach ($mount_instructions as $title => $text) {
86 $hidden = $title == $selected ?
'' :
'style="display: none;"';
88 $legacy =
$f->legacy(
"<div id='$title' class='instructions' $hidden>$text</div>")
89 ->withCustomSignal($title,
"il.UI.showMountInstructions(event, '$title');");
91 $view_control_actions[$title] = $legacy->getCustomSignal($title);
96 $view_control =
$f->viewControl()->mode($view_control_actions,
"mount-instruction-buttons")->withActive(
101 $header_components = [
102 $f->legacy(
"<div class='webdav-view-control'>"),
104 $f->legacy(
"</div>"),
116 $instructions = $this->mount_instruction->getMountInstructionsAsArray();
117 }
catch (InvalidArgumentException) {
121 $instructions = $document_processor->processMountInstructions(
122 $this->lang->txt(
'webfolder_instructions_text')
124 $instructions = $this->mount_instruction->getMountInstructionsAsArray($instructions);
125 if ($instructions ==
'' || $instructions ==
'-webfolder_instructions_text-') {
127 "<div class='alert alert-danger'>" . $this->lang->txt(
129 ) .
": " . $this->lang->txt(
'webdav_missing_lang') .
"</div>"
140 $ua = $this->
http->request()->getHeader(
'User-Agent')[0];
142 if (stristr($ua,
'windows') !==
false
143 || str_contains($ua,
'microsoft')) {
147 if (stristr($ua,
'darwin') !==
false
148 || stristr($ua,
'macintosh') !==
false) {
149 return [
'mac',
'osx'];
152 if (stristr($ua,
'linux') !==
false
153 || stristr($ua,
'solaris') !==
false
154 || stristr($ua,
'aix') !==
false
155 || stristr($ua,
'unix') !==
false
156 || stristr($ua,
'gvfs') !==
false
Provides fluid interface to RBAC services.
determineOSfromUserAgent()
ilWebDAVUriBuilder $uri_builder
renderMountInstructionsContent()
buildGUIFromGivenMountInstructions(array $mount_instructions, bool $render_async=false)
__construct(protected ilWebDAVBaseMountInstructions $mount_instruction, protected ilLanguage $lang, protected UIServices $ui, Services $http)
static http()
Fetches the global http state from ILIAS.