Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

232 lines
9.3 KiB

  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  2. <xsl:template match="/">
  3. <xsl:apply-templates select="Roles"/>
  4. </xsl:template>
  5. <xsl:template match="Roles">
  6. <table width="100%" cellpadding="0" cellspacing="0" style="margin-top:16px">
  7. <xsl:for-each select="Role">
  8. <tr>
  9. <td>
  10. <xsl:apply-templates select="."/>
  11. </td>
  12. </tr>
  13. </xsl:for-each>
  14. </table>
  15. </xsl:template>
  16. <xsl:template match="/Roles/Role">
  17. <table id="roletable" width="100%" cellpadding="0" cellspacing="0" style="margin-top: 16px">
  18. <xsl:attribute name="mys_id"><xsl:value-of select="@mys_id" /></xsl:attribute>
  19. <tr id="roleHeader" >
  20. <td id="roleImageCell" rowspan="2" valign="top" >
  21. <span id="roleImageSpan"
  22. onclick="ToggleExpandRole(this.parentNode.parentNode.parentNode);">
  23. <img id="roleImage" width="17" height="17" style="margin-right: 6px;" src="MinusIcon.gif">
  24. <xsl:attribute name="alt"><xsl:value-of select="@name"/></xsl:attribute>
  25. </img>
  26. </span>
  27. </td>
  28. <td id="roleTextCell" width="100%" colspan="2" valign="top" nowrap="true">
  29. <table id="roleTextTable" cellpadding="0" cellspacing="0" width="100%">
  30. <tr>
  31. <td nowrap="true">
  32. <span class="mysRoleTitleText" tabindex="0"
  33. onkeydown="ToggleFromKeyboard(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode);"
  34. onClick="ToggleExpandRole(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode);">
  35. <b><xsl:value-of select="@name"/></b>
  36. </span>
  37. </td>
  38. </tr>
  39. <tr id="ruleRow">
  40. <td width="100%" >
  41. <hr color="ButtonFace" noshade="true" size="1" />
  42. </td>
  43. </tr>
  44. </table>
  45. </td>
  46. </tr>
  47. <tr valign="top" id="roleBody">
  48. <td width="100%" id="roleBodyTd1">
  49. <div class="mysRoleDescription"><xsl:call-template name="TranslateParagraphs">
  50. <xsl:with-param name="text" select="@description"/>
  51. </xsl:call-template></div>
  52. </td>
  53. <td id="roleBodyTd2">
  54. <div class="mysTaskSubTaskPane">
  55. <xsl:apply-templates select="Links"/>
  56. </div>
  57. </td>
  58. </tr>
  59. </table>
  60. </xsl:template>
  61. <xsl:template name="StrReplace">
  62. <xsl:param name="in"/>
  63. <xsl:param name="token"/>
  64. <xsl:param name="replacetoken"/>
  65. <xsl:choose>
  66. <xsl:when test="contains($in, $token)">
  67. <xsl:value-of select="substring-before($in, $token)"/>
  68. <xsl:value-of select="$replacetoken"/>
  69. <xsl:call-template name="StrReplace">
  70. <xsl:with-param name="in" select="substring-after($in, $token)"/>
  71. <xsl:with-param name="token" select="$token"/>
  72. <xsl:with-param name="replacetoken" select="$replacetoken"/>
  73. </xsl:call-template>
  74. </xsl:when>
  75. <xsl:otherwise>
  76. <xsl:value-of select="$in"/>
  77. </xsl:otherwise>
  78. </xsl:choose>
  79. </xsl:template>
  80. <xsl:template name="EscapeJPath">
  81. <xsl:param name="in"/>
  82. <xsl:variable name="resultString">
  83. <xsl:call-template name="StrReplace">
  84. <xsl:with-param name="in" select="$in"/>
  85. <xsl:with-param name="token" select="'\'"/>
  86. <xsl:with-param name="replacetoken" select="'\\'"/>
  87. </xsl:call-template>
  88. </xsl:variable>
  89. <xsl:call-template name="StrReplace">
  90. <xsl:with-param name="in" select="$resultString"/>
  91. <xsl:with-param name="token" select="'&quot;'"/>
  92. <xsl:with-param name="replacetoken" select="'\&quot;'"/>
  93. </xsl:call-template>
  94. </xsl:template>
  95. <xsl:template name="TranslateParagraphs">
  96. <xsl:param name="text" />
  97. <!-- The value of this variable needs to match the constant in the COM object. -->
  98. <xsl:variable name="paragraph_marker">PARA_MARKER</xsl:variable>
  99. <xsl:choose>
  100. <xsl:when test="contains($text, $paragraph_marker)">
  101. <xsl:value-of select="substring-before($text, $paragraph_marker)" />
  102. <br />
  103. <br />
  104. <xsl:call-template name="TranslateParagraphs">
  105. <xsl:with-param name="text" select="substring-after($text, $paragraph_marker)" />
  106. </xsl:call-template>
  107. </xsl:when>
  108. <xsl:otherwise>
  109. <xsl:value-of select="$text" />
  110. </xsl:otherwise>
  111. </xsl:choose>
  112. </xsl:template>
  113. <xsl:template match="/Roles/Role/Links">
  114. <table width="100%" class="mysSubTasks" cellpadding="0" cellspacing="0">
  115. <xsl:for-each select="Link">
  116. <tr class="mysSubtaskRow">
  117. <xsl:if test="@id" >
  118. <xsl:attribute name="style" >display:none;</xsl:attribute>
  119. <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
  120. </xsl:if>
  121. <td valign="top">
  122. <div class="mysSubtaskImageCell">
  123. <center>
  124. <span>
  125. <a class="mysSubtaskLink" tabIndex="-1" hideFocus="true" >
  126. <xsl:choose>
  127. <xsl:when test="@type = 'url'">
  128. <xsl:attribute name="href"><xsl:value-of select="@command" /></xsl:attribute>
  129. <xsl:attribute name="target">_blank</xsl:attribute>
  130. </xsl:when>
  131. <xsl:when test="@type = 'help'">
  132. <xsl:attribute name="href">javascript:execChm("<xsl:call-template name="EscapeJPath">
  133. <xsl:with-param name="in" select="@command"/>
  134. </xsl:call-template>")
  135. </xsl:attribute>
  136. </xsl:when>
  137. <xsl:when test="@type = 'hcp'">
  138. <xsl:attribute name="href">javascript:execCmd('"<xsl:call-template name="EscapeJPath">
  139. <xsl:with-param name="in" select="@command"/>
  140. </xsl:call-template>"')
  141. </xsl:attribute>
  142. </xsl:when>
  143. <xsl:when test="@type = 'program'">
  144. <xsl:attribute name="href">javascript:execCmd("<xsl:call-template name="EscapeJPath">
  145. <xsl:with-param name="in" select="@command"/>
  146. </xsl:call-template>")
  147. </xsl:attribute>
  148. </xsl:when>
  149. <xsl:when test="@type = 'cpl'">
  150. <xsl:attribute name="href">javascript:execCpl("<xsl:value-of select="@command" />")</xsl:attribute>
  151. </xsl:when>
  152. <xsl:otherwise>
  153. <xsl:attribute name="href">about:blank</xsl:attribute>
  154. </xsl:otherwise>
  155. </xsl:choose>
  156. <xsl:attribute name="title"><xsl:value-of select="@tooltip" /></xsl:attribute>
  157. <xsl:choose>
  158. <xsl:when test="@type = 'help'" >
  159. <img border="0" width="20" height="20" src="help.gif"/>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. <img border="0" width="20" height="20" src="greenarrow_small.gif"/>
  163. </xsl:otherwise>
  164. </xsl:choose>
  165. </a>
  166. </span>
  167. </center>
  168. </div>
  169. </td>
  170. <td width="100%" valign="top">
  171. <div class="mysSubtaskTextCell">
  172. <a tabindex="0" class="mysSubtaskLink">
  173. <xsl:choose>
  174. <xsl:when test="@type = 'url'">
  175. <xsl:attribute name="href"><xsl:value-of select="@command" /></xsl:attribute>
  176. <xsl:attribute name="target">_blank</xsl:attribute>
  177. </xsl:when>
  178. <xsl:when test="@type = 'help'">
  179. <xsl:attribute name="href">javascript:execChm("<xsl:call-template name="EscapeJPath">
  180. <xsl:with-param name="in" select="@command"/>
  181. </xsl:call-template>")
  182. </xsl:attribute>
  183. </xsl:when>
  184. <xsl:when test="@type = 'hcp'">
  185. <xsl:attribute name="href">javascript:execCmd('"<xsl:call-template name="EscapeJPath">
  186. <xsl:with-param name="in" select="@command"/>
  187. </xsl:call-template>"')
  188. </xsl:attribute>
  189. </xsl:when>
  190. <xsl:when test="@type = 'program'">
  191. <xsl:attribute name="href">javascript:execCmd("<xsl:call-template name="EscapeJPath">
  192. <xsl:with-param name="in" select="@command"/>
  193. </xsl:call-template>")
  194. </xsl:attribute>
  195. </xsl:when>
  196. <xsl:when test="@type = 'cpl'">
  197. <xsl:attribute name="href">javascript:execCpl("<xsl:value-of select="@command" />")</xsl:attribute>
  198. </xsl:when>
  199. <xsl:otherwise>
  200. <xsl:attribute name="href">about:blank</xsl:attribute>
  201. </xsl:otherwise>
  202. </xsl:choose>
  203. <xsl:attribute name="title"><xsl:value-of select="@tooltip" /></xsl:attribute>
  204. <xsl:attribute name="onmouseover">this.style.textDecoration='underline';</xsl:attribute>
  205. <xsl:attribute name="onmouseout">this.style.textDecoration='none';</xsl:attribute>
  206. <xsl:value-of select="@description"/>
  207. </a>
  208. </div>
  209. </td>
  210. </tr>
  211. </xsl:for-each>
  212. </table>
  213. </xsl:template>
  214. </xsl:stylesheet>