Class ilWebDAVMountInstructionsGUI.
More...
Class ilWebDAVMountInstructionsGUI.
This class delivers or prints a representation of the mount instructions
- Author
- Raphael Heer rapha.nosp@m.el.h.nosp@m.eer@h.nosp@m.slu..nosp@m.ch $Id$
Definition at line 11 of file class.ilWebDAVMountInstructionsGUI.php.
◆ __construct()
◆ buildGUIFromGivenMountInstructions()
ilWebDAVMountInstructionsGUI::buildGUIFromGivenMountInstructions |
( |
|
$a_mount_instructions, |
|
|
|
$a_render_async = false |
|
) |
| |
Definition at line 37 of file class.ilWebDAVMountInstructionsGUI.php.
References Vendor\Package\$f, determineOSfromUserAgent(), and ui().
Referenced by renderMountInstructionsContent().
41 $f = $this->
ui->factory();
42 $r = $this->
ui->renderer();
48 $js_function_legacy =
$f->legacy(
'<script>' 49 .
'il.UI.showMountInstructions = function (e, id){' 51 .
"obj = $(e['target']);" 53 .
"obj.siblings().removeClass('engaged disabled ilSubmitInactive').attr('aria-pressed', 'false');" 54 .
"obj.siblings().removeAttr('disabled');" 56 .
"obj.addClass('engaged ilSubmitInactive').attr('aria-pressed', 'true');" 58 .
'$(".instructions").hide();' 60 .
'$("#"+id).show();}</script>');
65 if (count($a_mount_instructions) === 1) {
66 $content =
$f->legacy(
"<div class='instructions'>" . array_shift($a_mount_instructions) .
"</div>");
68 return $a_render_async ? $r->renderAsync($content) : $r->render($content);
78 $view_control_actions = array();
85 foreach ($a_mount_instructions as $key => $value) {
86 $selected = $a_mount_instructions[$key];
91 foreach ($a_mount_instructions as $title => $text) {
92 foreach ($os as $os_string) {
93 if (stristr($title, $os_string) !==
false) {
100 foreach ($a_mount_instructions as $title => $text) {
101 if ($title == $selected) {
104 $hidden =
'style="display: none;"';
108 $legacy =
$f->legacy(
"<div id='$title' class='instructions' $hidden>$text</div>")
109 ->withCustomSignal($title,
"il.UI.showMountInstructions(event, '$title');");
115 $view_control_actions[$title] = $legacy->getCustomSignal($title);
118 $view_control =
$f->viewControl()->mode($view_control_actions,
"mount-instruction-buttons")->withActive($selected);
121 $header_comps = array(
122 $f->legacy(
"<div class='webdav-view-control'>"),
124 $f->legacy(
"</div>"),
125 $js_function_legacy);
127 $comps = array_merge($header_comps, $comps);
129 return $a_render_async ? $r->renderAsync($comps) : $r->render($comps);
determineOSfromUserAgent()
◆ determineOSfromUserAgent()
ilWebDAVMountInstructionsGUI::determineOSfromUserAgent |
( |
| ) |
|
|
private |
Definition at line 149 of file class.ilWebDAVMountInstructionsGUI.php.
References ILIAS\FileDelivery\http().
Referenced by buildGUIFromGivenMountInstructions().
151 $ua = $this->
http->request()->getHeader(
'User-Agent')[0];
153 if (stristr($ua,
'windows') !==
false 154 || strpos($ua,
'microsoft') !==
false) {
158 if (stristr($this->user_agent,
'darwin') !==
false 159 || stristr($ua,
'macintosh') !==
false) {
160 return [
'mac',
'osx'];
163 if (stristr($ua,
'linux') !==
false 164 || stristr($ua,
'solaris') !==
false 165 || stristr($ua,
'aix') !==
false 166 || stristr($ua,
'unix') !==
false 167 || stristr($ua,
'gvfs') !==
false static http()
Fetches the global http state from ILIAS.
◆ renderMountInstructionsContent()
ilWebDAVMountInstructionsGUI::renderMountInstructionsContent |
( |
| ) |
|
Definition at line 132 of file class.ilWebDAVMountInstructionsGUI.php.
References Vendor\Package\$e, buildGUIFromGivenMountInstructions(), and exit.
135 $instructions = $this->mount_instruction->getMountInstructionsAsArray();
138 $instructions = $document_processor->processMountInstructions($this->il_lang->txt(
'webfolder_instructions_text'));
139 $instructions = $this->mount_instruction->getMountInstructionsAsArray($instructions);
140 if ($instructions ==
'' || $instructions ==
'-webfolder_instructions_text-') {
141 $instructions = [
"<div class='alert alert-danger'>" . $this->il_lang->txt(
'error') .
": " . $this->il_lang->txt(
'webdav_missing_lang') .
"</div>"];
buildGUIFromGivenMountInstructions($a_mount_instructions, $a_render_async=false)
◆ $base_url
ilWebDAVMountInstructionsGUI::$base_url |
|
protected |
◆ $http
ilWebDAVMountInstructionsGUI::$http |
|
protected |
◆ $il_lang
ilWebDAVMountInstructionsGUI::$il_lang |
|
protected |
◆ $mount_instruction
ilWebDAVMountInstructionsGUI::$mount_instruction |
|
protected |
◆ $protocol_prefixes
ilWebDAVMountInstructionsGUI::$protocol_prefixes |
|
protected |
◆ $ref_id
ilWebDAVMountInstructionsGUI::$ref_id |
|
protected |
◆ $ui
ilWebDAVMountInstructionsGUI::$ui |
|
protected |
The documentation for this class was generated from the following file: