<%args>
  $__session_id => undef
  $__comp       => undef
  @menu_path  => ()
</%args>
     <div id="navi">
      <div class="menu">
        <& /lib/menu.mhtml, path => [ @menu_path ] &>
      </div> <!-- menu -->
     </div> <!-- navi -->

     <div id="content">
<%perl>
       # normal processing may only happen if the client is in the "normal"
       # state 'can_send'
       #if ($session_context->{client}->get_communication_state() 
       #    eq 'can_send') {
       #    $m->call_next;
       #}

       $m->comp ('/lib/debug.mhtml',
                 'level' => 2,
                 'msg'   => "next component name: ".$m->fetch_next()->name());
       if ($m->fetch_next()->name() eq "dhandler" and
           defined $__comp and
           $__comp eq '/service/index.html')
       {
           ## autohandler called directly - usually from authentication
           ## this is no error and so we only call index.html and not the dhandler
           $m->comp ('/service/index.html');
       } else {
           ## print STDERR "NEXT: ".$m->fetch_next()->name()."\n";
           $m->call_next;
       }

#       # the server may wish to answer something - if this is the case
#       # the process_response component detects this and generates the
#       # corresponding output
#       $m->comp('/lib/process_response.mhtml');
</%perl>
     </div> <!-- content -->

<%init>
  ## fix content type
  $r->content_type('text/html; charset=utf-8');

  ## check that we are in the correct state
  
</%init>

<%method title>
  OpenXPKI
</%method>
