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 ilSubmitInactive').attr('aria-pressed', 'true');"
   57            
   58            . '$(".instructions").hide();'
   59            
   60            . '$("#"+id).show();}</script>');
   61 
   62        
   63
   64
   65        if (count($a_mount_instructions) === 1) {
   66            $content = 
$f->legacy(
"<div class='instructions'>" . array_shift($a_mount_instructions) . 
"</div>");
 
   67            
   68            return $a_render_async ? $r->renderAsync($content) : $r->render($content);
   69        }
   70        
   71        
   72
   73
   74
   75
   76
   77
   78        $view_control_actions = array();
   79        
   80        
   81
   82
   83
   84        
   85        foreach ($a_mount_instructions as $key => $value) {
   86            $selected = $a_mount_instructions[$key];
   87            break;
   88        }
   89        
   90        
   91        foreach ($a_mount_instructions as $title => $text) {
   92            foreach ($os as $os_string) {
   93                if (stristr($title, $os_string) !== false) {
   94                    $selected = $title;
   95                    break 2;
   96                }
   97            }
   98        }
   99        
  100        foreach ($a_mount_instructions as $title => $text) {
  101            if ($title == $selected) {
  102                $hidden = '';
  103            } else {
  104                $hidden = 'style="display: none;"';
  105            }
  106            
  107            
  108            $legacy = 
$f->legacy(
"<div id='$title' class='instructions' $hidden>$text</div>")
 
  109                ->withCustomSignal($title, "il.UI.showMountInstructions(event, '$title');");
  110 
  111            
  112            $comps[] = $legacy;
  113 
  114            
  115            $view_control_actions[$title] = $legacy->getCustomSignal($title);
  116        }
  117 
  118        $view_control = 
$f->viewControl()->mode($view_control_actions, 
"mount-instruction-buttons")->withActive($selected);
 
  119 
  120        
  121        $header_comps = array(
  122            $f->legacy(
"<div class='webdav-view-control'>"),
 
  123            $view_control,
  124            $f->legacy(
"</div>"),
 
  125            $js_function_legacy);
  126 
  127        $comps = array_merge($header_comps, $comps);
  128 
  129        return $a_render_async ? $r->renderAsync($comps) : $r->render($comps);
  130    }
determineOSfromUserAgent()