123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- 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:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:encodingUtils="com.cognos.portal.utils.EncodingUtils"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="customs" select="/root/customs/param"/>
- <xsl:variable name="customMsgs" select="/root/input[@name='customMsgs']/customMsgs"/>
- <xsl:variable name="meta" select="/root/fragment/meta"/>
- <xsl:variable name="pages" select="/root/input[@name='pages']/pages"/>
- <xsl:variable name="header">
- <xsl:call-template name="get-custom">
- <xsl:with-param name="name">header</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="footer">
- <xsl:call-template name="get-custom">
- <xsl:with-param name="name">footer</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="fixed">
- <xsl:call-template name="get-custom">
- <xsl:with-param name="name">fixed</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="showicons">
- <xsl:call-template name="get-custom">
- <xsl:with-param name="name">showicons</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="folder">
- <xsl:call-template name="get-custom">
- <xsl:with-param name="name">folder</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="include-page-menu">
- <xsl:call-template name="get-custom">
- <xsl:with-param name="name">include-page-menu</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="refresh" select="string(/root/interactions/param[@name='refresh'])"/>
- <xsl:variable name="updateState" select="string(/root/interactions/param[@name='updateState'])"/>
-
- <xsl:variable name="level1-selected-page" select="($pages/page[@selected='true'] | $pages/page[position() = 1 and not($pages/page[@selected='true'])])"/>
- <xsl:variable name="selected-page" select="($level1-selected-page/page[@selected='true'] | $level1-selected-page/page[position() = 1 and not($level1-selected-page/page[@selected='true'])] | $level1-selected-page[not(page)] )"/>
- <xsl:variable name="first-page" select="$selected-page[not($refresh = 'true' or $updateState = 'true')]"/>
- <xsl:variable name="has-icons" select="$pages//*[@icon != '']"/>
- <xsl:variable name="selected-tabs" select="/root/state/param[@name='selectedTabs']"/>
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="$refresh!='true' and $updateState!='true'">
- <div id="_THIS_tabIncompatibilityWarning" class="cogstyle-portlet-error-frame" style="display:none;">
- <table cellpadding="3">
- <tr>
- <td>
- <img src="_THIS?frag-resource=/ps/portal/images/msg_warning.gif/THIS_">
- <xsl:attribute name="alt"><xts:string id="IDS_BV_INCOMPATIBLE_ENVIRONMENT"/></xsl:attribute>
- </img>
- </td>
- <td><xts:string id="IDS_BV_INCOMPATIBLE_ENVIRONMENT"/></td>
- </tr>
- </table>
- </div>
- <div id="_THIS_bvContainer">
- <xsl:if test="$header != ''">
- <div id="_THIS_headercontent">_THIS?frag-subfragment=header&frag-id=header/THIS_</div>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$pages/@unavailable = 'true'">
- <xsl:call-template name="render-error">
- <xsl:with-param name="message"><xts:string id="IDS_BV_PAGE_UNAVAILABLE"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$pages/@no-source = 'true'">
- <xsl:call-template name="render-error">
- <xsl:with-param name="message"><xts:string id="IDS_VEW_CUSTOMIZE"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <div id="_THIS_tabs_control_div">
- <xsl:apply-templates select="$pages" mode="html"/>
- <script type="text/javascript">
- <xsl:text> var _THIS_tabs = </xsl:text>
- <xsl:apply-templates select="$pages" mode="script"/>
- <xsl:text>;</xsl:text>
- </script>
- </div>
- <xsl:if test="$first-page">
- <xsl:variable name="tab-id" select="concat($first-page/../@id, $first-page/@id)"/>
- <div id="_THIS_{$tab-id}page">
- <div id="_THIS_{$tab-id}content">
- <xsl:attribute name="class">
- <xsl:choose>
- <xsl:when test="$fixed = 'true'">cogstyle-htabs-page-content-fixed</xsl:when>
- <xsl:otherwise>cogstyle-htabs-page-content</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:text>_THIS?frag-subfragment=firstpage&frag-id=</xsl:text>
- <xsl:value-of select="$tab-id"/>
- <xsl:text>/THIS_</xsl:text>
- </div>
- </div>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$footer != ''">
- <div id="_THIS_footercontent">_THIS?frag-subfragment=footer&frag-id=footer/THIS_</div>
- </xsl:if>
- </div>
- <script type="text/javascript">
- <xsl:text>
- function _THIS_get_selected_tab() {
- var tab = _THIS_tabs.tabs[_THIS_tabs.activeTabID];
- while (tab && tab.subtabs) {
- tab = tab.subtabs.tabs[tab.subtabs.activeTabID];
- }
- return tab;
- }
- function _THIS_refresh(evt) {
- if (evt.eventPhase == evt.AT_TARGET) {
- if (typeof _THIS_tabs != 'undefined') {
- var selectedTabs = _THIS_tabs.activeTabID;
- for (var tabID in _THIS_tabs.tabs) {
- var subTab = _THIS_tabs.tabs[tabID].subtabs;
- if (subTab) {
- selectedTabs += "," + subTab.activeTabID;
- }
- }
- if (_F_getFragmentByID("_THIS_header")) {
- _F_getFragmentByID("_THIS_header").raiseEvent("fragment.refresh",null,null,false,true);
- }
- if (_F_getFragmentByID("_THIS_footer")) {
- _F_getFragmentByID("_THIS_footer").raiseEvent("fragment.refresh",null,null,false,true);
- }
- //Hide the current tab, as it may not exist after the refresh
- var currentTab = _THIS_get_selected_tab();
- if (currentTab) {
- currentTab.deselect();
- }
- evt.preventDefault();
- _THIS_.retrieve("refresh=true&selectedTabs="+selectedTabs,"_THIS_tabs_control_div", false, true);
- }
- }
- }
- function _THIS_onload(evt) {
- if (evt.eventPhase == evt.CAPTURING_PHASE) {
- if (_THIS_.onresize)
- _THIS_.onresize();
- } else if (evt.eventPhase == evt.AT_TARGET) {
- </xsl:text>
- <xsl:if test="$first-page">
- <xsl:text>
- var firstChild = _F_getFragmentByID('</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(concat('_THIS_',$first-page/../@id,$first-page/@id)))"/><xsl:text>');
- if (firstChild != null)
- {
- firstChild.raiseEvent("fragment.load", null, "", false, false);
- }
- if (_F_getFragmentByID("_THIS_header")) {
- _F_getFragmentByID("_THIS_header").raiseEvent("fragment.load", null, "", false, false);
- }
- if (_F_getFragmentByID("_THIS_footer")) {
- _F_getFragmentByID("_THIS_footer").raiseEvent("fragment.load", null, "", false, false);
- }
- </xsl:text>
- </xsl:if>
- if (_THIS_.parent.parent == null)
- {
- <xsl:choose>
- <xsl:when test="$fixed = 'true'">
- <xsl:text>
- if (document.all) {
- document.body.scroll = "no";
- EventUtils.addEventListener(window,"beforeprint",function(event){document.body.style.overflow = "auto";document.body.scroll = "auto";var currentTab=_THIS_get_selected_tab();if(currentTab){var div=document.getElementById(currentTab.uniqueID()+"content");if(div){div.style.overflow="";}}});
- EventUtils.addEventListener(window,"afterprint",function(event){document.body.style.overflow = "";document.body.scroll = "no";var currentTab=_THIS_get_selected_tab();if(currentTab){var div=document.getElementById(currentTab.uniqueID()+"content");if(div){div.style.overflow="auto";}}scroll(0,0);});
- } else {
- document.body.style.overflow = "hidden";
- }
- scroll(0,0);
- </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>
- if (document.all) {
- document.body.scroll = "";
- } else {
- document.body.style.overflow = "auto";
- }
- </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>
- }
- _THIS_.onresize = function() {
- if (typeof _THIS_tabs != 'undefined') {
- _THIS_tabs.onresize();
- }
- return true;
- }
- _THIS_.onresize();
- }
- }
- function _THIS_modeChange(evt)
- {
- if ((evt.eventPhase == evt.AT_TARGET)&&(evt.payload["newMode"] == "edit")) {
- _THIS_.removeEventListener("fragment.retrieve.before", "_THIS_monitor", true);
- _THIS_.removeEventListener("fragment.retrieve.after", "_THIS_monitor", true);
- </xsl:text>
- <xsl:if test="string(/root/controllerParams/param[@name='frag-portalAgent'])!='cognos'">
- <xsl:text>
- _THIS_.removeEventListener("fragment.reload", "_THIS_monitor", true);
- </xsl:text>
- </xsl:if>
- <xsl:text>
- //Clean up child fragments before opening the edit page
- var childFragments = _THIS_.getChildren();
- if (childFragments) {
- for (var i=0; i < childFragments.length; i++) {
- childFragments[i].destroy();
- }
- }
- }
- }
- function _THIS_windowStateHandler(evt)
- {
- if (evt.eventPhase == evt.AT_TARGET) {
- evt.preventDefault();
- }
- }
- function _THIS_visibilityHandler(evt)
- {
- if (evt.eventPhase == evt.AT_TARGET) {
- var currentTab = _THIS_get_selected_tab();
- if (_F_getFragmentByID(currentTab.uniqueID()))
- _F_getFragmentByID(currentTab.uniqueID()).raiseEvent("fragment.visibility.change",
- {
- "setVisibility":evt.payload.newVisibility
- }
- , "params", false, false);
- }
- }
- if (typeof _THIS_tabs != 'undefined') {
- _THIS_tabs.attach(null);
- }
- _THIS_.addEventListener("fragment.visibility.change", "_THIS_visibilityHandler", false);
- _THIS_.addEventListener("fragment.windowstate.change", "_THIS_windowStateHandler", false);
- _THIS_.addEventListener("fragment.refresh", "_THIS_refresh", false);
- _THIS_.addEventListener("fragment.load", "_THIS_onload", true);
- _THIS_.addEventListener("fragment.mode.change", "_THIS_modeChange", false);
- </xsl:text>
- var _THIS_currentSelection = '<xsl:value-of select="encodingUtils:javascriptencode(string($selected-tabs))"/>';
- <xsl:choose>
- <xsl:when test="/root/controllerParams/param[@name='frag-portalAgent']='cognos'">
- <xsl:text>
- function _THIS_saveState(){
- if (typeof _THIS_tabs != 'undefined') {
- var selectedTabs = _THIS_tabs.activeTabID;
- for (var tabID in _THIS_tabs.tabs) {
- var subTab = _THIS_tabs.tabs[tabID].subtabs;
- if (subTab) {
- selectedTabs += "," + subTab.activeTabID;
- }
- }
- if (_THIS_currentSelection != selectedTabs){
- _THIS_currentSelection = selectedTabs;
- var fragRequest = new _F_Ajax.Request(_THIS_.interactionURI("refresh=true&selectedTabs="+selectedTabs),
- {
- requestHeaders:
- {
- "Connection": "keep-alive",
- "Accept": "text/xml,application/xml"
- },
- asynchronous : false
- });
- }
- }
- }
- _F_Document.addEventListener(window, "beforeunload", _THIS_saveState);
- </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>
- function _THIS_saveStateEvt(evt)
- {
- if (evt.eventPhase == evt.AT_TARGET) {
- if (typeof _THIS_tabs != 'undefined') {
- var selectedTabs = _THIS_tabs.activeTabID;
- for (var tabID in _THIS_tabs.tabs) {
- var subTab = _THIS_tabs.tabs[tabID].subtabs;
- if (subTab) {
- selectedTabs += "," + subTab.activeTabID;
- }
- }
- if (_THIS_currentSelection != selectedTabs){
- _THIS_currentSelection = selectedTabs;
- _THIS_.retrieve("updateState=true&selectedTabs="+selectedTabs,"_THIS_tabs_control_div",true,true);
- }
- }
- }
- }
- _THIS_.addEventListener("fragment.reload", "_THIS_saveStateEvt", false);
- </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>
- //- Activity Indicators
- var _THIS_indicators = null;
- function _THIS_monitor(evt)
- {
- if (evt.eventPhase == evt.AT_TARGET) //only want to execute this on downstream events
- return;
- if (_THIS_indicators == null)
- _THIS_indicators = new ui_throbbers("_THIS_", "_THIS?frag-resource=/ps/portal/images/icon_loading.gif/THIS_");
- _THIS_indicators.handler(evt);
- }
- _THIS_.addEventListener("fragment.retrieve.before", "_THIS_monitor", true);
- _THIS_.addEventListener("fragment.retrieve.after", "_THIS_monitor", true);
- </xsl:text>
- </script>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$pages" mode="html"/>
- <script type="text/javascript">
- <xsl:text> var _THIS_tabs = </xsl:text>
- <xsl:apply-templates select="$pages" mode="script"/>
- <xsl:text>;
- _THIS_tabs.attach(null);
- </xsl:text>
- <xsl:if test="$refresh='true'">
- <xsl:text>
- var _THIS_visibleTab = _THIS_get_selected_tab();
- if (_THIS_visibleTab) {
- _THIS_visibleTab.select();
- }
- </xsl:text>
- </xsl:if>
- </script>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="pages | page" mode="html">
- <xsl:variable name="tabs-id" select="@id"/>
- <xsl:variable name="alt">
- <xsl:if test="local-name()='page'">-alt</xsl:if>
- </xsl:variable>
- <table id="_THIS_{$tabs-id}tabs" class="cogstyle-htabs{$alt}-bar" style="table-layout:fixed;padding-bottom:2px;" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <xsl:if test="count(ancestor::page) = 0 and count(ancestor::pages) = 0 and string($include-page-menu)='true'">
- <td width="24" height="20" align="center" valign="middle">
- <script language="javascript">
- function ccModalCallBack(){}
- function _THIS_page_action(cmd) {
- var currentTab = _THIS_get_selected_tab();
- var pageId = (currentTab != null) ? currentTab.target.id : null;
- var objectClass = (currentTab != null) ? currentTab.target.type : null;
- var sBackURL = encodeURIComponent(_F_Config.gateway + "?b_action=xts.run&m=/portal/modal.xts&m_reload=");
- switch (cmd) {
- case "create":
- ccModalCallBack = function() {
- ui_modal_dialog.close();
- var currentTab = _THIS_get_selected_tab();
- if (currentTab) {
- currentTab.deselect();
- }
- _THIS_.raiseEvent("fragment.refresh",null,null,false,true);
- }
- var url = _F_Config.gateway + "?b_action=xts.run" +
- "&m=portal/new_general.xts" +
- "&m_new_class=pagelet" +
- "&showViewPage=false" +
- "&backURL=" + sBackURL;
- <xsl:variable name="cmFolder">
- <xsl:choose>
- <xsl:when test="starts-with($folder, 'path:')">
- <xsl:value-of select="substring-after($folder,'path:')"/>
- </xsl:when>
- <xsl:when test="starts-with($folder, 'storeID(')">
- <xsl:value-of select="$folder"/>
- </xsl:when>
- <xsl:when test="string($folder) != ''">
- <xsl:text>storeID('</xsl:text>
- <xsl:value-of select="$folder"/>
- <xsl:text>')</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- var path = "<xsl:value-of select="xtsext:urlencode(string($cmFolder))"/>";
- url += "&m_path=" + path;
- ui_modal_dialog.open(url,null,null,null,true,_THIS_.div);
- break;
- case "edit":
- ccModalCallBack = function() {
- ui_modal_dialog.close();
- var currentTab = _THIS_get_selected_tab();
- if (currentTab) {
- //Delete and re-create current edited page
- currentTab.loaded=false;
- currentTab.refreshRequired=false;
- _F_getFragmentByID(currentTab.uniqueID()).destroy();
- var tabContainer = $(currentTab.parent.frag.id + "bvContainer");
- var pageDiv = $(currentTab.pageID);
- tabContainer.removeChild(pageDiv);
- currentTab.select();
- }
- }
- var url = _F_Config.gateway + "?b_action=xts.run" +
- "&m=portal/properties_pagelet_layout.xts" +
- "&m_class=pagelet" +
- "&m_obj=" + "storeID('" + pageId + "')" +
- "&backURL=" + sBackURL;
- ui_modal_dialog.open(url,null,null,null,true,_THIS_.div);
- break;
- }
- }
- function _THIS_page_menu_item_getItemState(menudef, item) {
- var currentTab = _THIS_get_selected_tab();
- if (menudef.items[item].actionname == 'create') {
- return "show";
- } else if (currentTab) {
- var objectClass = currentTab.target.type;
- var permissions = currentTab.target.permissions;
- var isPagelet = (objectClass == 'pagelet');
- var canEditPage = (permissions.indexOf("write") != -1 && permissions.indexOf("read") != -1 && permissions.indexOf("traverse") != -1);
- if ((!isPagelet || (isPagelet && !canEditPage)) && menudef.items[item].actionname == 'edit') {
- return "hide";
- }
- return "show";
- } else
- return "hide";
- }
- _THIS_menu_page_manager=new ui_menu({id: "tools", items: [
- {actionname: 'create', title: '<xts:string id="IDS_BV_PAGE_MENU_CREATE_PAGE" encode="javascript"/>', action: function(evt) { _THIS_page_action('create'); }, getItemState: function(menudef, i) {return _THIS_page_menu_item_getItemState(menudef, i); } }
- ,{actionname: 'edit', title: '<xts:string id="IDS_BV_PAGE_MENU_EDIT_PAGE" encode="javascript"/>', action: function(evt) { _THIS_page_action('edit'); }, getItemState: function(menudef, i) {return _THIS_page_menu_item_getItemState(menudef, i); } }
- ]
- });
- </script>
- <div class="_THIS_pageMenu">
- <div onclick="if(_THIS_menu_page_manager) ui_menuUpdate(_THIS_menu_page_manager); ui_menuShow(event,_THIS_menu_page_manager);">
- <img class="frag-btn-normal"
- onmouseover="toolbarButtonMouseOver(this)"
- onmouseout="toolbarButtonMouseOut(this)" src="_THIS?frag-resource=/fragments/common/images/menu.gif/THIS_" style="align:center"/>
- </div>
- </div>
- </td>
- </xsl:if>
- <td id="_THIS_{$tabs-id}tabscell" nowrap="nowrap" valign="bottom" role="application" wairole="application">
- <div class="cogstyle-htabs-last" role="tablist" wairole="tablist">
- <table id="_THIS_{$tabs-id}table" class="cogstyle-htabs{$alt}-table" cellpadding="0" cellspacing="0" role="presentation" wairole="presentation">
- <tr role="presentation" wairole="presentation">
- <xsl:for-each select="page">
- <xsl:variable name="tab-id" select="@id"/>
- <xsl:variable name="active">
- <xsl:if test="(position() = 1 and not(../page[@selected='true'])) or @selected='true'">-active</xsl:if>
- </xsl:variable>
- <xsl:variable name="ariaSelected" select="$active = '-active'"/>
-
- <td id="_THIS_{$tabs-id}{$tab-id}tab" valign="bottom" nowrap="nowrap" role="tab" wairole="tab" aria-selected="{$ariaSelected}">
- <div class="cogstyle-htabs{$alt}{$active}-left-edge" role="presnetation" wairole="presentation">
- <div class="cogstyle-htabs{$alt}{$active}-right-edge" role="presentation" wairole="presentation">
- <div class="cogstyle-htabs{ $alt }{ $active }" role="presentation" wairole="presentation">
- <xsl:variable name="spacer">_THIS?frag-resource=/ps/images/space.gif/THIS_</xsl:variable>
- <xsl:variable name="icon">
- <xsl:choose>
- <xsl:when test="$showicons = 'true' and starts-with(@icon, 'http://')">
- <xsl:value-of select="@icon"/>
- </xsl:when>
- <xsl:when test="$showicons = 'true' and @icon != ''">
- <xsl:text>_THIS?frag-resource=</xsl:text>
- <xsl:value-of select="@icon"/>
- <xsl:text>/THIS_</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$spacer"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <img id="_THIS_{ $tabs-id }{ $tab-id }_throbber" src="{ $icon }" border="0" role="presentation" wairole="presentation">
- <xsl:if test="parent::page">
- <xsl:attribute name="parent"><xsl:value-of select="concat('_THIS_', ancestor::*[2]/@id, ancestor::*[1]/@id, '_throbber')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="contains($icon,'/space.gif/')" >
- <xsl:attribute name="alt"></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="class">
- <xsl:text>cogstyle-vtabs-icon</xsl:text>
- <xsl:if test="@hidden = 'true'"> cogstyle-img-faded</xsl:if>
- </xsl:attribute>
- </img>
- <xsl:variable name="tabName">
-
- <xsl:choose>
- <xsl:when test="@title='Archive'">
- <xts:string id="IDS_FRAG_TAB_TITLE_ARCHIVE"/>
- </xsl:when>
- <xsl:when test="@title='Inbox'">
- <xts:string id="IDS_FRAG_TAB_TITLE_INBOX"/>
- </xsl:when>
- <xsl:when test="@title='Details'">
- <xts:string id="IDS_FRAG_TAB_TITLE_DETAILS"/>
- </xsl:when>
- <xsl:when test="@title='Comments'">
- <xts:string id="IDS_FRAG_TAB_TITLE_COMMENTS"/>
- </xsl:when>
- <xsl:when test="@title='Notification Options'">
- <xts:string id="IDS_FRAG_TAB_TITLE_NOTE_OPTIONS"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@title"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <a href="javascript:noop()" onclick="return false" role="tab" wairole="tab" aria-selected="{$ariaSelected}">
- <xsl:if test="position() != 1">
- <xsl:attribute name="tabindex">-1</xsl:attribute>
- </xsl:if>
- <xsl:value-of select="$tabName"/>
- </a>
- <img style="height:16px; width:16px; vertical-align:text-bottom;" alt="" src="{ $spacer }" border="0" role="presentation" wairole="presentation"/>
- </div>
- </div>
- </div>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </div>
- </td>
- <td class="cogstyle-htabs-scroll-button-container" nowrap="nowrap" align="right" valign="bottom">
- <table cellpadding="0" cellspacing="1">
- <tr>
- <td valign="bottom" id="_THIS_{$tabs-id}leftbutton" class="cogstyle-htabs-scroll-button-disabled cogstyle-htabs-scroll-button-left-disabled">
- <div class="cogstyle-htabs-scroll-button-imageplaceholder">
- <img id="_THIS_{$tabs-id}leftbuttonimg" class="cogstyle-img-faded">
- <xsl:attribute name="src">
- <xsl:text>_THIS?frag-resource=/skins/</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(string(/root/preferences/param[@name='skin']))"/>
- <xsl:text>/shared/images/action_scroll_left.gif/THIS_</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="alt"><xsl:value-of select="$customMsgs/param[@name='IDS_PROP_MULTIPAGE_SCROLL_LEFT']"/></xsl:attribute>
- </img>
- </div>
- </td>
- <td valign="bottom" id="_THIS_{$tabs-id}rightbutton" class="cogstyle-htabs-scroll-button-disabled cogstyle-htabs-scroll-button-right-disabled">
- <div class="cogstyle-htabs-scroll-button-imageplaceholder">
- <img id="_THIS_{$tabs-id}rightbuttonimg" class="cogstyle-img-faded">
- <xsl:attribute name="src">
- <xsl:text>_THIS?frag-resource=/skins/</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(string(/root/preferences/param[@name='skin']))"/>
- <xsl:text>/shared/images/action_scroll_right.gif/THIS_</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="alt"><xsl:value-of select="$customMsgs/param[@name='IDS_PROP_MULTIPAGE_SCROLL_RIGHT']"/></xsl:attribute>
- </img>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <xsl:for-each select="page">
- <xsl:variable name="tab-id" select="concat($tabs-id, @id)"/>
- <xsl:if test="page">
- <div id="_THIS_{$tab-id}page">
- <xsl:if test="not((position() = 1 and not(../page[@selected='true'])) or @selected='true')">
- <xsl:attribute name="style">display:none</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="self::page" mode="html"/>
- </div>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="pages|page" mode="script">
- <xsl:text>new ui_htabs({frag: _THIS_, id: "</xsl:text>
- <xsl:value-of select="@id"/>
- <xsl:text>", activeTabID: "</xsl:text>
- <xsl:choose>
- <xsl:when test="page[@selected='true']">
- <xsl:value-of select="page[@selected='true']/@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="page[1]/@id"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>", fixed: </xsl:text>
- <xsl:value-of select="$fixed"/>
- <xsl:text>, tabs: { </xsl:text>
- <xsl:for-each select="page">
- <xsl:variable name="tab-id" select="@id"/>
- <xsl:value-of select="substring('										',1,count(ancestor-or-self::page))"/>
- <xsl:text>"</xsl:text>
- <xsl:value-of select="$tab-id"/>
- <xsl:text>": new ui_htab({id: "</xsl:text>
- <xsl:value-of select="$tab-id"/>
- <xsl:text>", </xsl:text>
- <xsl:choose>
- <xsl:when test="page">
- <xsl:text>subtabs: </xsl:text>
- <xsl:apply-templates select="self::page" mode="script"/>
- </xsl:when>
- <xsl:when test="@href">
- <xsl:text>href: "</xsl:text>
- <xsl:value-of select="@href"/>
- <xsl:text>"</xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="@id = $first-page/@id and string($selected-tabs)=''">
- <xsl:text>, loaded: true</xsl:text>
- </xsl:if>
- <xsl:text>, target: { id: "</xsl:text>
- <xsl:value-of select="@id"/>
- <xsl:text>", type: "</xsl:text>
- <xsl:value-of select="@type"/>
- <xsl:text>", permissions: "</xsl:text>
- <xsl:value-of select="@permissions"/>
- <xsl:text>"}</xsl:text>
- <xsl:if test="@type = 'report'">
- <xsl:text>, height: </xsl:text><xsl:value-of select="/root/customs/param[@name='reportSavedOutputHeight']"/>
- </xsl:if>
- <xsl:text>})</xsl:text>
- <xsl:if test="position() < last()">, </xsl:if>
- </xsl:for-each>
- <xsl:text>} })</xsl:text>
- </xsl:template>
- <xsl:template name="get-custom">
- <xsl:param name="name"/>
- <xsl:choose>
- <xsl:when test="$customs[@name=$name]">
- <xsl:value-of select="$customs[@name=$name]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$meta/customProperties[@name=$name]/default/value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="render-error">
- <xsl:param name="message" select="''"/>
- <table id="_THIS_default" border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="portlet-font" align="center" valign="middle" height="100">
- <xsl:value-of select="xtsext:javascriptencode(string($message))"/>
- </td>
- </tr>
- </table>
- </xsl:template>
- </xsl:stylesheet>
|