123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:import href="render-menu.xslt"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/">
- <xsl:call-template name="renderToolbar"/>
- </xsl:template>
- <xsl:template name="renderToolbar">
- <xsl:param name="toolbar" select="/root/input/toolbar"/>
- <div id="leftcontent" role="toolbar">
- <xsl:for-each select="$toolbar/item">
- <xsl:if test="starts-with(./@type,'combo') or ./@type='link' or ./@type='button'">
- <!-- render a separator -->
- <xsl:if test="./@separatorBefore='true'">
- <div role="separator" class="separator"/>
- </xsl:if>
- <xsl:if test="./@labelBefore">
- <div>
- <table class="labelTable">
- <tr>
- <td class="labelCell">
- <xsl:value-of select="./@labelBefore"/>
- </td>
- </tr>
- </table>
- </div>
- </xsl:if>
- <div class="dropDownButton" onmouseover="javascript:this.className='dropdownButtonMouseOver'" onmouseout="javascript:this.className='dropdownButtonMouseOut'">
- <!-- add some extra mouse down/mouse up handlers for combo box/combo button menus -->
- <xsl:if test="./@type='button' or ./@type='comboButton'">
- <xsl:attribute name="onmousedown">javascript:this.className='dropDownButtonMouseDown'</xsl:attribute>
- <xsl:attribute name="onmouseup">javascript:this.className='dropDownButton'</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <!-- render a combo box/combo button menu -->
- <xsl:when test="starts-with(./@type,'combo')">
- <xsl:call-template name="renderMenu">
- <xsl:with-param name="menu" select="./menu"/>
- <xsl:with-param name="customName" select="concat('_THIS_',./menu/@id)"/>
- <xsl:with-param name="menuType" select="./@type"/>
- </xsl:call-template>
- </xsl:when>
- <!-- render a link -->
- <xsl:when test="./@type='link'">
- <a href="{./action}"><xsl:value-of select="./name"/></a>
- </xsl:when>
- <!-- render a button, a button can have a title or an image -->
- <xsl:when test="./@type='button' or ./@type='comboButton'">
- <div border="10" onkeypress="if (_hts_getKeyCode(event) == 13 || _hts_getKeyCode(event) == 32) {./action}" onclick="{./action}">
- <xsl:choose>
- <xsl:when test="./image">
- <img tabindex="0" border="0" src="_THIS?frag-resource=/{./image}/THIS_" alt="{./name}" title="{./name}">
- <xsl:if test="./@type='button'">
- <xsl:attribute name="role">button</xsl:attribute>
- </xsl:if>
- </img>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="./name"/></xsl:otherwise>
- </xsl:choose>
- </div>
- </xsl:when>
- </xsl:choose>
- </div>
- </xsl:if>
- </xsl:for-each>
- </div>
- </xsl:template>
- </xsl:stylesheet>
|