<?xml version="1.0"  encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="pageComponents_html.xsl" />
<!--In diesem Stylesheet können Sie individuelle templates unterbringen,
  die in ihrer Präzedenz das normale Stylesheet 
  pageComponents_html.xsl überragt. --> 
<xsl:import href="pageComponents_html_final.xsl" />

<xsl:output method="html" indent="yes" /> 
<xsl:template name="menuFrame">
<xsl:variable name="user"  select = "menue/user"/>
<xsl:variable name="useragent" select="'mozilla'" /> 
<xsl:variable name="mandantenid">
<xsl:choose>
<xsl:when test="string-length(/menue/mandantenid) &gt; 0 and /menue/mandantenid !='default'">
<xsl:value-of select="concat(/menue/mandantenid,'/')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''" />
</xsl:otherwise>
</xsl:choose>  
</xsl:variable><xsl:variable name="showPasswordChangeLink">
<xsl:call-template name="showPasswordChangeLink" />
</xsl:variable>
<xsl:variable name="showLogoutLink">
<xsl:call-template name="showLogoutLink" />
</xsl:variable>
<xsl:variable name="showAppletLink">
<xsl:call-template name="showAppletLink" />
</xsl:variable>

<div class="menue menuFrame" id="leftpanel3">
<!-- <div id="navigation_on_off" style="visibility:hidden; position:absolute;top:0px; left:8px;min-width:95%;min-height:100%;background-color:white">
<a class="navigation_on_off_link" onclick="top.document.getElementById('superxframes').cols='255,*'; top.document.getElementById('menue').scrolling='auto'; document.getElementById('navigation_on_off').style.visibility='hidden';" style="cursor:pointer;"></a>
</div> -->
<xsl:variable name="showJavascriptMenue"><xsl:call-template name="showJavascriptMenue" /></xsl:variable>
  <xsl:variable name="showThemenbaumMask"><xsl:call-template name="showThemenbaumMask" /></xsl:variable>
<xsl:choose>
<xsl:when test="$showJavascriptMenue='true'"> 
<xsl:call-template name="eintraege_js">
<xsl:with-param name="showLogoutLink"  select="$showLogoutLink"/>
</xsl:call-template>
<noscript>	
<xsl:call-template name="eintraege">
<xsl:with-param name="showLogoutLink" />
</xsl:call-template>
</noscript>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="eintraege">
<xsl:with-param name="showLogoutLink" select="$showLogoutLink"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<!-- <xsl:call-template name="bottombar_menue" >
<xsl:with-param name="showPasswordChangeLink"  select="$showPasswordChangeLink"/>
<xsl:with-param name="mandantenid"  select="$mandantenid"/>
<xsl:with-param name="showLogoutLink"  select="$showLogoutLink"/>
<xsl:with-param name="showAppletLink" select="$showAppletLink" />
</xsl:call-template -->

<xsl:call-template name="menue_fuss" />
</div>
<!-- <div style="clear: left;float: left;width: 0px;margin: 300px 250px 0px 0px;padding: 0px;"></div> -->
</xsl:template>

<xsl:template name="eintraege">
<xsl:param name="showLogoutLink" />
<div class="menue">
<ul class="ui-listview" style="margin:0;padding:0">
<xsl:variable name="t_root"/>
 		<xsl:variable name="t_null" select = "null" />
<xsl:variable name="is_admin"><xsl:value-of select = "../user/@admin" /></xsl:variable>

	  <xsl:for-each select="eintraege/eintrag">
	  <xsl:if test="parent='null'">
	        <xsl:call-template name="suche_kinder_dojo">
          		<xsl:with-param name="elter" select="id"/>
            	<xsl:with-param name="ebene" select="1"/>
      	</xsl:call-template>
			
	 </xsl:if> 
 
      </xsl:for-each>
      <!--Wenn UserID/@admin=true, dann auch Links für Manager und Entwicklung zeigen:-->
      <xsl:if test="$is_admin='true'">
      <li style="list-style:none"><p class="listlevel">&#160;</p></li>
      	<xsl:choose>
		<xsl:when test="/*/@hisinone_active='true'">
		      <li style="list-style:none" class="ebene1"><p class="listlevel"><a class="ebene_his_1 icon icon-wrench" tabindex="30" href="/superx/servlet/SuperXManager" target="_blank" style="cursor:pointer;">Webanwendung Manager</a></p></li>
		</xsl:when>
		<xsl:otherwise>
		      <li style="list-style:none" class="ebene1"><p class="listlevel"><a class="ebene_his_1 icon icon-wrench" tabindex="30" href="/superx/edit/kern/webapp_manager.jsp" target="_blank" style="cursor:pointer;">Webanwendung Manager</a></p></li>
		</xsl:otherwise>
	</xsl:choose>
