hierarchy-navigator.xsl 3.27 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="cat-edit">
  <table cellpadding="1" cellspacing="0" border="1" id="{$renderId}">
    <xsl:apply-templates select="cat-category"/>
    <!-- buttons -->
    <tr>
      <td align="right">
        <div align="right">
          <input type="submit" value="{@ok-title}" name="{@ok-id}"/>
          <xsl:text> </xsl:text>
          <input type="submit" value="{@cancel-title}" name="{@cancel-id}"/>
        </div>
      </td>
    </tr>
  </table>
</xsl:template>

<xsl:template match="cat-category">
  <tr>
    <th align="left" class="navi-axis">
      <xsl:choose>
        <!-- the first category gets the close button -->
        <xsl:when test="position() = 1">

          <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <tr>
              <th align="left" class="navi-axis">
                <img src="{$context}/jpivot/navi/{@icon}" width="9" height="9"/>
                <xsl:text> </xsl:text>
                <xsl:value-of select="@name"/>
              </th>
              <td align="right" class="xform-close-button">
                <input type="image" src="{$context}/wcf/form/cancel.png" value="{../@cancel-title}" name="{../@cancel-id}" width="16" height="16"/>
              </td>
            </tr>
          </table>
        </xsl:when>
        <xsl:otherwise>
          <img src="{$context}/jpivot/navi/{@icon}" width="9" height="9"/>
          <xsl:text> </xsl:text>
          <xsl:value-of select="@name"/>
        </xsl:otherwise>
      </xsl:choose>
    </th>
  </tr>
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="cat-item">
  <tr>
    <td class="navi-hier">
      <div style="margin-left: 1em">
        <xsl:apply-templates select="cat-button"/>
        <xsl:apply-templates select="move-button"/>
        <xsl:text> </xsl:text>
        <xsl:choose>
          <xsl:when test="@id">
            <a href="?{$token}&amp;{@id}=x">
              <xsl:value-of select="@name"/>
            </a>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="@name"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:text> </xsl:text>
        <xsl:apply-templates select="property-button"/>
        <xsl:apply-templates select="function-button"/>
        <xsl:apply-templates select="slicer-value"/>
      </div>
    </td>
  </tr>
</xsl:template>

<xsl:template match="slicer-value">
  <xsl:text> (</xsl:text>
  <xsl:value-of select="@level"/>
  <xsl:text>=</xsl:text>
  <xsl:value-of select="@label"/>
  <xsl:text>)</xsl:text>
</xsl:template>

<xsl:template match="cat-button[@icon]">
  <input border="0" type="image" src="{$context}/jpivot/navi/{@icon}" name="{@id}" width="9" height="9"/>
  <xsl:text> </xsl:text>
</xsl:template>

<xsl:template match="cat-button">
  <img src="{$context}/jpivot/navi/empty.png" width="9" height="9"/>
  <xsl:text> </xsl:text>
</xsl:template>


<xsl:template match="property-button">
  <input border="0" type="image" src="{$context}/jpivot/navi/properties.png" name="{@id}"/>
  <xsl:text> </xsl:text>
</xsl:template>

<xsl:template match="function-button">
  <input border="0" type="image" src="{$context}/jpivot/navi/functions.png" name="{@id}"/>
  <xsl:text> </xsl:text>
</xsl:template>


</xsl:stylesheet>