123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2008
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" exclude-result-prefixes="xsl pf xtsext cp xts cf">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <div id="toolbarContainer" role="menubar" style="width:100%; height: 100%"/>
- <xsl:text>
- </xsl:text>
- <script language="javascript"><![CDATA[
- //Contains the menus and toolbar buttons that have capablities only.
- var toolbarMenuMap = new Object();
- var toolbarButtonStyle = new CUIStyle('toolbarImageNormal_studio', 'toolbarImageOver_studio', 'toolbarImagePressed_studio', 'toolbarImageOverPressed_studio', 'toolbarImageNormal_studio');
- var toolbarDropdownButtonStyle = new CUIStyle('toolbarDropdownImageNormal_studio', 'toolbarDropdownImageOver_studio', 'toolbarDropdownImagePressed_studio', 'toolbarDropdownImageOverPressed_studio', 'toolbarDropdownImageNormal_studio');
- var toolbarStyle = new CUIStyle('', '', '', '', '');
- var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', '');
- var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
- //var blankSeperator = new CSeperator("vertical_line", "12");
- var blankSeperator = new CSeperator("vertical_line_img", 20);
- var toolbar = new CBar('toolbarContainer');
- toolbar.setStyle(toolbarStyle);
- //<!-- change the images for the toolbar during a mouseover -->
- function mouseoverImage(item) {
- if (item.className == 'toolbarImageNormal_studio')
- item.className = 'toolbarImageOver';
- if (item.className == 'toolbarImagePressed')
- item.className = 'toolbarImageOverPressed';
- }
- //<!-- change the images for the toolbar during a mouseout -->
- function mouseoutImage(item) {
- if (item.className == 'toolbarImageOver')
- item.className = 'toolbarImageNormal_studio';
- if (item.className == 'toolbarImageOverPressed')
- item.className = 'toolbarImagePressed';
- }
- ]]>
- <xsl:apply-templates select="//*[local-name()='button' or local-name()='dropbutton']"/>
- //toolbar.m_observers.attach(toolbar, toolbar.closeMenus, document.body.onmousedown);
-
- toolbar.setMenuType(cHorizonalBar);
- toolbar.setAlign('left');
- toolbar.draw();
- </script>
- <xsl:text>
- </xsl:text>
- <xsl:call-template name="buttonScripts"/>
- </xsl:template>
- <!-- create a group button spacer of 10 pixels-->
- <xsl:template match="button[@type='separator']">
- toolbar.add(blankSeperator);
- </xsl:template>
- <!-- create a menu item-->
- <xsl:template match="menuItem">
- <xsl:param name="parentMenu"/>
- <xsl:variable name="menuName" select="concat('toolbarButtonMenu_',generate-id())"/>
- var <xsl:value-of select="$menuName"/> = new CMenuItem(<xsl:value-of select="$parentMenu"/>, '<xsl:value-of select="xtsext:javascriptencode(string(./name))"/>', '<xsl:value-of select="xtsext:javascriptencode(string(./id))"/>', '<xsl:value-of select="xtsext:javascriptencode(string(./action))"/>', '<xsl:value-of select="./icon"/>', menuItemStyle, '<xsl:value-of select="xtsext:javascriptencode(string(./tooltip))"/>',"", "<xsl:value-of select="xtsext:javascriptencode(string(userCapability))"/>");
- <xsl:if test="./userCapability">
- toolbarMenuMap["<xsl:value-of select="xtsext:javascriptencode(string(normalize-space(id)))"/>"] = <xsl:value-of select="$menuName"/>;
- </xsl:if>
- </xsl:template>
- <!-- create a cascaded menu item -->
- <xsl:template match="cascadedMenuItem">
- <xsl:param name="parentMenu"/>
- <xsl:variable name="menuName" select="concat('toolbarButton_',generate-id())"/>
- var <xsl:value-of select="$menuName"/> = new CMenuItem(<xsl:value-of select="$parentMenu"/>, '<xsl:value-of select="xtsext:javascriptencode(string(./name))"/>', '<xsl:value-of select="xtsext:javascriptencode(string(./id))"/>', '<xsl:value-of select="xtsext:javascriptencode(string(./action))"/>', '<xsl:value-of select="./icon"/>', menuItemStyle, '');
- var <xsl:value-of select="$menuName"/>_cascaded = <xsl:value-of select="$menuName"/>.createCascadedMenu(menuStyle,5);
- <xsl:apply-templates select="menuItem">
- <xsl:with-param name="parentMenu" select="concat($menuName,'_cascaded')"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- create a toolbar button. The dimensions should be 24px by 24px and the class 'toolbarImageNormal_studio' which is defined in CRN.css. For more information
- see the visual style guide here -
- http://sottmyprodapp/liz/index.htm
- -->
- <xsl:template match="button">
- <xsl:variable name="buttonName" select="concat('toolbarButton_',generate-id())"/>
- <!-- parent, action, iconPath, toolTip, style, bHideDropDown, label, dropDownToolTip, capbility-->
- var <xsl:value-of select="$buttonName"/> = new CToolbarButton(toolbar, '<xsl:value-of select="xtsext:javascriptencode(string(./link))"/>', "<xsl:value-of select="./icon[@state='active']"/>", '<xsl:value-of select="xtsext:javascriptencode(string(./tooltip))"/>',toolbarButtonStyle,undefined,undefined,undefined,undefined, "<xsl:value-of select="xtsext:javascriptencode(string(userCapability))"/>");
- <xsl:if test="./userCapability">
- toolbarMenuMap["<xsl:value-of select="$buttonName"/>"] = <xsl:value-of select="$buttonName"/>;
- </xsl:if>
- </xsl:template>
- <!-- render a drop down button-->
- <xsl:template match="dropbutton">
- <xsl:variable select="string(/root/http/param[@name='SCRIPT_NAME'])" name="gateway"/>
- <!--xsl:variable select="key('system-param', 'app')" name="app"/-->
- <!--xsl:variable name="back-url">
- <xsl:value-of select="$gateway"/>?b_action=xts.run&m=<xsl:value-of select="key('env-param','m')"/>
- </xsl:variable-->
- <!--xsl:variable name="encoded-back-url">
- <xsl:value-of select="xtsext:protect(xtsext:urlencode(string($back-url)),'url','url','getdata')"/>
- </xsl:variable-->
- <xsl:variable name="hideDrop" select="./hideDropArrow"/>
-
-
- <xsl:variable name="iconWidth">
- <xsl:choose>
- <xsl:when test="./icon/@width"><xsl:value-of select="./icon/@width"/></xsl:when>
- <xsl:otherwise>16</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="class">
- <xsl:choose>
- <xsl:when test="$hideDrop='true'">toolbarDropdownButtonStyle</xsl:when>
- <xsl:otherwise>toolbarButtonStyle</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="menuName" select="concat('toolbarButton_',generate-id())"/>
- <!--
- //If we have a two action type drop down then the action will be passed.
- //however if the menu is a single action i.e only drop down then the action will be ignored.
- -->
- var <xsl:value-of select="$menuName"/> = new CToolbarButton(toolbar, '<xsl:value-of select="xtsext:javascriptencode(string(./action))"/>', '<xsl:value-of select="./icon"/>', '<xsl:value-of select="xtsext:javascriptencode(string(./tooltip))"/>',<xsl:value-of select="$class"/>,<xsl:value-of select="$hideDrop"/>, null,null, <xsl:value-of select="$iconWidth"/>);
- var <xsl:value-of select="$menuName"/>_menu = <xsl:value-of select="$menuName"/>.createDropDownMenu(menuStyle);
-
- <xsl:apply-templates select="menuItem">
- <xsl:with-param name="parentMenu" select="concat($menuName,'_menu')"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="cascadedMenuItem">
- <xsl:with-param name="parentMenu" select="concat($menuName,'_menu')"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template name="buttonScripts">
- <script language="JavaScript">
- function openTool(s)
- {
- var cf = window.parent.getConfigFrame();
- if (s == "" || s == null) return;
- if(!self.messageIFrame.doAction) return;
- self.messageIFrame.doAction(s);
- }
-
-
- function goToPage(location, type){
- var cf = window.parent.getConfigFrame();
- makeSelection(type);
- cf.loadPage(location);
- }
-
- function reselectTab(tabId, type)
- {
- if(!self.messageIFrame.selectTab) return;
- self.messageIFrame.selectTab(tabId, type);
- }
- </script>
- </xsl:template>
- </xsl:stylesheet>
|