<li style="list-style:none" class="ebene2"><p class="listlevel"><a class="ebene_his_2" tabindex="30" href="/superx/servlet/SuperXManager?xupdater=true" target="_blank" style="cursor:pointer;">Masken-Sicherung</a></p></li>
      <li style="list-style:none" class="ebene2"><p class="listlevel"><a class="ebene_his_2" tabindex="30" href="/superx/servlet/de.superx.servlet.Entwicklung" target="_blank" style="cursor:pointer;">Masken-Entwicklung</a></p></li>
      </xsl:if>
      <li style="list-style:none"><p class="listlevel">&#160;</p></li>
      <!-- <li style="list-style:none" class="ebene1"><p class="listlevel"><a class="ebene_his_1" tabindex="30" onclick="top.document.getElementById('superxframes').cols='40,*'; scroll(0,0); top.document.getElementById('menue').scrolling='no'; document.getElementById('navigation_on_off').style.visibility='visible';" style="cursor:pointer;">Navigation ausblenden</a></p></li> -->
      <li style="list-style:none"><p class="listlevel">&#160;</p></li>
      <xsl:if test="$showLogoutLink='true' and not(starts-with(/*/nachricht, 'gast')) and not(starts-with(/menue/user, 'gast')) ">
       <li style="list-style:none" class="ebene1"><p class="listlevel"><a class="ebene_his_1 icon icon-logout" tabindex="30" href="/superx/servlet/SuperXmlAbmeldung" target="_parent" style="cursor:pointer;">Abmelden</a></p></li>
      </xsl:if></ul>
</div>
<!--<script language="Javascript">
versteckeText("toc_complete");
</script>-->

<!--#######################################################################-->
  </xsl:template>
<xsl:template name="eintraege_js">
<xsl:param name="showLogoutLink" />
<script language="Javascript" src="../xml/dynapi/dynapi.js">
</script>
<script language="Javascript" src="../xml/texteffekte.js"></script>

<script language="Javascript">
dynapi.library.setPath('../xml/dynapi/');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.api.ext.DynLayerInline');
dynapi.library.include('TemplateManager');
dynapi.library.include('dynapi.gui.BorderManager');
dynapi.library.include('dynapi.gui.HTMLCalendar');
dynapi.library.include('ViewPane');
dynapi.library.include('Explorer');
dynapi.library.include('ExplorerBlockStyle'); 
<![CDATA[
ie5=(document.getElementById&&document.all&&document.styleSheets)?1:0;
nn6=(document.getElementById&&!document.all)?1:0; 
]]>
</script>
<script language="Javascript">
<xsl:text>
var	s = Styles.getStyle('Explorer');
var file1 = s.getStyleAttribute('imageFile');
var expl2 = new Explorer(0,0,null,null,'ExplorerBlock');
expl2.setBgColor('#EEEEEE');

menue = new Array();
var i=1;
</xsl:text>
 <xsl:variable name="showThemenbaumMask"><xsl:call-template name="showThemenbaumMask" /></xsl:variable>
<xsl:for-each select="menue/eintraege/eintrag">
<!-- MB 2.6.08 passende Sortierung nach sort-Feld/Name wird jetzt vom Servlet schon gemacht-->
 <!--<xsl:sort select="parent"/><xsl:sort select="titel"/>--> 
 
<xsl:variable name="my_parent"><xsl:value-of select="parent" /></xsl:variable>  
<!--nur wenn ein parent auch existiert wird der Eintrag eingefügt.--> 
<xsl:if test="count(/menue/eintraege/eintrag[ id = $my_parent ]/id) &gt; 0 or id='1'">

