123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?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).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:out="dummy-uri"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:pui="http://developer.cognos.com/common/portal/logic/ui/1/"
- xmlns:layout="http://developer.cognos.com/common/layout"
- exclude-result-prefixes="xts pui layout">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:template match="pui:helplink">
- <layout:link href="#" onclick="_THIS_doHelp(false);return false;"><xts:string id="IDS_PROP_HELP_LINK"/></layout:link>
- </xsl:template>
-
- <xsl:template match="pui:aboutlink">
- <layout:link href="#" onclick="_THIS_doAbout();return false;"><xts:string id="IDS_PROP_ABOUT_LINK"/></layout:link>
- </xsl:template>
-
- <xsl:template match="pui:helpscript">
- <out:variable name="pui-locale" select="/root/preferences/param[@name='productLocale']"/>
-
- <out:variable name="pui-book" select="/root/input[@name='help']/help/book"/>
- <out:variable name="pui-helpIdRoot" select=" /root/input[@name='help']/help/helpIdRoot"/>
- <out:variable name="context">
- <out:value-of select="translate( $pui-helpIdRoot, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' )"/>
- </out:variable>
-
- <script type="text/javascript">
- function _THIS_doHelp(redirect)
- {
- var help_bookFile="<out:value-of select="$pui-book"/>";
- if (help_bookFile == "") {
- help_bookFile = _F_Config.help.book;
- }
- help_bookFile += ".html";
- var ui_help = null;
- if (_F_Config.help.path != "") {
- ui_help = _F_Config.webContent + "/" + _F_Config.help.path;
-
- if (_F_Config.help.path.charAt(_F_Config.help.path.length -1) != '/') {
- ui_help += "/";
- }
- }
- if ( ui_help != "") {
- var sLocale = "<out:value-of select="$pui-locale"/>";
- <!-- Use the first two letters of the locale string to construct the path to the localized help folder. -->
- <!-- Make sure they are converted to lowercase. -->
- var sLang = sLocale.substring(0,2).toLowerCase();
- if ( _F_Config.help.langs.indexOf(" " + sLang + " ") < 0) {
- sLang = "en";
- }
- var helpId = "IDH_";
- if (window.portalAgent === undefined || portalAgent.indexOf("cognos") == 0) {
- helpId += "COGNOS_"
- }
- helpId += "<out:value-of select="$context"/>";
- var colonIndex = _THIS_.mode.indexOf(":");
- var mode = (colonIndex == -1) ? _THIS_.mode.toUpperCase() : _THIS_.mode.substr(colonIndex+1).toUpperCase();
- if (mode != "" ) {
- helpId += "_" + mode;
- }
- else {
- helpId += "_HELP";
- }
- var sHelpTopic = help_bookFile + "?helpid=" + helpId;
- var sURL = ui_help + sLang + "/" + sHelpTopic;
- if (redirect != null && redirect) {
- document.location.href = sURL;
- } else {
- windowHelp = window.open(sURL, "cps_help", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
- if (windowHelp != null) {
- windowHelp.focus();
- }
- }
- }
- else {
- window.alert(PFM.JS.IDS_JS_NO_HELP_URL);
- }
- }
- </script>
- </xsl:template>
-
- <xsl:template match="pui:delegatehelpscript">
- <out:variable name="org-target" select="/root/controllerParams/param[@name='frag-originaltarget']"/>
- <script type="text/javascript">
- function _THIS_doHelp()
- {
- var sURL = _F_Config.expandMacros(_THIS_.baseURI());
- sURL += ((sURL.indexOf('?') >= 0) ? "&" : "?") + "frag-mode=help";
- var windowHelp = window.open(sURL, "cps_help",
- "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
- if (windowHelp != null) {
- windowHelp.focus();
- }
- }
- </script>
- </xsl:template>
-
- <xsl:template match="pui:aboutscript">
- <out:variable name="pui-skin" >
- <xsl:choose>
- <xsl:when test="string(/root/preferences/param[@name='skin']) = ''">corporate</xsl:when>
- <xsl:otherwise><xsl:value-of select="/root/preferences/param[@name='skin']"/></xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <script type="text/javascript">
- function _THIS_doAbout()
- {
- var messageFileURL = "_THIS?frag-urlType=resourceproxy&frag-resource=/ps/portal/js/about/ps/nls/psuiaboutmsg_THELOCALE.js/THIS_";
- // using new Object().href will trigger a required url rewriting in some 3rd party portals
- var localizedMessageFileURL = new Object().href = messageFileURL.replace("THELOCALE", _F_Config.productLocale);
- var defaultMessageFileURL = new Object().href = messageFileURL.replace("THELOCALE", "en");
-
- var helpAB = new about_dialog(_F_Config.webContent + "/ps/portal/images/about/cc_about_" + _F_Config.productLocale +".jpg", _F_Config.webContent + "/ps/portal/images/about/cc_about_en.jpg", localizedMessageFileURL, defaultMessageFileURL);
- helpAB.show();
- }
- </script>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- </xsl:stylesheet>
- <!-- $Header: //cpscrn/main/src/java/etc/webapps/cps/WEB-INF/fragments/producers/common/logic/portal-ui.xslt#1 $ -->
- <!-- $DateTime: 2008/10/22 11:12:04 $ -->
- <!-- $Change: 25109 $ -->
|