123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- BI and PM: qs
- (C) Copyright IBM Corp. 2001, 2017
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
- <pf:variables/>
- <xsl:variable name="skin" select="concat($webRoot, '/skins/', /root/user/param[@name='skin'])"/>
- <xsl:template match="/">
- <xsl:for-each select="/root/ui/insertMenu">
- <xsl:call-template name="doMenuDiv">
- <xsl:with-param name="selection" select="@alias"/>
- </xsl:call-template>
- </xsl:for-each>
- <xsl:for-each select="/root/ui/menuContent/menu">
- <xsl:call-template name="doMenuDiv">
- <xsl:with-param name="selection" select="@alias"/>
- </xsl:call-template>
- </xsl:for-each>
- <table id="metadata_menu_closed" name="metadata_menu_panel" class="menuButtonBody" height="100%" width="15" border="0" cellpadding="0" cellspacing="0" style="margin-left:10px; display:none;">
- <tr>
- <td class="menuButton" onmousedown="expandMenu()">
- <img src="{$skin}/viewer/images/menu_expand.gif" height="13" width="13" border="0" style="margin-top:1px;">
- <xsl:attribute name="title"><xts:string id="MENU_PANE_EXPAND_TIP"/></xsl:attribute>
- </img>
- </td>
- </tr>
- <tr>
- <td height="100%" class="menuContentCollapsed" style="border-bottom:0px; border-right:0px"> </td>
- </tr>
- </table>
- </xsl:template>
- <xsl:template name="doMenuDiv">
- <xsl:param name="selection" select="'edit'"/>
- <table id="metadata_menu_{@alias}" name="metadata_menu_panel" class="menuPage" border="0" cellpadding="0" cellspacing="0" style="height:100%;width:100%;display:none;">
- <xsl:attribute name="onmousemove">resizeMenuPane(event)</xsl:attribute>
- <xsl:attribute name="onmouseup">enableResize(false)</xsl:attribute>
- <tr>
- <td width="100%" style="padding:0px 5px;">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td class="menuHeader" valign="bottom">
- <xsl:text/><xts:string id="MENU_TITLE"/><xsl:text/>
- </td>
- <td class="menuHeaderButton" onmousedown="collapseMenu()">
- <img src="{$skin}/qs/images/menu_collapse.gif" border="0" style="margin: 1px 0px 0px 1px;">
- <xsl:attribute name="title"><xts:string id="MENU_PANE_COLLAPSE_TIP"/></xsl:attribute>
- </img>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr style="height:100%;">
- <td height="100%">
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
- <!-- spacer -->
- <tr>
- <td width="100%" style="height:3px;padding:0px 5px;">
- <table cellpadding="0" cellspacing="0" border="0" style="height:100%;width:100%;" class="borderCollapse">
- <tr>
- <td class="menuItemSpacerTop" style="height:100%;width:100%;"/>
- </tr>
- </table>
- </td>
- </tr>
- <xsl:for-each select="/root/ui/insertMenu">
- <xsl:choose>
- <xsl:when test="@alias=$selection"><xsl:call-template name="selectedMenu"/></xsl:when>
- <xsl:otherwise><xsl:call-template name="unselectedMenu"/></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:for-each select="/root/ui/menuContent/menu">
- <xsl:choose>
- <xsl:when test="@alias=$selection"><xsl:call-template name="selectedMenu"/></xsl:when>
- <xsl:otherwise><xsl:call-template name="unselectedMenu"/></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <tr>
- <td width="100%" style="height:3px;padding:0px 5px;">
- <table cellpadding="0" cellspacing="0" border="0" style="height:100%;width:100%;" class="borderCollapse">
- <tr>
- <td class="menuItemSpacer" style="height:100%;width:100%;"/>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="100%" height="100%" id="menuContent" class="menuContent" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
- <tr>
- <td style="padding:0px; margin:0px; width:100%;" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%" style="table-layout:fixed">
- <xsl:choose>
- <xsl:when test="/root/ui/insertMenu[@alias=$selection]">
- <xsl:apply-templates select="/root/ui/insertMenu[@alias=$selection]/content"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="/root/ui/menuContent/menu[@alias=$selection]/*[(name()='menuItem' and @id!='') or name()='separator']"/>
- <tr height="100%">
- <td colspan="2" height="100%"/>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- </table>
- </td>
- <td style="width:3px; cursor:e-resize;" onmousedown="enableResize(true); return false;" onmousemove="setMenuResizeDirection('ew');resizeMenuPane(event); return false;" onmouseup="enableResize(false)">
- <xsl:if test="/root/browserInfo/isIE='true'">
- <xsl:attribute name="ondrag">return false;</xsl:attribute>
- </xsl:if>
- <img border="0" width="3">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
- </img>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </xsl:template>
- <xsl:template name="selectedMenu">
- <tr>
- <td class="menuItemSelected" width="100%">
- <xsl:value-of select="./name"/>
- </td>
- </tr>
- </xsl:template>
- <xsl:template name="unselectedMenu">
- <tr>
- <td width="100%" style="padding:0px 5px;">
- <div class="menuItem" onmousedown="changeMenu('{@alias}')">
- <xsl:if test="/root/browserInfo/isIE='true'">
- <xsl:attribute name="style">width:100%;</xsl:attribute>
- </xsl:if>
- <xsl:value-of select="./name"/>
- </div>
- </td>
- </tr>
- </xsl:template>
- <xsl:template match="separator">
- <tr>
- <td>
- <img width="16" height="12">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
- </img>
- </td>
- <td>
- <img width="16" height="12">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
- </img>
- </td>
- </tr>
- </xsl:template>
-
- <xsl:template match="menuItem">
- <xsl:variable name="menuItemId"><xsl:value-of select="./@id"/></xsl:variable>
- <xsl:variable name="menuItemValue"><xsl:value-of select="./@value"/></xsl:variable>
- <xsl:for-each select="/root/features/included/feature[@name=$menuItemId]/menuItem[@type='menuItem' and (not(@value) or @value=$menuItemValue)]">
- <xsl:variable name="packageCaps">
- <xsl:for-each select="../userCapabilities/userCapability">
- <xsl:value-of select="/root/userCapabilities/value/item = ."/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="globalCaps">
- <xsl:for-each select="../userCapabilities/globalUserCapability">
- <xsl:variable name="currentCapName" select="."/>
- <xsl:value-of select="count(/root/session/param[@name='capabilities']/*[local-name() = $currentCapName]) > 0 "/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="effectivelyHasPackageCap" select="(count(../userCapabilities/userCapability)=0 or contains($packageCaps,'true')) and (../@name!='ReportStudio' or $userCanUseRS)"/>
- <xsl:variable name="effectivelyHasGlobalCap" select="(count(../userCapabilities/globalUserCapability)=0 or contains($globalCaps,'true')) and (../@name!='ReportStudio' or $userCanUseRS)"/>
-
- <xsl:if test="$effectivelyHasPackageCap and $effectivelyHasGlobalCap">
- <tr>
- <td style="width:26px;text-align:left;">
- <table border="0" cellpadding="0" cellspacing="0" style="width:100%;height:20px">
- <tr>
- <td style="height:100%;width:100%;">
- <xsl:choose>
- <xsl:when test="./icon/active!='' and ./icon/active[@useWebRoot='true']">
- <img width="16" height="16">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/<xsl:value-of select="./icon/active"/></xsl:attribute>
- </img>
- </xsl:when>
- <xsl:when test="./icon/active!=''">
- <img src="{./icon/active}" width="16" height="16"/>
- </xsl:when>
- <xsl:otherwise>
- <img width="16" height="16">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
- </img>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </td>
- <td width="100%" class="menuAction" title="{./tooltip}">
- <xsl:attribute name="onclick">
- <xsl:text/>goApplicationManager.getFeatureManager().launchFeature('<xsl:value-of select="$menuItemId"/>'<xsl:text/>
- <xsl:if test="count(./action/parameters/*)>0">
- <xsl:text/>, new Array(<xsl:text/>
- <xsl:for-each select="./action/parameters/parameter">
- <xsl:if test="position()>1"><xsl:text/>, <xsl:text/></xsl:if>
- <xsl:choose>
- <xsl:when test="@type='string'">
- <xsl:text/>'<xsl:value-of select="."/>'<xsl:text/>
- </xsl:when>
- <xsl:when test="@type='boolean' or @type='numeric'">
- <xsl:text/><xsl:value-of select="."/><xsl:text/>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text/>)<xsl:text/>
- </xsl:if>
- <xsl:text/>)<xsl:text/>
- </xsl:attribute>
- <xsl:value-of select="./label"/>
- </td>
- </tr>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="content">
- <xsl:copy-of select="./*"/>
- </xsl:template>
- </xsl:stylesheet>
|