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 disabled ilSubmitInactive').attr('aria-pressed', 'true');" 57 .
"obj.attr('disabled', 'disabled');" 59 .
'$(".instructions").hide();' 61 .
'$("#"+id).show();}</script>');
66 if (count($a_mount_instructions) === 1) {
67 $content =
$f->legacy(
"<div class='instructions'>" . array_shift($a_mount_instructions) .
"</div>");
69 return $a_render_async ? $r->renderAsync($content) : $r->render($content);
79 $view_control_actions = array();
86 foreach ($a_mount_instructions as $key => $value) {
87 $selected = $a_mount_instructions[$key];
92 foreach ($a_mount_instructions as $title => $text) {
93 foreach ($os as $os_string) {
94 if (stristr($title, $os_string) !==
false) {
101 foreach ($a_mount_instructions as $title => $text) {
102 if ($title == $selected) {
105 $hidden =
'style="display: none;"';
109 $legacy =
$f->legacy(
"<div id='$title' class='instructions' $hidden>$text</div>")
110 ->withCustomSignal($title,
"il.UI.showMountInstructions(event, '$title');");
116 $view_control_actions[$title] = $legacy->getCustomSignal($title);
119 $view_control =
$f->viewControl()->mode($view_control_actions,
"mount-instruction-buttons")->withActive($selected);
122 $header_comps = array(
123 $f->legacy(
"<div style='text-align: center'>"),
125 $f->legacy(
"</div>"),
126 $js_function_legacy);
128 $comps = array_merge($header_comps, $comps);
130 return $a_render_async ? $r->renderAsync($comps) : $r->render($comps);
determineOSfromUserAgent()
◆ determineOSfromUserAgent()
ilWebDAVMountInstructionsGUI::determineOSfromUserAgent |
( |
| ) |
|
|
private |
Definition at line 150 of file class.ilWebDAVMountInstructionsGUI.php.
References ILIAS\FileDelivery\http().
Referenced by buildGUIFromGivenMountInstructions().
152 $ua = $this->
http->request()->getHeader(
'User-Agent')[0];
154 if (stristr($ua,
'windows') !==
false 155 || strpos($ua,
'microsoft') !==
false) {
159 if (stristr($this->user_agent,
'darwin') !==
false 160 || stristr($ua,
'macintosh') !==
false) {
161 return [
'mac',
'osx'];
164 if (stristr($ua,
'linux') !==
false 165 || stristr($ua,
'solaris') !==
false 166 || stristr($ua,
'aix') !==
false 167 || stristr($ua,
'unix') !==
false 168 || stristr($ua,
'gvfs') !==
false static http()
Fetches the global http state from ILIAS.
◆ renderMountInstructionsContent()
ilWebDAVMountInstructionsGUI::renderMountInstructionsContent |
( |
| ) |
|
Definition at line 133 of file class.ilWebDAVMountInstructionsGUI.php.
References Vendor\Package\$e, buildGUIFromGivenMountInstructions(), and exit.
136 $instructions = $this->mount_instruction->getMountInstructionsAsArray();
139 $instructions = $document_processor->processMountInstructions($this->il_lang->txt(
'webfolder_instructions_text'));
140 $instructions = $this->mount_instruction->getMountInstructionsAsArray($instructions);
141 if ($instructions ==
'' || $instructions ==
'-webfolder_instructions_text-') {
142 $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: