<?xml version="1.0" encoding="UTF-8"?>
<!--     LANSA for the Web                   -->
<xsl:transform version="1.0" exclude-result-prefixes="lxml wd tsml"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:lxml="http://www.lansa.com/2002/XML/Runtime-Data"
               xmlns:wd="http://www.lansa.com/2002/XSL/Weblet-Design"
               xmlns:tsml="http://www.lansa.com/2002/XML/Generation-Metadata"
               xmlns="http://www.w3.org/1999/xhtml">
   <xsl:import href="std_types.xsl" />
   <xsl:import href="std_keys.xsl" />
   <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8"
               indent="no" />
   <wd:definition>
      <wd:group name="Custom Weblets" />
   </wd:definition>
   <wd:template name="iii_toolbar_menuitem">
      <wd:description icon="icons/userdefn.ico">
         <wd:name lang="ENG">iii Toolbar Menu Item</wd:name>
      </wd:description>
      <wd:param name="menu_text">
         <wd:tip lang="ENG">Menu Text to display below the image on the toolbar menu item</wd:tip>
      </wd:param>
      <wd:param name="menu_image">
         <wd:tip lang="ENG">Image to display on the toolbar menu item</wd:tip>
      </wd:param>
      <wd:param name="tooltip_text">
         <wd:tip lang="ENG">Tooltip text to display on the toolbar menu item</wd:tip>
      </wd:param>
   </wd:template>

   <xsl:template name="iii_toolbar_menuitem">
      <!-- Give your template appropriate name and type in your XSL here -->
      <!-- Used to set the Menu Text on the toolbar image -->
      <xsl:param name="menu_text" select="'Caption'" wd:type="std:mtxt_variable" />
      <!-- Used to set the image use for the toolbar Icon -->
      <xsl:param name="menu_image" select="'ZZ/Open.gif'"
                 wd:type="std:html_img_relative" />
      <!-- Used to set the ALT tage on the toolbar IMG tag -->
      <xsl:param name="tooltip_text" select="'Caption'"
                 wd:type="std:mtxt_variable" />
      <!-- Used to set the Rentry Field Name when the toolbar Icon is clicked -->
      <xsl:param name="reentryfield" select="'STDRENTRY'"
                 wd:type="std:field_name_in[wam=$on_click_wamname][webrtn=$on_click_wrname]"
                 wd:tip_id="" />
      <!-- Used to set the Rentry Field Value when the toolbar Icon is clicked-->
      <xsl:param name="reentryvalue" select="'M'" wd:tip_id="" />
      <!-- Used to set the Menu Text on the toolbar image -->
      <xsl:param name="hide_if" select="false()" wd:type="std:boolean"
                 wd:tip_id="" />
      <!-- Used to specify the WAMNAME to call when toolbar Icon is clicked -->
      <!-- It will default to the current WAM if no value is specified -->
      <xsl:param name="on_click_wamname"
                 select="/lxml:data/lxml:context/lxml:webapplication"
                 wd:type="std:wam" wd:tip="" />
      <!-- Used to specify the Webroutine to call when toolbar Icon is clicked -->
      <xsl:param name="on_click_wrname"
                 wd:type="std:webroutine[wam=$on_click_wamname]" wd:tip="" />
      <xsl:if test="not($hide_if)">
         <a href="javascript:InsertHidden(document.LANSA,'{$reentryfield}','{$reentryvalue}');HandleEvent('{$on_click_wamname}','{$on_click_wrname}');">
            <img border="0" alt="{$tooltip_text}" src="/images/{$menu_image}" />
            <br />
            <span class="iii_menuitem">
               <xsl:value-of select="$menu_text" />
            </span>
         </a>
      </xsl:if>
   </xsl:template>
</xsl:transform>
