38 {
40
41 $f = $this->
ui->factory();
42 $r = $this->
ui->renderer();
43
44
45 $comps = array();
46
47
48 $js_function_legacy =
$f->legacy(
'<script>'
49 . 'il.UI.showMountInstructions = function (e, id){'
50
51 . "obj = $(e['target']);"
52
53 . "obj.siblings().removeClass('engaged disabled ilSubmitInactive').attr('aria-pressed', 'false');"
54 . "obj.siblings().removeAttr('disabled');"
55
56 . "obj.addClass('engaged disabled ilSubmitInactive').attr('aria-pressed', 'true');"
57 . "obj.attr('disabled', 'disabled');"
58
59 . '$(".instructions").hide();'
60
61 . '$("#"+id).show();}</script>');
62
63
64
65
66 if (count($a_mount_instructions) === 1) {
67 $content =
$f->legacy(
"<div class='instructions'>" . array_shift($a_mount_instructions) .
"</div>");
68
69 return $a_render_async ? $r->renderAsync($content) : $r->render($content);
70 }
71
72
73
74
75
76
77
78
79 $view_control_actions = array();
80
81
82
83
84
85
86 foreach ($a_mount_instructions as $key => $value) {
87 $selected = $a_mount_instructions[$key];
88 break;
89 }
90
91
92 foreach ($a_mount_instructions as $title => $text) {
93 foreach ($os as $os_string) {
94 if (stristr($title, $os_string) !== false) {
95 $selected = $title;
96 break 2;
97 }
98 }
99 }
100
101 foreach ($a_mount_instructions as $title => $text) {
102 if ($title == $selected) {
103 $hidden = '';
104 } else {
105 $hidden = 'style="display: none;"';
106 }
107
108
109 $legacy =
$f->legacy(
"<div id='$title' class='instructions' $hidden>$text</div>")
110 ->withCustomSignal($title, "il.UI.showMountInstructions(event, '$title');");
111
112
113 $comps[] = $legacy;
114
115
116 $view_control_actions[$title] = $legacy->getCustomSignal($title);
117 }
118
119 $view_control =
$f->viewControl()->mode($view_control_actions,
"mount-instruction-buttons")->withActive($selected);
120
121
122 $header_comps = array(
123 $f->legacy(
"<div style='text-align: center'>"),
124 $view_control,
125 $f->legacy(
"</div>"),
126 $js_function_legacy);
127
128 $comps = array_merge($header_comps, $comps);
129
130 return $a_render_async ? $r->renderAsync($comps) : $r->render($comps);
131 }
determineOSfromUserAgent()