123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <!-- $Header: //cpscrn/main/templates/cps4/portlets/utility/portlet-impl/image/view.xslt#1 $ -->
- <!-- $DateTime: 2008/10/22 11:12:04 $ -->
- <!-- $Change: 25109 $ -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/"
- exclude-result-prefixes="ui xts xtsext portlet">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:attribute-set name="anchor">
- <xsl:attribute name="class">cognos-anchor</xsl:attribute>
- <xsl:attribute name="onmouseover">window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">window.status='';return true;</xsl:attribute>
- </xsl:attribute-set>
- <ui:property name="target-frame" select="'target'"/>
- <xsl:variable name="check-target">
- <xsl:choose>
- <xsl:when test="$open-links = 'current' and not($ui-is-myportal)">
- <xsl:value-of select="'_top'"/>
- </xsl:when>
- <xsl:when test="($open-links = 'target')">
- <xsl:value-of select="$target-frame"/>
- </xsl:when>
- <xsl:when test="$open-links = 'channel'"></xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'_blank'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute-set name="target">
- <xsl:attribute name="target">
- <xsl:value-of select="$check-target"/>
- </xsl:attribute>
- </xsl:attribute-set>
- <ui:property name="img-target-url" select="'img_target_url'"/>
- <ui:property name="img-size" select="'img_size'"/>
- <ui:property name="img-tile" select="'img_tile'"/>
- <ui:property name="open-links" select="'open_links'"/>
- <ui:property name="channel" select="'channel'"/>
- <xsl:template match="/">
- <xsl:if test="$img-target-url != ''">
- <script language="javascript">
- function wsrp_rewrite_select(href,e) {
- <xsl:choose>
- <xsl:when test="$open-links = 'channel'">
- document.wsrp_rewrite_form.url.value = href;
- document.wsrp_rewrite_form.submit();
- if (e.srcElement) {
- e.returnValue = false;
- } else {
- e.preventDefault();
- }
- </xsl:when>
- <xsl:when test="($img-size = 'custom' and $img-tile = 'true')">
- window.open(href,'<xsl:value-of select="$check-target"/>',"");
-
- if (e.srcElement) {
- e.returnValue = false;
- } else {
- e.preventDefault();
- }
- </xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- }
- </script>
- </xsl:if>
- <xsl:if test="$open-links = 'channel'">
- <form name="wsrp_rewrite_form" method="post" action="wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=set:{ $channel }&wsrp-windowState={ $ui-window-state }/wsrp_rewrite">
- <input type="hidden" name="url" value=""/>
- </form>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$img-target-url = '' or ($img-size = 'custom' and $img-tile = 'true')">
- <xsl:call-template name="render-image"/>
- </xsl:when>
- <xsl:otherwise>
- <a xsl:use-attribute-sets="anchor target" href="{ $img-target-url }" onclick="wsrp_rewrite_select('{ xtsext:javascriptencode( string($img-target-url) ) }',event)">
- <xsl:call-template name="render-image"/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
-
- <ui:preview/>
- </xsl:template>
- <xsl:template name="render-image">
- <ui:property name="img-url" select="'img_url'"/>
- <ui:property name="img-width" select="'img_width'"/>
- <ui:property name="img-height" select="'img_height'"/>
- <ui:property name="img-use-title" select="'img_use_title'"/>
- <xsl:variable name="use-title" select="$img-use-title"/>
- <xsl:variable name="prefTitle">
- <xsl:choose>
- <xsl:when test="$img-use-title='true'">
- <xsl:variable name="titles" select="$ui-state-params[starts-with( @name, 'title_' ) and .!='']"/>
- <portlet:preferred-title-localized-value select="$titles"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$img-url"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$img-size = 'original'">
- <img src="{ $img-url }" border="0" alt="{ $prefTitle }" tabindex="0" role="img" wairole="img"/>
- </xsl:when>
- <xsl:when test="$img-size = 'custom'">
- <xsl:choose>
- <xsl:when test="$img-tile = 'true'">
- <xsl:variable name="cursor-style">
- <xsl:if test="$img-target-url != ''">
- <xsl:text>;cursor:hand</xsl:text>
- </xsl:if>
- </xsl:variable>
- <div style="width:{ $img-width }px;height:{ $img-height }px;background-image:url({ $img-url });background-repeat:repeat{ $cursor-style}" tabindex="0" role="img" wairole="img" aria-labelledby="wsrp_rewrite_imageCaption">
- <xsl:if test="$img-target-url != ''">
- <xsl:attribute name="onclick">
- <xsl:text>wsrp_rewrite_select('</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode( string($img-target-url) )"/>
- <xsl:text>',event)</xsl:text>
- </xsl:attribute>
- </xsl:if>
- <xsl:text> </xsl:text>
- <span style="position: absolute;margin-top: -9999px; " id="wsrp_rewrite_imageCaption"><xsl:value-of select="$prefTitle"/></span>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <img src="{ $img-url }" border="0" width="{ $img-width }" height="{ $img-height }" alt="{ $prefTitle }" tabindex="0" role="img" wairole="img"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|