123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (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:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
- xmlns:out="dummy-uri" >
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:template match="xsl:stylesheet">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <out:variable name="dc-confirm-cancel">if (window.confirmCancel) { var cancon = confirmCancel(); if( cancon == true && window.resetPageState) {resetPageState();}return cancon; } else { if (window.resetPageState) {resetPageState();} return true; }</out:variable>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- <!--
- ===============================================================================================
- dc:confirm-cancel - adds the javascript function that is called by the cancel button
- when it is clicked.
-
- ===============================================================================================
- -->
- <xsl:template match="dc:confirm-cancel">
- <script language="JavaScript">
- function confirmCancel()
- {
- var confirmationRequired = false;
- var form = document.pform;
- for (var i = 0; i < form.length; i++)
- {
- if (form.elements[i] && form.elements[i].name && form.elements[i].name.indexOf('changed_') == 0 && form.elements[i].value && form.elements[i].value == '1')
- {
- confirmationRequired = true;
- break;
- }
- }
- if (confirmationRequired == true)
- {
- return window.confirm("<xts:string id="IDS_PROP_CANCEL_CONFIRM" encode="javascript"/>");
- }
- else
- {
- return true;
- }
- }
- </script>
- </xsl:template>
- <!--
- ===============================================================================================
- The main engine
- ===============================================================================================
- -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|