123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2014
- 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:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl uic xtsext">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="uic:icon">
- <xsl:param name="valign" select="''"/>
- <!-- figure out if we should be putting the rollover effect -->
- <xsl:variable name="doRollOver" select="boolean(@rollOver) or uic:onclick"/>
- <!-- build up the style attribute of the img -->
- <xsl:variable name="imgStyle">
- <xsl:choose>
- <xsl:when test="$valign != ''">vertical-align:<xsl:value-of select="$valign"/>;</xsl:when>
- <xsl:when test="@valign != ''">vertical-align:<xsl:value-of select="@valign"/>;</xsl:when>
- </xsl:choose>
- <xsl:if test="not($doRollOver) and uic:onclick != ''">cursor:pointer;</xsl:if>
- <xsl:if test="@style != ''">
- <xsl:value-of select="@style"/>
- </xsl:if>
- </xsl:variable>
- <xsl:if test="position() > 1 and @uic:noSpace != 'true'"> </xsl:if>
-
- <img src="{uic:src}" border="0">
- <xsl:variable name="class">
- <xsl:value-of select="uic:class"/>
- <xsl:if test="$doRollOver">
- <xsl:value-of select="' cogstyle-toolbar-imageNormal'"/>
- </xsl:if>
- <xsl:if test="@disabled='true'">
- <xsl:value-of select="' hiddenEntryIcon'"/>
- </xsl:if>
- </xsl:variable>
- <xsl:if test="$class">
- <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="uic:tooltip != ''">
- <xsl:attribute name="title">
- <xsl:value-of select="normalize-space(uic:tooltip)"/>
- </xsl:attribute>
- <xsl:attribute name="alt">
- <xsl:value-of select="normalize-space(uic:tooltip)"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="alt"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="uic:onclick">
- <xsl:attribute name="onclick"><xsl:apply-templates select="uic:onclick"/></xsl:attribute>
- <xsl:attribute name="onkeypress">if (event.keyCode == 13) {{<xsl:apply-templates select="uic:onclick"/>}}</xsl:attribute>
- </xsl:if>
- <xsl:if test="@width">
- <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@height">
- <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$imgStyle != ''">
- <xsl:attribute name="style"><xsl:value-of select="$imgStyle"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@role">
- <xsl:attribute name="role"><xsl:value-of select="@role"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$doRollOver">
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="tabindex">0</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="@aria-haspopup">
- <xsl:attribute name="aria-haspopup"><xsl:value-of select="@aria-haspopup"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@aria-labelledBy">
- <xsl:attribute name="aria-labelledBy"><xsl:value-of select="@aria-labelledBy"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@title">
- <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@tabIndex">
- <xsl:attribute name="tabIndex"><xsl:value-of select="@tabIndex"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="uic:onmouseout">
- <xsl:attribute name="onmouseout"><xsl:value-of select="uic:onmouseout"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$doRollOver">
- <xsl:attribute name="onmouseout">mouseoutImage(this);</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="uic:onmouseover">
- <xsl:attribute name="onmouseover"><xsl:value-of select="uic:onmouseover"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$doRollOver">
- <xsl:attribute name="onmouseover">mouseoverImage(this);</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="uic:onmousemove">
- <xsl:attribute name="onmousemove"><xsl:value-of select="uic:onmousemove"/></xsl:attribute>
- </xsl:if>
- </img>
- </xsl:template>
- <!--
- hyperlink
- -->
- <xsl:template match="uic:link">
- <xsl:variable name="href">
- <xsl:choose>
- <xsl:when test="@href and @href!=''">
- <xsl:value-of select="@href"/>
- </xsl:when>
- <xsl:when test="uic:href">
- <xsl:apply-templates select="./uic:href"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>#</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <a href="{$href}">
- <xsl:copy-of select="@*[local-name() != 'class' and local-name() != 'style']"/>
- <xsl:if test="uic:onclick != ''">
- <xsl:attribute name="onclick"><xsl:value-of select="xtsext:xmldecode(string(uic:onclick))"/></xsl:attribute>
- <xsl:attribute name="onkeyup">if (event.keyCode == 13) {{<xsl:value-of select="xtsext:xmldecode(string(uic:onclick))"/>}}</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:when>
- <xsl:otherwise><xsl:attribute name="class">cogstyle-form-link</xsl:attribute></xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="uic:text | uic:icon"/>
- </a>
- </xsl:template>
-
- <xsl:template match="uic:text">
- <xsl:choose>
- <xsl:when test="@lang != ''">
- <span>
- <xsl:if test="@lang != ''">
- <xsl:attribute name="lang"><xsl:value-of select="@lang"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="uic:text-workhorse"/>
- </span>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="uic:text-workhorse"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uic:text-workhorse">
- <xsl:if test="position() > 1 and @uic:noSpace != 'true'"> </xsl:if>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="uic:tooltipText">
- <xsl:if test="position() > 1 and @uic:noSpace != 'true'"> </xsl:if>
- <span style="cursor:default;" role="presentation">
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@onmouseover">
- <xsl:attribute name="onmouseover"><xsl:value-of select="@onmouseover"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@onmouseout">
- <xsl:attribute name="onmouseout"><xsl:value-of select="@onmouseout"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@onmousemove">
- <xsl:attribute name="onmousemove"><xsl:value-of select="@onmousemove"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </span>
- </xsl:template>
- <!--
- uic:disabledText - used to show disabled text
- -->
- <xsl:template match="uic:disabledText">
- <xsl:if test="position() > 1 and @uic:noSpace != 'true'"> </xsl:if>
-
- <span class="cogstyle-disabledText"><xsl:apply-templates/></span>
- </xsl:template>
- <xsl:template match="uic:label">
- <span class="cogstyle-form-label">
- <xsl:if test="@id!=''">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@for != ''">
- <label for="{@for}">
- <xsl:apply-templates/>
- </label>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </span>
- </xsl:template>
- <!-- shows a bar chart -->
- <xsl:template match="uic:barChart">
- <div id="_THIS_cogadminChartcontent" style="padding-left:20px; width:100%;">_THIS?frag-subfragment=cogadminChart/THIS_</div>
- </xsl:template>
-
- <!--
- Template - uic:help:
- This template defines the javascript to execute CogAdmin help when web page help hyperlink pressed.
- Operation:
- Generate the function help() javascript.
- -->
- <xsl:template match="uic:help">
-
- <xsl:variable name="mappedProductLocale">
- <xts:function name="mapProductLocale" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:param name="locale"><xsl:value-of select="$productLocale"/></xts:param>
- </xts:function>
- </xsl:variable>
- <script language="javascript">
- function help(sContext)
- {
- if (!sContext)
- sContext = "";
-
- var sLocale = "<xsl:value-of select="$mappedProductLocale"/>";
- var sBook = "ug_cra";
-
- if (sContext == "")
- sBook += "_a";
-
- gotoHelp(sLocale, sBook, sContext);
- }
-
- </script>
- </xsl:template>
-
- </xsl:stylesheet>
|