123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (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:encodingUtils="com.cognos.portal.utils.EncodingUtils" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="encodingUtils xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:apply-templates select="root/logic/header"/>
- <xsl:apply-templates select="root/logic/impersonateTenantHeader"/>
- </xsl:template>
- <xsl:template match="header">
- <div class="cogstyle-header-back">
- <table id="_THIS_bannerTable" class="cogstyle-header-main" cellpadding="0" cellspacing="0" border="0" role="banner">
- <xsl:if test="string(@background) != ''">
- <xsl:attribute name="style">
- background-image:url(<xsl:value-of select="@background"/>);
- </xsl:attribute>
- </xsl:if>
- <tr>
- <td class="cogstyle-header-logo-section">
- <div class="cogstyle-header-logo"/>
- </td>
- <td class="cogstyle-header-title">
- <xsl:value-of select="@title"/>
- </td>
- <td class="cogstyle-header-middle-section"></td>
- <td class="cogstyle-header-right-section" >
- <div class="cogstyle-header-right-section-container">
- <table cellpadding="0" cellspacing="0" border="0" role="presentation">
- <tr>
- <xsl:apply-templates/>
- <td class="cogstyle-header-section-item-padding"/>
- </tr>
- </table>
- </div>
- </td>
- <td class="cogstyle-header-ibm-logo"></td>
- </tr>
- </table>
- <div class="cogstyle-header-banner-lip"></div>
- <script type="text/javascript">
-
-
- doImpersonateTenant = function(op,id) {
- var _THIS_reload = function() {
- <!--
- Note1: Only to be used in the Go Search UI context at this point.
- Note2: This reload is still a kludge - the Go Search fragment UI fragment manages to gobble up the refresh event (thru stopPropagation?).
- -->
- location.reload();
- }
-
- _THIS_.impersonateTenantFrag = createFragment('_THIS_impersonateTenant', '_THIS_impersonateTenant_div', '/cogadmin/controls/group_actions.xts?group_action=impersonateTenant');
- _THIS_.impersonateTenantFrag.addEventListener('fragment.retrieve.after', _THIS_.id.indexOf('search') == 0 ? _THIS_reload : _THIS_refreshAll);
- id='checkbox_1='+id;
- impersonateTenantImpl(_THIS_.impersonateTenantFrag,id,op);
- }
- </script>
- </div>
- </xsl:template>
-
- <xsl:template match="impersonateTenantHeader">
- <link id="themeStyles" rel="stylesheet" href="_THIS?frag-resource=/ps/portal/js/impersonate.css/THIS_" />
- <link id="themeStyles" rel="stylesheet" href="_THIS?frag-resource=/dojo16/dijit/themes/tundra/tundra.css/THIS_" />
-
- <!-- Needs to appear twice to overcome css issues with IE 9+ and impersonate banner-->
- <link id="themeStyles" rel="stylesheet" href="_THIS?frag-resource=/ps/portal/js/impersonate.css/THIS_" />
- <script type="text/javascript">
- dojo.addOnLoad(function() {
- var context = {
- onChange : doImpersonateTenant,
- <xsl:if test="boolean(/root/logic/session/param[@name='e_readTenantID'])">
- readAs : '<xsl:value-of select="xtsext:javascriptencode(string(readAs))"/>',
- </xsl:if>
-
- writeAs : '<xsl:value-of select="xtsext:javascriptencode(string(writeAs))"/>',
- listSize : '<xsl:value-of select="xtsext:javascriptencode(string(/root/logic/session/param[@name='linesPerPage']))"/>'
-
- }
- _THIS_.impersonateTenant = new impersonateTenantSelector(context);
- });
- </script>
- <div class="impersonate-banner impersonate" id="impersonateBanner">
- <table id="_THIS_impersonateTenantBannerTable" cellpadding="0" cellspacing="0" border="0" role="banner">
- <tr>
- <td class="impersonate-icon">
- <img src="_THIS?frag-resource=/ps/portal/images/mt/impersonate_icon_banner.gif/THIS_" alt=""/>
- </td>
- <td class="cogstyle-header-title">
- <xsl:value-of select="@title"/>
- </td>
- <td class="cogstyle-header-section">
- <label for="impersonatedTenant" style="position: absolute;margin-left: -9999px; margin-top: -9999px;"><xts:string id="IDS_PROP_TENANT_NAME"/></label>
- <input name="impersonatedTenant" id="impersonatedTenant" style="display:none"/>
- </td>
- <td class="cogstyle-header-section" >
- <input id="showTenantContentOnly" onclick="doImpersonateTenant(this.checked ? 'read' : 'write',impersonateTenant.filteringSelect.item.id);" style="display:none">
- <label for="showTenantContentOnly" class="impersonate-show-tenants-content-only-text"><xsl:value-of select="@showTenantContentOnlyLabel"/></label>
- </input>
- </td>
- <td class="cogstyle-header-middle-section"/>
- <td class="cogstyle-header-right-section">
- <img class="dialogClose" width="25px" height="25px" alt="{@closeLabel}" title="{@closeLabel}" src="_THIS?frag-resource=/ps/portal/images/mt/close_icon.gif/THIS_" role="button" onmouseout="this.className = 'dialogClose'" onmouseover="this.className = 'dialogCloseOver'" onclick="doImpersonateTenant('cancel','');"/>
- </td>
- </tr>
- </table>
- </div>
- </xsl:template>
-
- <xsl:template match="section">
- <xsl:if test="descendant::*"> <!-- Skip the section entirely if it is empty -->
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'section'">
- <td class="cogstyle-header-separator">
- <img align="top" border="0" height="16px" width="1px" alt="">
- <xsl:attribute name="src">
- <xsl:text>_THIS?frag-resource=/skins/</xsl:text>
- <xsl:value-of select="/root/logic/session/param[@name='skin']"/>
- <xsl:text>/shared/images/tool_sep_dot_line_banner.gif/THIS_</xsl:text>
- </xsl:attribute>
- </img>
- </td>
- </xsl:if>
- <td class="cogstyle-header-section">
- <table cellpadding="0" cellspacing="0" border="0" role="presentation">
- <tr>
- <xsl:for-each select="./*">
- <xsl:variable name="cell-class">
- <xsl:text>cogstyle-header-section-item</xsl:text>
- <xsl:if test="position()!=1">
- <xsl:text> cogstyle-header-section-item-padding</xsl:text>
- </xsl:if>
- </xsl:variable>
- <td class="{$cell-class}">
- <xsl:apply-templates select="."/>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </td>
- <xsl:apply-templates select="writeAs"/>
- <xsl:apply-templates select="readAs"/>
- </xsl:if>
- </xsl:template>
- <xsl:template match="username">
- <div class="cogstyle-header-user-id" role="region">
- <xsl:attribute name="title"><xsl:value-of select="."/></xsl:attribute>
- <xsl:attribute name="aria-label"><xts:string id="IDS_PROP_BANNER_LOGON_USER"/></xsl:attribute>
- <xsl:value-of select="."/>
- </div>
- </xsl:template>
- <xsl:template match="icon">
- <div tabindex="0" class="cogstyle-header-btn-normal" role="button" onmouseover="this.className='cogstyle-header-btn-over';" onmouseout="this.className='cogstyle-header-btn-normal';" onkeypress="if(event.keyCode==9)return true;{action}" onclick="{action}">
- <img align="top" border="0">
- <xsl:attribute name="src">
- <xsl:text>_THIS?frag-resource=</xsl:text>
- <xsl:value-of select="image"/>
- <xsl:text>/THIS_</xsl:text>
- </xsl:attribute>
- <xsl:if test="string(tooltip) != ''">
- <xsl:attribute name="alt">
- <xsl:value-of select="tooltip"/>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:value-of select="tooltip"/>
- </xsl:attribute>
- </xsl:if>
- </img>
- </div>
- </xsl:template>
- <xsl:template match="search">
- <form name="_THIS_searchForm" action="javascript:{action}">
- <span style="padding-right: 3px;">
- <input style="margin-top: -3px;" class="cogstyle-input-text" name="_THIS_searchText" value="" size="20" type="text"/>
- </span>
- <xsl:apply-templates/>
- </form>
- </xsl:template>
- <xsl:template match="action">
- <!-- Swallow action tags as they are processed by their parents. -->
- </xsl:template>
-
- <xsl:template match="link">
- <a class="cogstyle-header-link cogstyle-header-menu-label" href="javascript:noop();" onClick="{action};return false;" onmouseover="window.status='';return true;">
- <xsl:if test="string(@id) != ''">
- <xsl:attribute name="id">_THIS_<xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <xsl:value-of select="label"/>
- </a>
- </xsl:template>
- <xsl:template match="menu">
- <xsl:variable name="menuName" select="concat('_THIS_',string(@id))"/>
- <xsl:variable name="hasAction" select="string(action) != ''"/>
- <xsl:variable name="defaultAction">
- <xsl:choose>
- <xsl:when test="$hasAction">
- <xsl:value-of select="action"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>ui_menuShow(event,</xsl:text><xsl:value-of select="$menuName"/><xsl:text>);</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <div style="cursor: pointer;">
- <xsl:if test="not($hasAction)">
- <xsl:attribute name="class">cogstyle-header-btn-normal</xsl:attribute>
- <xsl:attribute name="onmouseover">this.className='cogstyle-header-btn-over';</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='cogstyle-header-btn-normal';</xsl:attribute>
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="tabindex">0</xsl:attribute>
- <xsl:attribute name="onkeyup">if((event.keyCode==13)||(event.keyCode==40)){<xsl:value-of select="$defaultAction"/>}</xsl:attribute>
- <xsl:attribute name="onclick"><xsl:value-of select="$defaultAction"/></xsl:attribute>
- <xsl:attribute name="title"><xsl:value-of select="tooltip"/></xsl:attribute>
- </xsl:if>
- <table cellpadding="0" border="0" cellspacing="0" role="presentation">
- <tr>
- <xsl:choose>
- <xsl:when test="icon">
- <td>
- <xsl:if test="$hasAction">
- <xsl:attribute name="class">cogstyle-header-btn-normal</xsl:attribute>
- <xsl:attribute name="onmouseover">this.className='cogstyle-header-btn-over';</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='cogstyle-header-btn-normal';</xsl:attribute>
- <xsl:attribute name="tabindex">0</xsl:attribute>
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="onkeyup">if((event.keyCode==13)||(event.keyCode==40)){<xsl:value-of select="$defaultAction"/>}</xsl:attribute>
- <xsl:attribute name="onclick"><xsl:value-of select="$defaultAction"/></xsl:attribute>
- <xsl:attribute name="title"><xsl:value-of select="icon/tooltip"/></xsl:attribute>
- </xsl:if>
- <img align="top" border="0" alt="" title="">
- <xsl:attribute name="src">
- <xsl:text>_THIS?frag-resource=</xsl:text>
- <xsl:value-of select="icon/image"/>
- <xsl:text>/THIS_</xsl:text>
- </xsl:attribute>
- </img>
- </td>
- <xsl:if test="not($hasAction)">
- <td class="cogstyle-header-menu-spacer"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <td nowrap="">
- <div class="cogstyle-header-menu-label-link">
- <xsl:if test="$hasAction">
- <xsl:attribute name="onclick"><xsl:value-of select="$defaultAction"/></xsl:attribute>
- <xsl:attribute name="role">link</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="title"><xsl:value-of select="label"/></xsl:attribute>
- <xsl:value-of select="label"/>
- </div>
- </td>
- <td class="cogstyle-header-menu-spacer"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="not($hasAction)">
- <td class="cogstyle-header-menu-spacer"/>
- </xsl:if>
- <td>
- <xsl:if test="string(@id) != ''">
- <xsl:attribute name="id"><xsl:value-of select="$menuName"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$hasAction">
- <xsl:attribute name="class">cogstyle-header-btn-normal</xsl:attribute>
- <xsl:attribute name="onmouseover">this.className='cogstyle-header-btn-over';</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='cogstyle-header-btn-normal';</xsl:attribute>
- <xsl:attribute name="tabindex">0</xsl:attribute>
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="onkeyup">if((event.keyCode==13)||(event.keyCode==40)){ui_menuShow(event,<xsl:value-of select="$menuName"/>);}</xsl:attribute>
- <xsl:attribute name="onclick">ui_menuShow(event,<xsl:value-of select="$menuName"/>);</xsl:attribute>
- <xsl:attribute name="title"><xsl:value-of select="tooltip"/></xsl:attribute>
- </xsl:if>
- <img align="top" border="0" height="16" width="7" alt="" title="">
- <xsl:attribute name="src">
- <xsl:text>_THIS?frag-resource=/skins/</xsl:text>
- <xsl:value-of select="/root/logic/session/param[@name='skin']"/>
- <xsl:text>/shared/images/dropdown_arrow_banner.gif/THIS_</xsl:text>
- </xsl:attribute>
- </img>
- </td>
- </tr>
- </table>
- </div>
- <script type="text/javascript">
- var <xsl:value-of select="$menuName"/> = new ui_menu({id: "<xsl:value-of select="$menuName"/>", items:[
- <xsl:for-each select="item">
- <xsl:if test="position() > 1">,</xsl:if>
- <xsl:text>{title: "</xsl:text><xsl:value-of select="xtsext:javascriptencode(label)"/><xsl:text>"</xsl:text>
- <xsl:if test="position() > 1 and local-name(preceding-sibling::*[1]) = 'separator'">
- <xsl:text>, separatorBefore: true</xsl:text>
- </xsl:if>
- <xsl:if test="string(image) != ''">
- <xsl:text>, image: "</xsl:text><xsl:value-of select="xtsext:javascriptencode(image)"/><xsl:text>"</xsl:text>
- </xsl:if>
- <xsl:text>, action: function(evt) { </xsl:text>
- <xsl:value-of select="action"/>
- <xsl:text> } }</xsl:text>
- </xsl:for-each>
- ]
- });
- </script>
- </xsl:template>
- <xsl:template match="script">
- <script type="text/javascript">
- <xsl:value-of select="."/>
- </script>
- </xsl:template>
-
- <xsl:template match="form">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="*"/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|