<xsl:text>
menue[i] = new Array();
menue[i][4]= '</xsl:text><xsl:value-of select="id"/><xsl:text>';
menue[i][2]= '</xsl:text><xsl:value-of select="titel"/><xsl:text>';
menue[i][3]= '</xsl:text><xsl:value-of select="parent"/><xsl:text>';
menue[i][1]= '</xsl:text><xsl:value-of select="tid"/><xsl:text>';
i++;
var zeilenanzahl=i-1;
</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text><![CDATA[
for (var i=1;i <= zeilenanzahl;i++)
{
	if(menue[i][3]=="null") //parent null = root
	{	expl2.addLeave(menue[i][4],menue[i][2],null,null,null,'null');	}
	else
	{
	]]></xsl:text>
	
		
		<xsl:choose>
		<xsl:when test="$showThemenbaumMask='false'"> 
			<xsl:text><![CDATA[
			if(menue[i][1]=="null") //tid in maskeninfo
		       {
		      expl2.addLeave(menue[i][4],menue[i][2],menue[i][3],null,null,"]]></xsl:text><xsl:value-of select="'/superx/servlet/SuperXmlMenu'" /><xsl:text><![CDATA[?tid="+menue[i][4]);
			}]]></xsl:text>
		</xsl:when>
		<xsl:otherwise>
		<xsl:text><![CDATA[
			if(menue[i][1]=="null") //tid in maskeninfo
		       {
		      expl2.addLeave(menue[i][4],menue[i][2],menue[i][3],null,null,'null');
			}
			else
		{
		expl2.addLeave(menue[i][4],menue[i][2],menue[i][3],file1,null,"]]></xsl:text><xsl:value-of select="'/superx/servlet/SuperXmlMaske'" /><xsl:text><![CDATA[?tid="+menue[i][1]);
		}]]></xsl:text>
		</xsl:otherwise>
		</xsl:choose>
	<xsl:text>
		<![CDATA[	
		}
}
expl2.unfold(1);
expl2.addEventListener({
		onselect : function(e) {
		
			status=("Current ID is: "+e.getSource().currentPos+" and currentUrl is: "+e.getSource().currentUrl);
			if(e.getSource().currentUrl!="null") //{oeffneMaske(e.getSource().currentUrl);}
			{
			
			parent.maske.location.href="/superx/xml/maskload.htm";
			window.setTimeout("parent.maske.location.href='"+e.getSource().currentUrl+"'", 300)
			
			}
			}
	});
	
	

var lyr12=dynapi.document.addChild(expl2);
dynapi.document.insertChild(lyr12,'relative');



]]></xsl:text>
</script>
<xsl:if test="$showLogoutLink='true'">
     <p class="listlevel"><a class="ebene_his_1 icon icon-logout" tabindex="30" href="/superx/servlet/SuperXmlAbmeldung" target="_parent" style="cursor:pointer;">Abmelden</a></p>
      </xsl:if>
</xsl:template>
  <xsl:template name="suche_kinder_dojo">
    <xsl:param name="elter"/>
    <xsl:param name="ebene"/>
     <xsl:variable name="showThemenbaumMask"><xsl:call-template name="showThemenbaumMask" /></xsl:variable>
        <xsl:for-each select="../eintrag">
<!-- MB 2.6.08 passende Sortierung nach sort-Feld/Name wird jetzt vom Servlet schon gemacht-->
 <!--<xsl:sort select="parent"/><xsl:sort select="titel"/>--> 
      <xsl:variable name="i" select="parent"/>

     <xsl:if test="$i=$elter">
	
	
     	<xsl:if test="tid='null'"> <!-- keine Maske -->
	<li style="list-style:none">
	<!-- <div> -->
	<xsl:attribute name="class">ebene<xsl:value-of select="$ebene" />
	</xsl:attribute>
	<p class="listlevel">
		<xsl:choose>
		<xsl:when test="$showThemenbaumMask='false'">
		<!--wenn false, dann wird die Überschrift als Link angezeigt-->
	  <a>
	  	<xsl:attribute name="class">ebene_his_<xsl:value-of select="$ebene" /><xsl:value-of select="concat(' ',css_class)" />
			</xsl:attribute>
		  <xsl:attribute name="href">
		 <xsl:value-of select="'/superx/servlet/SuperXmlMenu'" /> <xsl:text>?tid=</xsl:text><xsl:value-of select="id"/><xsl:text>&amp;navi=true</xsl:text>
		  </xsl:attribute>
		  <xsl:value-of select="titel"/>
			  </a>
	</xsl:when>
	<xsl:otherwise>
	<xsl:value-of select="titel" />
	</xsl:otherwise>
	</xsl:choose>
	</p>
	<!-- </div>  -->
	</li>
	</xsl:if>   
     	<xsl:if test="(tid!='null') and ($showThemenbaumMask!='false')"> <!-- wenn Menülinks keine Einzelmasken-->
	<li style="list-style:none">
<p>
	<xsl:attribute name="class">listlevel<xsl:value-of select="$ebene" />
	</xsl:attribute>
	<a target="maske"  class="auflistung">
	<xsl:attribute name="href">
	<xsl:value-of select="'/superx/servlet/SuperXmlMaske'" />
	<xsl:text>?tid=</xsl:text><xsl:value-of select="tid" />
	</xsl:attribute>
	<!--<xsl:attribute name="class">listlevel<xsl:value-of select="$ebene" />
	</xsl:attribute>-->	
		

		<xsl:value-of select="titel" />
		<!--<xsl:attribute name="href">javascript:parent.menue.document.forms[0].tid.value=<xsl:value-of select="tid" />;parent.menue.document.forms[0].submit();</xsl:attribute>
	<xsl:value-of select="titel" />-->
	</a></p></li>
	</xsl:if>   
	  		 
 
        <xsl:call-template name="suche_kinder_dojo">
          <xsl:with-param name="elter" select="id"/>
          <xsl:with-param name="ebene" select="$ebene+1"/>
       </xsl:call-template>
      
        
	</xsl:if>   

    </xsl:for-each>
	
  </xsl:template>


</xsl:stylesheet>