123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2015
- 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:uic="http://developer.cognos.com/schemas/uic/presentation/markup/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl uic xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="uic:table">
- <xsl:variable name="isEmpty" select="not(uic:body/*)"/>
- <xsl:apply-templates select="uic:filterSummary">
- <xsl:with-param name="prefix" select="substring-before(uic:features/uic:name,'_')"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="uic:paginations">
- <xsl:with-param name="pagerName" select="uic:features/uic:name"/>
- <xsl:with-param name="interactionParams" select="uic:interactionParams"/>
- <xsl:with-param name="sortParams" select="concat('sort_column=', uic:features/uic:sortColumn, '&sort_order=', uic:features/uic:sortOrder)"/>
- </xsl:apply-templates>
- <span id="_THIS_metricGroupDescription" style="position:absolute;top:9999;left:9999;display:none"/>
- <div class="cogstyle-table-wrapper" aria-label="{uic:features/uic:aria-label}">
- <xsl:attribute name="style">
- <xsl:if test="@height != ''">height:<xsl:value-of select="@height"/>;</xsl:if>
- <xsl:choose>
- <xsl:when test="@width != ''">width:<xsl:value-of select="@width"/>;</xsl:when>
- <xsl:otherwise>width:100%;</xsl:otherwise>
- </xsl:choose>
- <!--
- for dialogs that show a pager, they're usually offset from the left borber. We want to keep
- all the dialogs the same, so uic:tablePadding value will get multiplied by a fixed number of pixels.
- -->
- <xsl:if test="uic:features/uic:tablePadding">margin:<xsl:value-of select="number(uic:features/uic:tablePadding) * 20"/>px;</xsl:if>
- </xsl:attribute>
- <xsl:if test="@id != ''">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <table id="_THIS_table" border="0" cellpadding="0" cellspacing="0" class="cogstyle-table" aria-label="{uic:features/uic:aria-label}" summary="{uic:features/uic:aria-label}">
- <xsl:if test="@lang!=''">
- <xsl:attribute name="lang"><xsl:value-of select="@lang"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@width">
- <xsl:attribute name="width"><xsl:value-of select="number(@width)-1"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="uic:features/uic:summary != ''">
- <xsl:attribute name="summary"><xsl:value-of select="uic:features/uic:summary"/></xsl:attribute>
- </xsl:if>
- <thead class="cogstyle-table-header">
- <tr class="cogstyle-table-group" key="toggleHeader">
- <xsl:if test="uic:header/uic:row/@lang != ''">
- <xsl:attribute name="lang"><xsl:value-of select="uic:header/uic:row/@lang"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="uic:features/uic:type = 'checkbox'">
- <th scope="col">
- <input type="checkbox" value="" tabIndex="0">
- <xsl:attribute name="onclick">toggleCheckboxes(this, '_THIS_table')</xsl:attribute>
- <xsl:attribute name="onkeyup">if (event.keyCode == 13) {{toggleCheckboxes(this, '_THIS_table')}}</xsl:attribute>
- <xsl:attribute name="aria-label"><xsl:value-of select="xtsext:htmlencode($pagerSelectAll)"/></xsl:attribute>
- </input>
- </th>
- <!-- column divider -->
- <th scope="col" height="15" width="1" role="separator" aria-orientation="vertical">
- <img height="15" width="1" style="background-color:#9C9C9C" src="{$serverWebcontentPath}images/space.gif" alt=""/>
- </th>
- </xsl:if>
- <xsl:if test="uic:features/uic:type = 'group'">
- <th style="vertical-align: middle;" scope="col">
- <!-- TODO: replace absolute image path with relative path -->
- <img id="_THIS_group_image_0" style="cursor:pointer" onclick="toggleAllGroups('_THIS_')" onkeyup="if (event.keyCode == 13) {{toggleAllGroups('_THIS_')}}" alt="" tabIndex="0">
- <xsl:attribute name="src">
- <xsl:choose>
- <xsl:when test="string(uic:features/uic:collapsed)='true'">
- <xsl:value-of select="$expandGif"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$collapseGif"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="aria-label">
- <xsl:choose>
- <xsl:when test="string(uic:features/uic:collapsed)='true'">
- <xsl:value-of select="$expandAllTooltip"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$collapseAllTooltip"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="aria-expanded">
- <xsl:value-of select="not(uic:features/uic:collapsed='true')"/>
- </xsl:attribute>
-
- </img>
- </th>
- <!-- column divider -->
- <th height="15" width="1" role="separator" scope="col" aria-orientation="vertical">
- <img height="15" width="1" style="background-color:#9C9C9C" src="{$serverWebcontentPath}images/space.gif" alt=""/>
- </th>
- </xsl:if>
- <xsl:apply-templates select="uic:header/uic:row/uic:column">
- <xsl:with-param name="type" select="'header'"/>
- <xsl:with-param name="tableFeatures">
- <xsl:copy-of select="uic:features/*"/>
- <xsl:copy-of select="uic:interactionParams"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </tr>
- <!-- 1px white space under table header -->
- <tr role="separator">
- <td style="height:1px;background-color:white;border:0px;padding:0px">
- <xsl:attribute name="colspan"><xsl:value-of select="2*(count(uic:header/uic:row/uic:column) + number(uic:features/uic:type = 'group' or uic:features/uic:type = 'checkbox'))"/></xsl:attribute>
- </td>
- </tr>
- </thead>
- <xsl:if test="uic:footer">
- <tfoot class="cogstyle-table-footer">
- <tr>
- <xsl:if test="uic:footer/@lang != ''">
- <xsl:attribute name="lang"><xsl:value-of select="uic:footer/@lang"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="id">_THIS_footer</xsl:attribute>
- <xsl:choose>
- <xsl:when test="uic:footer != ''">
- <xsl:apply-templates select="uic:footer/uic:row/uic:column">
- <xsl:with-param name="type" select="'footer'"/>
- <xsl:with-param name="tableFeatures">
- <xsl:copy-of select="uic:features/*"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise> <!--Default=Show TimeStamp-->
- <xsl:if test="uic:footer/@displayLastUpdate = 'true'">
- <td>
- <xsl:attribute name="colspan"><xsl:value-of select="2*(count(uic:header/uic:row/uic:column) + number(uic:features/uic:type = 'group' or uic:features/uic:type = 'checkbox'))"/></xsl:attribute>
- <xsl:copy-of select="$lastRefreshed"/>
- </td>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </tr>
- </tfoot>
- </xsl:if>
- <tbody class="cogstyle-table-body">
- <xsl:attribute name="id">_THIS_tbodyElement</xsl:attribute>
- <!-- if there's nothing to display in the table, then put the 'no items' message -->
- <xsl:choose>
- <xsl:when test="$isEmpty">
- <tr>
- <td class="cogstyle-table-text cogstyle-table-empty">
- <xsl:attribute name="colspan"><xsl:value-of select="2*(count(uic:header/uic:row/uic:column) + number(uic:features/uic:type = 'group' or uic:features/uic:type = 'checkbox'))"/></xsl:attribute>
- <xsl:value-of select="$pageItemNotFound"/>
- </td>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="uic:body/*">
- <xsl:with-param name="tableFeatures">
- <xsl:copy-of select="uic:features/*"/>
- </xsl:with-param>
- <xsl:with-param name="withRowDetails" select="boolean(uic:body/uic:rowDetails)"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </tbody>
- </table>
- </div>
- <script language="javascript">
-
- <xsl:choose>
- <xsl:when test="uic:features/uic:scrollable">
- var _THIS_scrollable = true;
- </xsl:when>
- <xsl:otherwise>
- var _THIS_scrollable = false;
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="uic:features/uic:listViewSeparator = 'background'">
- var _THIS_alternate = true;
- </xsl:when>
- <xsl:otherwise>
- var _THIS_alternate = false;
- </xsl:otherwise>
- </xsl:choose>
- </script>
- </xsl:template>
-
- <!--
- Creates a expandable/collapsible groups
- -->
- <xsl:template match="uic:group">
- <xsl:param name="tableFeatures"/>
- <xsl:variable name="group_number">
- <xsl:choose>
- <xsl:when test="@groupNum">
- <xsl:value-of select="@groupNum"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="position()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row_count" select="count(uic:row)"/>
- <xsl:variable name="collapsed" select="@collapsed"/>
- <xsl:variable name="collapsible" select="@collapsible"/>
- <xsl:variable name="groupLabel" select="uic:name/*[local-name()!='script'] | uic:name[not(*)]"/>
- <xsl:variable name="key" select="@key"/>
- <xsl:variable name="ariaOwns">
- <xsl:for-each select="uic:row">
- <xsl:value-of select="concat('_THIS_','group_',$group_number,'_',position(),' ')"/>
- </xsl:for-each>
- </xsl:variable>
- <tr class="cogstyle-table-group" role="rowgroup" aria-label="{$groupLabel}" id="_THIS_{$group_number}" aria-owns="{$ariaOwns}">
- <xsl:if test="$key">
- <xsl:attribute name="key"><xsl:value-of select="xtsext:urlencode($key)"/></xsl:attribute>
- </xsl:if>
- <td style="text-align: center;">
- <!-- TODO: replace absolute image path with relative path -->
- <img tabIndex="0" role="button">
- <xsl:attribute name="id">_THIS_group_image_<xsl:value-of select="$group_number"/></xsl:attribute>
- <xsl:if test="$collapsible">
- <xsl:attribute name="onclick">toggleGroup('_THIS_', '<xsl:value-of select="$group_number"/>')</xsl:attribute>
- <xsl:attribute name="onkeyup">if (event.keyCode == 13) {{toggleGroup('_THIS_', '<xsl:value-of select="$group_number"/>')}}</xsl:attribute>
- <xsl:attribute name="style">cursor:pointer</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="src"><xsl:choose><xsl:when test="$collapsed = 'true'"><xsl:value-of select="$expandGif"/></xsl:when><xsl:otherwise><xsl:value-of select="$collapseGif"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="aria-labelledBy">
- <xsl:choose>
- <xsl:when test="$collapsed='true'">
- <xsl:value-of select="concat('_THIS_',$group_number,'_groupcaption',' _THIS_group_image_',$group_number)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('_THIS_',$group_number,'_groupcaption',' _THIS_group_image_',$group_number)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="aria-expanded">
- <xsl:value-of select="not(uic:features/uic:collapsed='true')"/>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:choose>
- <xsl:when test="$collapsed='true'">
- <xsl:value-of select="$expandTooltip"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$collapseTooltip"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="aria-expanded">
- <xsl:value-of select="not(uic:features/uic:collapsed='true')"/>
- </xsl:attribute>
- <xsl:attribute name="aria-expanded">
- <xsl:value-of select="not($collapsed = 'true')"/>
- </xsl:attribute>
- <xsl:attribute name="onfocus">if (_THIS_.getGroupDescription){document.getElementById('_THIS_metricGroupDescription').innerText=_THIS_.getGroupDescription(<xsl:value-of select="$group_number"/>)}</xsl:attribute>
- </img>
- </td>
- <!-- empty spacer column -->
- <td height="15" width="1" role="separator">
- <img height="15" width="1" src="{$serverWebcontentPath}images/space.gif" alt="" role="separator"/>
- </td>
- <td class="cogstyle-table-group-title" scope="row">
- <span id="{concat('_THIS_',$group_number,'_groupcaption')}">
- <xsl:apply-templates select="uic:name"/>
- </span>
- <xsl:apply-templates select="uic:icon"/>
- </td>
- <!-- empty spacer column -->
- <td height="15" width="1" role="separator">
- <img height="15" width="1" src="{$serverWebcontentPath}images/space.gif" alt=""/>
- </td>
- <td>
- <xsl:attribute name="colspan"><xsl:value-of select="2*(count(//uic:header/uic:row/uic:column))"/></xsl:attribute>
- <span>
- <xsl:if test="not($collapsed='true')">
- <xsl:attribute name="style">display:none</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="id">_THIS_group_summary_<xsl:value-of select="$group_number"/></xsl:attribute>
- <xsl:apply-templates select="uic:summary"/>
- </span>
- </td>
- </tr>
- <xsl:apply-templates select="uic:row">
- <xsl:with-param name="groupPosition" select="$group_number"/>
- <xsl:with-param name="visible" select="not($collapsed='true')"/>
- <xsl:with-param name="tableFeatures">
- <xsl:copy-of select="$tableFeatures"/>
- </xsl:with-param>
- <xsl:with-param name="withRowDetails" select="boolean(./uic:rowDetails)"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--
- Deals with rows and rowDetails
- -->
- <xsl:template match="uic:row | uic:rowDetails">
- <xsl:param name="groupPosition" select="''"/>
- <xsl:param name="visible" select="'true'"/>
- <xsl:param name="tableFeatures"/>
- <xsl:param name="withRowDetails" select="false()"/>
- <!--
- each item to be displayed has two elements in the DOM tree (a uic:row element and a uic:rowDetails element);
- we need to alternate row backgrounds between even (uic:row) elements only; hence the calculation below
- -->
- <xsl:variable name="curPos">
- <xsl:choose>
- <xsl:when test="$withRowDetails = 'true'">
- <xsl:value-of select="floor(((position()-1) div 2) mod 2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="position() mod 2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr id="{concat($groupPosition,'_',position())}">
- <xsl:if test="@lang != ''">
- <xsl:attribute name="lang"><xsl:value-of select="@lang"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="class">
- <xsl:choose>
- <xsl:when test="@selected = 'true'">cogstyle-table-row-selected</xsl:when>
- <xsl:when test="$tableFeatures/uic:listViewSeparator = 'background' and $curPos=1">cogstyle-table-row-alternate</xsl:when>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="style">
- <xsl:if test="not($visible='true') or (local-name()='rowDetails' and @expanded != 'true')">display: none;</xsl:if>
- <xsl:if test="$tableFeatures/uic:type = 'selection'">cursor:pointer</xsl:if>
- </xsl:attribute>
-
- <!-- row id -->
- <xsl:choose>
- <xsl:when test="$groupPosition != ''">
- <xsl:attribute name="id">_THIS_group_<xsl:value-of select="concat($groupPosition, '_', position())"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="local-name()='rowDetails'">
- <xsl:attribute name="id">_THIS_rowDetails</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="$tableFeatures/uic:type = 'selection'">
- <xsl:attribute name="onmouseover">if (this.className!='cogstyle-table-row-selected')this.className='cogstyle-table-row-alternate'</xsl:attribute>
- <xsl:attribute name="onmouseout">if (this.className!='cogstyle-table-row-selected') this.className = '<xsl:choose><xsl:when test="$tableFeatures/uic:listViewSeparator = 'background' and $curPos=1">cogstyle-table-row-alternate</xsl:when><xsl:otherwise>cogstyle-table-row-default</xsl:otherwise></xsl:choose>'</xsl:attribute>
- <xsl:attribute name="onclick">toggleHighlight('_THIS_', this, _THIS_alternate)</xsl:attribute>
- </xsl:if>
- <xsl:if test="@onmouseup">
- <xsl:attribute name="onmouseup"><xsl:value-of select="@onmouseup"/></xsl:attribute>
- </xsl:if>
- <!-- checkbox column -->
- <xsl:if test="$tableFeatures/uic:type = 'checkbox'">
- <td onclick="cancelBubble(event)" scope="col">
- <xsl:choose>
- <xsl:when test="$tableFeatures/uic:listViewSeparator = 'line'">
- <xsl:attribute name="class"><xsl:value-of select="'cogstyle-table-row-separator'"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="class"><xsl:value-of select="'cogstyle-table-row-default'"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@hideCheckbox != 'true' and local-name()!= 'rowDetails'">
- <xsl:call-template name="uic:genSelectRowCheckbox">
- <xsl:with-param name="tableName" select="$tableFeatures/uic:name"/>
- </xsl:call-template>
- </xsl:if>
- </td>
- <!-- empty spacer column -->
- <td height="15" width="1" role="separator">
- <img height="15" width="1" src="{$serverWebcontentPath}images/space.gif" alt=""/>
- </td>
- </xsl:if>
- <xsl:if test="$tableFeatures/uic:type = 'group'">
- <td role="presentation">
- <xsl:if test="$tableFeatures/uic:listViewSeparator = 'line'">
- <xsl:attribute name="class"><xsl:value-of select="'cogstyle-table-row-separator'"/></xsl:attribute>
- </xsl:if>
- <xsl:text> </xsl:text>
- </td>
- <!-- empty spacer column -->
- <td height="15" width="1" role="presentation">
- <img height="15" width="1" src="{$serverWebcontentPath}images/space.gif" alt=""/>
- </td>
- </xsl:if>
- <xsl:apply-templates select="*">
- <xsl:with-param name="tableFeatures">
- <xsl:copy-of select="$tableFeatures"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </tr>
- </xsl:template>
- <!--
- creates a column in the table
- -->
- <xsl:template match="uic:column">
- <xsl:param name="type" select="''"/>
- <xsl:param name="tableFeatures"/>
- <xsl:variable name="tdType">
- <xsl:choose>
- <xsl:when test="$type='header'">th</xsl:when>
- <xsl:otherwise>td</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{$tdType}">
- <xsl:copy-of select="@*[not(contains(' nowrap colspan onclick ', concat(' ', local-name(), ' ')))]"/>
- <xsl:if test="$tdType='th' and not(@scope)">
- <xsl:attribute name="scope">col</xsl:attribute>
- </xsl:if>
- <xsl:if test="@nowrap">
- <xsl:attribute name="nowrap">nowrap</xsl:attribute>
- </xsl:if>
- <xsl:if test="@colspan">
- <xsl:attribute name="colspan"><xsl:value-of select="2*(number(@colspan))-1"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@onclick">
- <xsl:attribute name="onclick"><xsl:value-of select="@onclick"/></xsl:attribute>
- <xsl:attribute name="onkeyup">if (event.keyCode == 13) {<xsl:value-of select="@onclick"/>}</xsl:attribute>
- </xsl:if>
- <xsl:if test="$tableFeatures/uic:listViewSeparator = 'line' and $type != 'header' and $type != 'footer'">
- <xsl:attribute name="class"><xsl:value-of select="'cogstyle-table-row-separator'"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style">
- <xsl:value-of select="concat(@style, 'text-align:left;padding-right:5px;')"/>
- <xsl:choose>
- <xsl:when test="@indent != ''">padding-left:<xsl:value-of select="number(@indent) * 20"/>px;</xsl:when>
- <xsl:otherwise>padding-left:5px;</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:choose>
- <!-- build the sort column header-->
- <xsl:when test="@sort and @sort !=''">
- <xsl:variable name="lbl_abbr">
- <xsl:apply-templates select="uic:text"/>
- </xsl:variable>
- <xsl:if test="$lbl_abbr != ''">
- <xsl:attribute name="abbr"><xsl:value-of select="xtsext:htmlencode($lbl_abbr)"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="imgSrc">
- <xsl:choose>
- <xsl:when test="$tableFeatures/uic:sortColumn and @sort = $tableFeatures/uic:sortColumn">
- <xsl:choose>
- <xsl:when test="$tableFeatures/uic:sortOrder and $tableFeatures/uic:sortOrder = 'descending'">list_sort_descending.gif</xsl:when>
- <xsl:when test="$tableFeatures/uic:sortOrder and $tableFeatures/uic:sortOrder = 'ascending'">list_sort_ascending.gif</xsl:when>
- <xsl:otherwise>list_sort_no.gif</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>list_sort_no.gif</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="tooltipMsg">
- <xsl:choose>
- <xsl:when test="$tableFeatures/uic:sortColumn and @sort = $tableFeatures/uic:sortColumn">
- <xsl:choose>
- <xsl:when test="$tableFeatures/uic:sortOrder and $tableFeatures/uic:sortOrder = 'descending'"><xsl:value-of select="$pagerSortDescendingTooltip"/></xsl:when>
- <xsl:when test="$tableFeatures/uic:sortOrder and $tableFeatures/uic:sortOrder = 'ascending'"><xsl:value-of select="$pagerSortAscendingTooltip"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$pagerSortDefaultTooltip"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$pagerSortDefaultTooltip"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="onclick"><xsl:value-of select="concat('sortGo(_THIS_,"', @sort, '", "', $tableFeatures/uic:sortColumn, '","' , $tableFeatures/uic:sortOrder, '","', $tableFeatures/uic:pageParams,'",evalParm("',$tableFeatures/uic:interactionParams,'"))')"/></xsl:variable>
- <a href="#" onclick="{$onclick}" role="button">
- <span><xsl:apply-templates select="*"/></span>
- <img src="{$skinWebcontentPath}{$imgSrc}" style="vertical-align: middle; border: 0;">
- <xsl:attribute name="alt"><xsl:value-of select="$tooltipMsg"/></xsl:attribute>
- <xsl:attribute name="title"><xsl:value-of select="$tooltipMsg"/></xsl:attribute>
- </img>
- </a>
- </xsl:when>
- <!-- build the regular column header-->
- <xsl:otherwise>
- <xsl:apply-templates select="*"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <!-- column dividers: vertical lines for header and empty space for table body -->
- <xsl:if test="$type != 'footer'">
- <xsl:element name="{$tdType}">
- <xsl:attribute name="height">15</xsl:attribute>
- <xsl:attribute name="role">separator</xsl:attribute>
- <xsl:attribute name="aria-orientation">vertical</xsl:attribute>
- <xsl:if test="$tdType='th'">
- <xsl:attribute name="scope">col</xsl:attribute>
- </xsl:if>
- <xsl:if test="position() = last()">
- <xsl:attribute name="width">141px</xsl:attribute><!-- stops right-hand columns from expanding too wide -->
- </xsl:if>
- <table cellpadding="0" cellspacing="0" border="0" role="presentation">
- <tr>
- <td style="padding:0px">
- <img height="15" width="1" src="{$serverWebcontentPath}images/space.gif" alt="">
- <xsl:if test="$type = 'header' and position() != last()">
- <xsl:attribute name="style">background-color:#9C9C9C</xsl:attribute>
- </xsl:if>
- </img>
- </td>
- </tr>
- </table>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="uic:filterSummary">
- <xsl:param name="prefix" select="''"/>
- <div style="float: left; vertical-align: text-top;">
- <img src="{$cogadminWebcontentPath}action_filter.gif">
- <xsl:attribute name="title"><xsl:value-of select="$filterTitle"/></xsl:attribute>
- <xsl:attribute name="alt"><xsl:value-of select="$filterTitle"/></xsl:attribute>
- </img>
- <xsl:for-each select="item">
- <span style="padding-left:0.6em;font-weight:bold;vertical-align:text-top;"><xsl:value-of select="label"/></span>
- <span style="padding-left:0.2em;vertical-align:text-top;"><xsl:value-of select="concat('[ ',value,' ]')"/></span>
- </xsl:for-each>
- </div>
- </xsl:template>
-
- <xsl:template match="uic:paginations">
- <xsl:param name="pagerName" select="''"/>
- <xsl:param name="interactionParams" select="''"/>
- <xsl:param name="sortParams" select="''"/>
-
- <xsl:variable name="javascriptEncodedPageName" select="xtsext:javascriptencode(string($pagerName))"/>
- <xsl:variable name="prev_skip">
- <xsl:choose>
- <xsl:when test="uic:from and uic:linesPerPage and (number(uic:from) - number(uic:linesPerPage) > 0)">
- <xsl:value-of select="number(uic:from) - number(uic:linesPerPage) -1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="pageEnd">
- <xsl:choose>
- <xsl:when test="uic:to and number(uic:to)">
- <xsl:value-of select="number(uic:to)"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="linesPerPage">
- <xsl:choose>
- <xsl:when test="uic:linesPerPage and number(uic:linesPerPage)">
- <xsl:value-of select="number(uic:linesPerPage)"/>
- </xsl:when>
- <xsl:otherwise>15</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <script>
- var pager_validation_msg_array = new Array();
- pager_validation_msg_array['IDS_PAGER_FROM_INVALID'] = '<xsl:value-of select="$pagerFromInvalid"/>';
- pager_validation_msg_array['IDS_PAGER_TO_INVALID'] = '<xsl:value-of select="$pagerToInvalid"/>';
- pager_validation_msg_array['IDS_PAGER_ENTRIES_INVALID'] = '<xsl:value-of select="$pagerEntriesInvalid"/>';
- pager_validation_msg_array['IDS_PAGER_ENTRIES_EMPTY'] = '<xsl:value-of select="$pagerEntriesEmpty"/>';
- </script>
- <div class="cogstyle-table-paginations">
- <table cellpadding="0" cellspacing="0" style="padding:1px;height:20px;" role="presentation">
- <tr>
- <td class="cogstyle-form-text" nowrap="nowrap" style="padding-right:5px;">
- <xsl:value-of select="$pagerItemsMsg"/>
- </td>
- <td>
- <input id="{$pagerName}_from" name="{$pagerName}_from" type="text" size="4" class="cogstyle-form-text" maxlength="9" aria-label="{uic:fromLabel}">
- <xsl:attribute name="value">
- <xsl:if test="number(uic:from) > 0"><xsl:value-of select="number(uic:from)"/></xsl:if>
- </xsl:attribute>
- </input>
- </td>
- <td class="cogstyle-form-text" style="padding-right:5px; padding-left: 5px;">-</td>
- <td>
- <input id="{$pagerName}_to" name="{$pagerName}_to" type="text" size="4" class="cogstyle-form-text" maxlength="9" aria-label="{uic:toLabel}">
- <xsl:attribute name="value">
- <xsl:if test="number(uic:to) > 0"><xsl:value-of select="number(uic:to)"/></xsl:if>
- </xsl:attribute>
- </input>
- </td>
- <td style="padding-right:8px;padding-left:2px;">
- <xsl:apply-templates select="uic:goto">
- <xsl:with-param name="imageEnabled" select="'action_go.gif'"/>
- <xsl:with-param name="defaultOnClickParams" select="$sortParams"/>
- <xsl:with-param name="interactionParams" select="$interactionParams"/>
- <xsl:with-param name="pagerName" select="$javascriptEncodedPageName"/>
- <xsl:with-param name="iconTooltip" select="$pagerGoto"/>
- </xsl:apply-templates>
- </td>
- <td nowrap="nowrap">
- <div style="height:13px;" class="rowDivider"/>
- </td>
- <td nowrap="nowrap" style="padding-left:8px;">
- <xsl:apply-templates select="uic:first">
- <xsl:with-param name="imageEnabled" select="'control_btn_top.gif'"/>
- <xsl:with-param name="imageDisabled" select="'control_btn_top_disabled.gif'"/>
- <xsl:with-param name="defaultOnClickParams" select="concat($javascriptEncodedPageName ,'_skip=0&', $sortParams)"/>
- <xsl:with-param name="interactionParams" select="$interactionParams"/>
- <xsl:with-param name="iconTooltip" select="$pagerFirst"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="uic:previous">
- <xsl:with-param name="imageEnabled" select="'control_btn_pageup.gif'"/>
- <xsl:with-param name="imageDisabled" select="'control_btn_pageup_disabled.gif'"/>
- <xsl:with-param name="defaultOnClickParams" select="concat($javascriptEncodedPageName ,'_skip=', number($prev_skip), '&', $sortParams)"/>
- <xsl:with-param name="interactionParams" select="$interactionParams"/>
- <xsl:with-param name="iconTooltip" select="$pagerPrevious"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="uic:next">
- <xsl:with-param name="imageEnabled" select="'control_btn_pagedown.gif'"/>
- <xsl:with-param name="imageDisabled" select="'control_btn_pagedown_disabled.gif'"/>
- <xsl:with-param name="defaultOnClickParams" select="concat($javascriptEncodedPageName ,'_skip=', number($pageEnd), '&', $sortParams)"/>
- <xsl:with-param name="interactionParams" select="$interactionParams"/>
- <xsl:with-param name="iconTooltip" select="$pagerNext"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="uic:last">
- <xsl:with-param name="imageEnabled" select="'control_btn_bottom.gif'"/>
- <xsl:with-param name="imageDisabled" select="'control_btn_bottom_disabled.gif'"/>
- <xsl:with-param name="defaultOnClickParams" select="concat($javascriptEncodedPageName ,'_skip=-', number($linesPerPage), '&', $sortParams)"/>
- <xsl:with-param name="interactionParams" select="$interactionParams"/>
- <xsl:with-param name="iconTooltip" select="$pagerLast"/>
- </xsl:apply-templates>
- </td>
- </tr>
- </table>
- </div>
- <div style="clear:both; margin-bottom: 3px;"/>
- </xsl:template>
- <xsl:template match="uic:goto | uic:first | uic:previous | uic:next | uic:last">
- <xsl:param name="imageEnabled" select="''"/>
- <xsl:param name="imageDisabled" select="''"/>
- <xsl:param name="defaultOnClickParams" select="''"/>
- <xsl:param name="interactionParams" select="''"/>
- <xsl:param name="pagerName" select="''"/>
- <xsl:param name="iconTooltip" select="''"/>
-
- <xsl:variable name="isNavgoto">
- <xsl:choose>
- <xsl:when test="local-name(.) = 'goto'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="./uic:disabled">
- <img style="margin-right: 2px;" class="button" border="0" src="{$skinWebcontentPath}{$imageDisabled}">
- <xsl:attribute name="title"><xsl:value-of select="$iconTooltip"/></xsl:attribute>
- <xsl:attribute name="alt"><xsl:value-of select="$iconTooltip"/></xsl:attribute>
- </img>
- </xsl:when>
- <xsl:otherwise>
- <img style="margin-right: 2px; cursor: pointer;" tabindex="0" class="button" role="button" border="0" src="{$skinWebcontentPath}{$imageEnabled}" onmousedown="this.className='button_pressed'" onmouseover="this.className='button_hover'" onmouseout="this.className='button'">
- <xsl:attribute name="title"><xsl:value-of select="$iconTooltip"/></xsl:attribute>
- <xsl:attribute name="alt"><xsl:value-of select="$iconTooltip"/></xsl:attribute>
- <xsl:attribute name="onkeypress">
- <xsl:text>if (event.keyCode==13 || event.keyCode==32 || event.charCode==32){this.onclick();return false;}</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="onclick">
- <xsl:choose>
- <xsl:when test="uic:link"><xsl:value-of select="uic:link"/></xsl:when>
- <!-- build the default action -->
- <xsl:when test="$isNavgoto = 'true'">
- <xsl:text/>
- <xsl:value-of select="concat('navGo(_THIS_,"', $pagerName, '", "', $defaultOnClickParams, '",evalParm("',$interactionParams,'"));')"/>
- <xsl:text/>
- </xsl:when>
- <xsl:when test="$defaultOnClickParams != '' or $interactionParams != ''">
- <xsl:text/>
- <xsl:value-of select="concat('navOthers(_THIS_, "', $defaultOnClickParams, '",evalParm("',$interactionParams,'"));')"/>
- <xsl:text/>
- </xsl:when>
- </xsl:choose>
- </xsl:attribute>
- </img>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|