menu.xslt 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:out="dummy-uri" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:alm="http://developer.cognos.com/schemas/xts/alm" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" exclude-result-prefixes="xsl dp dt cp xtsext xts utml alm cm cf">
  9. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  10. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  11. <xsl:template match="alm:doMenu">
  12. <out:template match="/">
  13. <script language="javascript"><![CDATA[
  14. if (window.attachEvent) {
  15. window.attachEvent("onresize", cf.setInsertableObjectsTabContainerHeight);
  16. }
  17. else {
  18. window.addEventListener("resize", cf.setInsertableObjectsTabContainerHeight, false);
  19. }
  20. function mouseOverHideButton(item) {
  21. item.className='hide_show_hover';
  22. window.status='';
  23. return true;
  24. }
  25. function mouseOutHideButton(item,normalClass) {
  26. if (normalClass == undefined) {
  27. item.className='';
  28. }
  29. else {
  30. item.className=normalClass
  31. }
  32. window.status='';
  33. return true;
  34. }
  35. function mouseDownHideButton(item) {
  36. item.className='hide_show_pressed';
  37. window.status='';
  38. return true;
  39. }
  40. function mouseUpHideButton(item) {
  41. item.className='hide_show_hover';
  42. window.status='';
  43. }
  44. function toggleTasksPane()
  45. {
  46. // get the element
  47. var tableElement = document.getElementById("taskContents_tableID");
  48. var imageElement = document.getElementById("taskMinMax");
  49. var taskDiv = document.getElementById("taskDiv");
  50. //It is used to fix the persentage UI issue of IE browser in Standards mode.
  51. var insertableObjElement = document.getElementById("l2");
  52. var metadataContainerElement = document.getElementById("meta_container");
  53. // are we hidden or not
  54. if (tableElement.style.display == "none") {
  55. if (browserCheck.isIE5Up()) {
  56. tableElement.style.display="block";
  57. //It is used to fix the persentage UI issue of IE browser in Standards mode.
  58. insertableObjElement.style.height="80%";
  59. metadataContainerElement.style.height="80%";
  60. } else {
  61. tableElement.style.display="table";
  62. }
  63. taskDiv.style.height = 110 + "px";
  64. // we also want to swap the image
  65. imageElement.src="../ags/images/hide_area.gif";
  66. imageElement.title = taskpanehidetooltip_string;
  67. }
  68. else {
  69. // we want to hide it
  70. tableElement.style.display="none";
  71. //It is used to fix the persentage UI issue of IE browser in Standards mode.
  72. if (browserCheck.isIE5Up()) {
  73. insertableObjElement.style.height="88%";
  74. metadataContainerElement.style.height="100%";
  75. }
  76. taskDiv.style.height = 0 + "px";
  77. // we also want to swap the image
  78. imageElement.src="../ags/images/show_area.gif";
  79. imageElement.title = taskpaneopentooltip_string;
  80. }
  81. }
  82. function toggleTasksandInserts() {
  83. var label = "menuTabs_and_Props";
  84. var doc = document.getElementById(label);
  85. var state;
  86. var menuItem = menuItemMap['taskObjMenuItem'];
  87. var iconPath = '../ags/images/menu/check.gif';
  88. if(menuItem.m_icon.getPath()=='../ags/images/menu/check.gif'){
  89. iconPath = '../common/images/spacer.gif';
  90. }
  91. menuItem.m_icon.setPath(iconPath);
  92. if (doc.style.visibility == "visible" || doc.style.visibility =='')
  93. state = true;
  94. else state = false;
  95. if (!state) {
  96. doc.style.visibility = "visible";
  97. expandMenu();
  98. }
  99. else {
  100. doc.style.visibility = "hidden";
  101. collapseMenu();
  102. }
  103. }
  104. // This checks for the schedule changes to dynamically change the UI icon for
  105. // Schedule the agent task , we pass the state of the schedule(boolean value) and status string
  106. // to update when leaving the saved agent.
  107. function toggleScheduleState(state, status) {
  108. var imageElement = document.getElementById("schedule_img");
  109. var imageLink = null;
  110. if (!status) {
  111. if (!state || state == "false") {
  112. imageLink = "../ags/images/tasks/action_edit_disabled_schedule.gif";
  113. }
  114. else {
  115. imageLink = "../ags/images/tasks/action_edit_enabled_schedule.gif";
  116. }
  117. } else {
  118. imageLink = "../ags/images/tasks/action_edit_schedule.gif";
  119. }
  120. imageElement.style.background = 'url('+imageLink+') no-repeat center';
  121. var schMenuItem = menuItemMap['scheduleMenuItem'];
  122. var tooltip = schMenuItem.m_icon.m_tooltip;
  123. schMenuItem.m_icon = new CIcon(imageLink, tooltip);
  124. //schMenuItem.draw();
  125. }
  126. ]]>
  127. </script>
  128. <!-- The frame that holds the 'Tasks' list and the 'Insertable items' pane (which includes the Model, Agent Items and Functions tabs)-->
  129. <table border="0" role="presentation" cellpadding="0" cellspacing="0" style="width:100%;height:100%;padding: 2px 0px 0px 0px;" class="insertableItemsPaneBorder">
  130. <tr>
  131. <td class="taskHideButton">
  132. <!-- the expand frame button which is not shown at startup-->
  133. <table id="menuExpand_button" cellpadding="0" cellspacing="0" border="0" role="presentation" height="100%" style="display:none;padding 2px 0px 0px 2px" >
  134. <tr valign="top">
  135. <td height="50" align="center">
  136. <a href="#" onmouseover="window.status='';return true;">
  137. <img src="../ags/images/show_pane.gif" class="hide_show_leftpane" height="48" width="6" border="0" role="button" onmouseover="mouseOverHideButton(this);" onmouseout="mouseOutHideButton(this,'hide_show_leftpane');" onmousedown="mouseDownHideButton(this);" onmouseup="mouseUpHideButton(this); toggleTasksandInserts(); " >
  138. <out:attribute name="alt">
  139. <xts:string id="MENU_PANE_EXPAND_TIP"/>
  140. </out:attribute>
  141. </img>
  142. </a>
  143. </td>
  144. </tr>
  145. <tr>
  146. <td height="100%" class="agsResizeDivider">&#160;</td>
  147. </tr>
  148. </table>
  149. <!-- this table holds the Tasks pane and Insertable Items pane-->
  150. <table id="menuTabs_and_Props" role="presentation" style="width:100%;height:100%;" cellpadding="0" cellspacing="0" class="insertableItemsPaneBorder">
  151. <tr>
  152. <td width="100%" height="100%">
  153. <!-- start of table -->
  154. <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" role="presentation">
  155. <tr>
  156. <td style="width:100%; height:20px" onhelp="viewCSHelp('ug_cr_as_ovrvw_es_wndw');">
  157. <table border="0" cellpadding="0" cellspacing="0" class="area_header" role="presentation" style="height:15px;width:100%">
  158. <tr>
  159. <td style="display:block;"><xts:string id="TASK_TITLE"/></td>
  160. <td align="right"><img style="display:block;" align="middle" class="hide_show_taskspane" id="taskMinMax" role="button" src="../ags/images/hide_area.gif" onclick="toggleTasksPane();" onmouseover="mouseOverHideButton(this);" onmouseout="mouseOutHideButton(this,'hide_show_taskspane');" onmousedown="mouseDownHideButton(this);" onmouseup="mouseUpHideButton(this);">
  161. <out:attribute name="title"><xts:string id="TASK_PANE_COLLAPSE_TIP"/></out:attribute>
  162. <out:attribute name="alt"><xts:string id="TASK_PANE_COLLAPSE_TIP"/></out:attribute>
  163. </img>
  164. </td>
  165. </tr>
  166. </table>
  167. </td>
  168. </tr>
  169. <tr>
  170. <td class="area">
  171. <div id="taskDiv" style="overflow:none; scrollbars=no; z-index:-10;">
  172. <!-- build the menu for the default task list and the wizard task list-->
  173. <out:for-each select="/root/menuList">
  174. <out:call-template name="doTaskDiv"/>
  175. </out:for-each>
  176. </div>
  177. </td>
  178. </tr>
  179. <!-- Horizontal resize spacer image - to separate header from body -->
  180. <tr>
  181. <out:if test="/root/browserInfo/isIE='true'">
  182. <out:attribute name="ondrag">return false;</out:attribute>
  183. </out:if>
  184. <td role="presentation" class="resize" style="cursor:n-resize;" onmousedown="enableResize(true,'height'); return false;" onmousemove="moveHorizPane(event); return false;" onmouseup="enableResize(false,'height')">
  185. <img style="display:block;" border="0" src="../ags/images/resize_area.gif" alt="" width="100%" height="3px"/>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td id="insertableObjectsHeader" class="area_header" style="width:100%;height:23px;" onhelp="viewCSHelp('ug_cr_as_ovrvw_insrt_obj');">
  190. <xts:string id="TREE_INSERTABLE_ITEMS"/>
  191. </td>
  192. </tr>
  193. <!-- put the contents of the insertable items in there -->
  194. <tr>
  195. <out:choose>
  196. <out:when test="/root/browserInfo/isIE='true'">
  197. <td style="height:80%;" id="l2">
  198. <out:call-template name="doTreeItems"/>
  199. </td>
  200. </out:when>
  201. <out:otherwise>
  202. <td style="height:100%;" id="l2">
  203. <out:call-template name="doTreeItems"/>
  204. </td>
  205. </out:otherwise>
  206. </out:choose>
  207. </tr>
  208. </table>
  209. <!-- end of table-->
  210. </td>
  211. <td>
  212. <img border="0" alt=" " src="../ags/images/spacer.gif" height="100%" width="1"/>
  213. </td>
  214. <!-- Vertical resize -->
  215. <td>
  216. <out:choose>
  217. <out:when test="/root/browserInfo/isIE='true'">
  218. <out:attribute name="style">width:3px; cursor:w-resize;</out:attribute>
  219. <out:attribute name="onmousedown">enableResize(true,'width'); return false;</out:attribute>
  220. <out:attribute name="onmousemove">resizeMenuPane(event); return false;</out:attribute>
  221. <out:attribute name="onmouseup">enableResize(false,'width');</out:attribute>
  222. <out:attribute name="ondrag">return false;</out:attribute>
  223. <out:element name="img">
  224. <out:attribute name="border">0</out:attribute>
  225. <out:attribute name="alt"></out:attribute>
  226. <out:attribute name="src">../ags/images/spacer.gif</out:attribute>
  227. <out:attribute name="width">1</out:attribute>
  228. <out:attribute name="height">100%</out:attribute>
  229. </out:element>
  230. </out:when>
  231. <out:otherwise>
  232. <out:element name="div">
  233. <out:attribute name="id">splitter</out:attribute>
  234. </out:element>
  235. </out:otherwise>
  236. </out:choose>
  237. </td>
  238. <td style="height: 100%" valign="top">
  239. <table border="0" cellpadding="0" cellspacing="0" height="100%" role="presentation">
  240. <tr valign="top">
  241. <td height="50" align="center" colspan="2">
  242. <a href="#" tabindex="-1" onmouseover="window.status='';return true;">
  243. <img src="../ags/images/hide_pane.gif" class="hide_show_leftpane" border="0" height="48" width="6" role="button" onmouseover="mouseOverHideButton(this);" onmouseout="mouseOutHideButton(this,'hide_show_leftpane');" onmousedown="mouseDownHideButton(this);" onmouseup="mouseUpHideButton(this); toggleTasksandInserts(); " >
  244. <out:attribute name="alt">
  245. <xts:string id="MENU_PANE_COLLAPSE_TIP"/>
  246. </out:attribute>
  247. </img>
  248. </a>
  249. </td>
  250. </tr>
  251. <tr>
  252. <td class="agsResizeDivider" height="95%">&#160;</td>
  253. </tr>
  254. </table>
  255. </td>
  256. </tr>
  257. </table>
  258. </td>
  259. <!-- the hide frame button -->
  260. </tr>
  261. </table>
  262. </out:template>
  263. <out:template name="doTaskDiv">
  264. <!-- render the menu and meta data tree-->
  265. <table role="presentation" border="0" cellpadding="0" cellspacing="0">
  266. <out:choose>
  267. <out:when test="@alias='task2'">
  268. <out:attribute name="style">
  269. <out:text>width:100%;</out:text>
  270. </out:attribute>
  271. </out:when>
  272. <out:otherwise>
  273. <out:attribute name="style">
  274. <out:text>width:100%;display:none</out:text>
  275. </out:attribute>
  276. </out:otherwise>
  277. </out:choose>
  278. <out:attribute name="id">div_taskmenu_<out:value-of select="@alias"/>
  279. </out:attribute>
  280. <tr>
  281. <!-- The content of the table -->
  282. <td style="height:100% ; width:100%">
  283. <!-- do the content for the menu -->
  284. <table role="presentation" cellpadding="0" cellspacing="0" height="100%" width="100%" style="table-layout:fixed">
  285. <tr>
  286. <td>
  287. <table width="100%" height="100%" cellpadding="0" cellspacing="0" role="menubar">
  288. <!-- Distinguish IDs of tags when different style. Used for A11Y -->
  289. <out:choose>
  290. <out:when test="@alias='task2'">
  291. <out:attribute name="id">taskContents_tableID</out:attribute>
  292. </out:when>
  293. <out:otherwise>
  294. <out:attribute name="id">taskContents</out:attribute>
  295. </out:otherwise>
  296. </out:choose>
  297. <!-- do the for the items in the menu in the order in which they are defined - doing this means we can pick them out in document order -->
  298. <out:apply-templates select="./*[local-name()='task' or local-name()='agentTask' or local-name()='wtask']"/>
  299. </table>
  300. </td>
  301. </tr>
  302. </table>
  303. </td>
  304. </tr>
  305. </table>
  306. </out:template>
  307. <out:template name="doTreeItems">
  308. <out:for-each select="/root/menu">
  309. <!-- render the menu and meta data tree-->
  310. <table border="0" cellpadding="0" cellspacing="0" role="presentation">
  311. <out:attribute name="id">div_menu_<out:value-of select="@alias"/>
  312. </out:attribute>
  313. <out:choose>
  314. <out:when test="@default and @default='true' ">
  315. <out:attribute name="style">
  316. <out:text>height:100%;width:100%;</out:text>
  317. </out:attribute>
  318. </out:when>
  319. <out:otherwise>
  320. <out:attribute name="style">
  321. <out:text>height:100%;width:100%;display:none</out:text>
  322. </out:attribute>
  323. </out:otherwise>
  324. </out:choose>
  325. <out:attribute name="id">div_menu_<out:value-of select="@alias"/>
  326. </out:attribute>
  327. <tr>
  328. <!-- The content of the table -->
  329. <td class="taskFullFill">
  330. <!--<table class="menuContent" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">-->
  331. <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" role="presentation">
  332. <!-- do the content for the menu -->
  333. <tr>
  334. <out:choose>
  335. <out:when test="/root/browserInfo/isIE='true'">
  336. <td id="meta_container" style="height:80%;" valign="top">
  337. <table role="presentation" class="treeBorder" cellpadding="0" cellspacing="0" height="100%" width="100%" style="table-layout:fixed">
  338. <out:apply-templates select="./content"/>
  339. </table>
  340. </td>
  341. </out:when>
  342. <out:otherwise>
  343. <td style="height:100%;" valign="top">
  344. <table role="presentation" class="treeBorder" cellpadding="0" cellspacing="0" height="100%" width="100%" style="table-layout:fixed">
  345. <out:apply-templates select="./content"/>
  346. </table>
  347. </td>
  348. </out:otherwise>
  349. </out:choose>
  350. </tr>
  351. <!-- do the tabs -->
  352. <tr>
  353. <td>
  354. <cp:tabset inverted="true" tabwidth="25">
  355. <cp:select>
  356. <out:value-of select="./menutab/@id"/>
  357. </cp:select>
  358. <!-- Added for Metadata tree tab's ID unique.(A11Y) -->
  359. <out:variable name="current_tab">
  360. <out:value-of select="@alias"/>
  361. </out:variable>
  362. <out:for-each select="/root/menu/menutab">
  363. <out:choose>
  364. <out:when test="position() = 1 and position() != last()">
  365. <cp:tab name="@id" position="start" var-name="true">
  366. <a href="#" tabindex="-1" onclick="{'cf=getConfigFrame(); if (cf!=null) cf.changeTabMenu(&quot;{../@alias}&quot;);'}" >
  367. <cp:label>
  368. <img id="id_{'{$current_tab}'}_{'{@tip}'}" tabindex="0" role="tab" alt="{'{@tip}'}" align="middle" border="0" src="{'{@href}'}" onmouseover="status=''; return true;"/>
  369. </cp:label>
  370. </a>
  371. </cp:tab>
  372. </out:when>
  373. <out:when test="position() = last()">
  374. <cp:tab name="@id" position="end" var-name="true">
  375. <a href="#" tabindex="-1" onclick="{'cf=getConfigFrame(); if (cf!=null) cf.changeTabMenu(&quot;{../@alias}&quot;);'}" onmouseover="status=''; return true;">
  376. <cp:label>
  377. <img id="id_{'{$current_tab}'}_{'{@tip}'}" tabindex="-1" role="tab" alt="{'{@tip}'}" align="middle" border="0" src="{'{@href}'}" onmouseover="status=''; return true;"/>
  378. </cp:label>
  379. </a>
  380. </cp:tab>
  381. </out:when>
  382. <out:otherwise>
  383. <cp:tab name="@id" var-name="true">
  384. <a href="#" tabindex="-1" onclick="{'cf=getConfigFrame(); if (cf!=null) cf.changeTabMenu(&quot;{../@alias}&quot;);'}" onmouseover="status=''; return true;">
  385. <cp:label>
  386. <img id="id_{'{$current_tab}'}_{'{@tip}'}" tabindex="-1" role="tab" alt="{'{@tip}'}" align="middle" border="0" src="{'{@href}'}" onmouseover="status=''; return true;"/>
  387. </cp:label>
  388. </a>
  389. </cp:tab>
  390. </out:otherwise>
  391. </out:choose>
  392. </out:for-each>
  393. </cp:tabset>
  394. </td>
  395. </tr>
  396. </table>
  397. </td>
  398. </tr>
  399. </table>
  400. </out:for-each>
  401. </out:template>
  402. <!-- a normal task item -->
  403. <out:template match="task">
  404. <tr id="{'{@alias}'}_topSpacer">
  405. <td colspan="4">
  406. <!-- "Alt" attribute should same with title for A11Y. -->
  407. <img style="display: block;" border="0" title="{'{./text}'}" height="3px" width="0px" alt="{'{./text}'}" src="../ags/images/spacer.gif" />
  408. </td>
  409. </tr>
  410. <tr class="task_inactive" id="{'{@alias}'}" name="{'{@alias}'}" onclick="{'{./link}'}">
  411. <out:choose>
  412. <out:when test="@alias='condition'">
  413. <out:attribute name="role">
  414. <out:text>menuitem</out:text>
  415. </out:attribute>
  416. </out:when>
  417. <out:otherwise>
  418. <out:attribute name="role">
  419. <out:text>menuitem</out:text>
  420. </out:attribute>
  421. </out:otherwise>
  422. </out:choose>
  423. <!-- we can't make style an attribute value template - we only want it if we're making a hidden element initially -->
  424. <out:choose>
  425. <out:when test="./style='hidden'">
  426. <out:attribute name="style">
  427. <out:text>display:none; cursor:hand;</out:text>
  428. </out:attribute>
  429. </out:when>
  430. <out:otherwise>
  431. <out:attribute name="style">
  432. <out:text>cursor:hand;</out:text>
  433. </out:attribute>
  434. </out:otherwise>
  435. </out:choose>
  436. <td>
  437. <!-- "Alt" attribute should same with title for A11Y. -->
  438. <img border="0" title="{'{./text}'}" height="16px" width="3px" alt="{'{./text}'}" src="../ags/images/spacer.gif" />
  439. </td>
  440. <!-- Background style will not work in the High Contrast mode. The only fixing way is putting background img into a <img> tag. -->
  441. <td width="16px" valign="middle" align="center" title="{'{./text}'}" style="cursor:hand;">
  442. <img id= "{concat('{@alias}', '_img')}" alt="" src="{'{./icon}'}" width="16px"/>
  443. </td>
  444. <td>
  445. <img border="0" title="{'{./text}'}" height="16px" width="3px" alt="{'{./text}'}" src="../ags/images/spacer.gif" />
  446. </td>
  447. <td title="{'{./text}'}" align="justify" width="100%">
  448. <out:value-of select="./text"/>
  449. </td>
  450. </tr>
  451. <out:if test="./style='hidden'">
  452. <tr id="{'{@alias}'}_spacer" style="display:none;cursor:hand;">
  453. <td colspan="4">
  454. <img style="display: block;" border="0" title="{'{./text}'}" height="3px" width="0px" alt="{'{./text}'}" src="../ags/images/spacer.gif" />
  455. </td>
  456. </tr>
  457. </out:if>
  458. </out:template>
  459. <!-- a task which is really a cp flyout -->
  460. <out:template match="agentTask">
  461. <out:variable select="string(/root/http/param[@name=&apos;SCRIPT_NAME&apos;])" name="gateway"/>
  462. <out:variable select="key(&apos;system-param&apos;, &apos;app&apos;)" name="app"/>
  463. <out:variable name="back-url">
  464. <out:value-of select="$gateway"/>?b_action=xts.run&amp;m=<out:value-of select="key(&apos;env-param&apos;,&apos;m&apos;)"/>
  465. </out:variable>
  466. <out:variable name="encoded-back-url">
  467. <out:value-of select="xtsext:protect(xtsext:urlencode(string($back-url)),'url','url','getdata')"/>
  468. </out:variable>
  469. <out:variable name="containerName" select="@alias"/>
  470. <tr>
  471. <td colspan="4">
  472. <img style="display: block;" border="0" height="3px" width="0px" alt="" src="../ags/images/spacer.gif" />
  473. </td>
  474. </tr>
  475. <tr title="{'{./text}'}" class="task_inactive" id="{'{$containerName}'}" name="{'{$containerName}'}" app="{'{$app}'}" url="{'{$back-url}'}">
  476. <td>
  477. <img border="0" height="16px" width="3px" alt="" src="../ags/images/spacer.gif" />
  478. </td>
  479. <td align="center" valign="middle" width="16px" style="cursor:hand;">
  480. <img title="{'{./text}'}" border="0" alt="{'{./text}'}" role="button" src="{'{./icon}'}" width="16px" ondragstart="return false;" onkeypress="showTaskMenu();taskArea_cancelBub(event);return false;" onmouseup="showTaskMenu();taskArea_cancelBub(event);event.returnValue=false;return false;"/>
  481. </td>
  482. <td>
  483. <img border="0" height="16px" width="3px" alt="" src="../ags/images/spacer.gif" />
  484. </td>
  485. <td align="justify" width="100%" height="0px">
  486. <table unselectable="on" border="0" cellpadding="0" cellspacing="0" role="menuitem" style="cursor:hand" aria-label="{'{$containerName}'}" tabindex="-1">
  487. <tr role="menuitem" class="task_inactive" id="{'{$containerName}'}Button">
  488. <td valign="bottom" align="right" id="taskMenuDropDownDiv" style="padding:0px;margin:0px;height:0px;"/>
  489. <td role="button" unselectable="on" onkeypress="showTaskMenu();taskArea_cancelBub(event);return false;" onmouseup="showTaskMenu();taskArea_cancelBub(event);return false;">
  490. <out:value-of select="./text"/>
  491. </td>
  492. <td>
  493. <img border="0" height="16px" width="3px" alt="" src="../ags/images/spacer.gif" />
  494. </td>
  495. <td role="button" onkeypress="showTaskMenu();taskArea_cancelBub(event);return false;" onmouseup="showTaskMenu();taskArea_cancelBub(event);return false;">
  496. <img border="0" height="16px" width="7px" alt="{'{./text}'}" src="{{$skin_images}}dropdown_arrow_narrow.gif"/>
  497. </td>
  498. </tr>
  499. </table>
  500. </td>
  501. </tr>
  502. <script language="Javascript">
  503. //Hold the menus with capablities only.
  504. var tasksMenuMap = new Object();
  505. var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', '');
  506. var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
  507. var taskMenu = new CMenu('taskMenu',menuStyle);
  508. taskMenu.setHTMLContainer(document.getElementById('taskMenuDropDownDiv'));
  509. <out:apply-templates select="atask">
  510. <out:with-param name="parent">taskMenu</out:with-param>
  511. </out:apply-templates>
  512. <out:apply-templates select="cascadedAgentTask"/>
  513. function showTaskMenu() {
  514. if (taskMenu &amp;&amp; taskMenu.isVisible()) {
  515. taskMenu.remove();
  516. } else {
  517. taskMenu.draw();
  518. taskMenu.show();
  519. if(taskMenu.get(0) != null) {
  520. taskMenu.get(0).setFocus();
  521. }
  522. if(document.body.getWndObserver) {
  523. //Notify that mouseup occured. And orginitated from here.
  524. document.body.getWndObserver().notify(taskMenu,"mouseup");
  525. }
  526. }
  527. }
  528. //prevent the event from bubbling to other elements
  529. function taskArea_cancelBub(evt)
  530. {
  531. //get the event in a cross-browser fashion
  532. evt = (evt) ? evt : ((event) ? event : null);
  533. //prevent the click from proceeding to other nodes
  534. if (typeof evt.cancelBubble != 'undefined')
  535. {
  536. evt.cancelBubble = true;
  537. }
  538. if (typeof evt.stopPropagation != 'undefined')
  539. {
  540. evt.stopPropagation();
  541. }
  542. }
  543. function getPageOffsetLeft(el) {
  544. var x=0;
  545. // Return the x coordinate of an element relative to the page.
  546. if(el != null) {
  547. x = el.offsetLeft;
  548. if (el.offsetParent != null)
  549. x += getPageOffsetLeft(el.offsetParent);
  550. }
  551. return x;
  552. }
  553. function getPageOffsetTop(el) {
  554. var y=0;
  555. // Return the y coordinate of an element relative to the page.
  556. if(el != null) {
  557. y = el.offsetTop;
  558. if (el.offsetParent != null)
  559. y += getPageOffsetTop(el.offsetParent);
  560. }
  561. return y;
  562. }
  563. function showTaskItem( id, x)
  564. {
  565. var doc = document.getElementById(id);
  566. if (doc == null) {
  567. alert("something wrong in menu");
  568. }
  569. switch(x) {
  570. case 0: doc.className='task_inactive'; break;
  571. case 1: doc.className='task_active';break;
  572. case 2: doc.className='taskItemLast'; break;
  573. case 3: doc.className='taskItemLast'; break;
  574. case 4: doc.className='taskItemCurrent'; break;
  575. case 5: doc.className='taskItemCurrent'; break;
  576. case 6: doc.className='taskItemSelected'; break;
  577. case 7: doc.className='taskItemHidden'; break;
  578. case 8: doc.className='taskItemHidden'; break;
  579. otherwise: doc.className='taskItemCurrent';
  580. }
  581. }
  582. </script>
  583. </out:template>
  584. <!-- atask template -->
  585. <out:template match="atask">
  586. <out:param name="parent"/>
  587. <out:variable name="command"><out:value-of select="link"/></out:variable>
  588. <out:variable name="menuName" select="concat('item',generate-id())"/>
  589. var <out:value-of select="$menuName"/> = new CMenuItem(<out:value-of select="$parent"/>, &quot;<out:value-of select="xtsext:javascriptencode(string(./text))"/>&quot;, &quot;<out:value-of select="xtsext:javascriptencode(string(./id))"/>&quot;, &quot;<out:value-of select="xtsext:javascriptencode(string($command))"/>&quot;, &quot;<out:value-of select="./icon"/>&quot;, menuItemStyle, &quot;<out:value-of select="xtsext:javascriptencode(string(./text))"/>&quot;, "", "<out:value-of select="xtsext:javascriptencode(string(userCapability))"/>");
  590. <out:if test="./userCapability">
  591. tasksMenuMap[&quot;<out:value-of select="$menuName"/>&quot;] = <out:value-of select="$menuName"/>;
  592. </out:if>
  593. </out:template>
  594. <!-- cascadedAgentTask template -->
  595. <out:template match="cascadedAgentTask">
  596. <out:variable name="command"><out:value-of select="link"/></out:variable>
  597. <out:variable name="menuName" select="concat('taskItem_',generate-id())"/>
  598. var <out:value-of select="$menuName"/> = new CMenuItem(taskMenu, &quot;<out:value-of select="xtsext:javascriptencode(string(./text))"/>&quot;, &quot;<out:value-of select="xtsext:javascriptencode(string(./id))"/>&quot;, '', '', menuItemStyle, '');
  599. var <out:value-of select="$menuName"/>_menu = <out:value-of select="$menuName"/>.createCascadedMenu(menuStyle,5);
  600. <out:apply-templates select="atask">
  601. <out:with-param name="parent"><out:value-of select="$menuName"/>_menu</out:with-param>
  602. </out:apply-templates>
  603. </out:template>
  604. <!-- in wizard task -->
  605. <out:template match="wtask">
  606. <tr class="task_inactive" name="{'{@alias}'}">
  607. <!--Distinguish IDs of tags when different style. Used for A11Y. 2014-->
  608. <out:choose>
  609. <out:when test="./style='normal'">
  610. <out:attribute name="id"><out:value-of select="@alias"/>
  611. </out:attribute>
  612. </out:when>
  613. <out:otherwise>
  614. <out:attribute name="id"><out:value-of select="@alias"/>_wtask
  615. </out:attribute>
  616. </out:otherwise>
  617. </out:choose>
  618. <td align="center" valign="middle" width="3px" cellpadding="3px">
  619. <img alt="" src="{'{./icon}'}" width="16px"/>
  620. </td>
  621. <td align="justify" width="100%">
  622. <out:value-of select="./text"/>
  623. </td>
  624. </tr>
  625. </out:template>
  626. <!-- content template -->
  627. <out:template match="content">
  628. <out:copy-of select="./*"/>
  629. <out:if test="./tr/td/div[@id='agentItemsTreeContainer']">
  630. <out:apply-templates select="/root/context"></out:apply-templates>
  631. </out:if>
  632. </out:template>
  633. </xsl:template>
  634. <!--
  635. * - This next template is required to copy all other elements into the result.
  636. -->
  637. <xsl:template match="*">
  638. <xsl:copy>
  639. <xsl:copy-of select="@*"/>
  640. <xsl:apply-templates/>
  641. </xsl:copy>
  642. </xsl:template>
  643. </xsl:stylesheet>