<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet 
  version="1.0" 
  exclude-result-prefixes="x d xsl msxsl cmswrt"
  xmlns:x="http://www.w3.org/2001/XMLSchema" 
  xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 
  xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
  xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">


  <xsl:template name="Context_Menus_With_Icons" match="Row[@Style='Context_Menus_With_Icons']" mode="itemstyle">
    <xsl:param name="CurPos" />
    <xsl:param name="Last" />
    <xsl:variable name="SafeLinkUrl">
      <xsl:call-template name="OuterTemplate.GetSafeLink">
        <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="DisplayTitle">
      <xsl:call-template name="OuterTemplate.GetTitle">
        <xsl:with-param name="Title" select="@Title"/>
        <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="LinkTarget">
      <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
    </xsl:variable>
    <xsl:variable name="ContextName">
      <xsl:value-of select="@ContextScriptID"/>
    </xsl:variable>
    <xsl:variable name="ItemContentType">
      <xsl:value-of select="@ItemContentType"/>
    </xsl:variable>
    <xsl:variable name="ItemContentTypeID">
      <xsl:value-of select="@ItemContentTypeID"/>
    </xsl:variable>
    <xsl:variable name="ItemCheckedOut">
      <xsl:value-of select="@ItemCheckedOut"/>
    </xsl:variable>
    <xsl:variable name="ItemCheckedOutUserID">
      <xsl:value-of select="@ItemCheckedOutUserID"/>
    </xsl:variable>
    <xsl:variable name="ItemIndex">
      <xsl:value-of select="@ItemIndex"/>
    </xsl:variable>
    <xsl:variable name="ItemIconUrl">
      <xsl:value-of select="@ItemIconUrl"/>
    </xsl:variable>
    <xsl:variable name="ItemExtension">
      <xsl:value-of select="@ItemExtension"/>
    </xsl:variable>
    <xsl:variable name="DocumentFolder">
      <xsl:value-of select="@DocumentFolder"/>
    </xsl:variable>
    <xsl:variable name="ItemUrl">
      <xsl:value-of select="@ItemUrl"/>
    </xsl:variable>
    <xsl:variable name="EncodedItemUrl">
      <xsl:value-of select="@EncodedItemUrl"/>
    </xsl:variable>

    <xsl:variable name="DocType">
      <xsl:value-of select="@DocType"/>
    </xsl:variable>
    <xsl:variable name="CopySource">
      <xsl:value-of select="@CopySource"/>
    </xsl:variable>
    <xsl:variable name="DocEditCommand">
      <xsl:value-of select="@DocEditCommand"/>
    </xsl:variable>
    <xsl:variable name="tableStart">

      <xsl:if test="$CurPos = 1">

        <![CDATA[ 

        <table> 

            <tr> 
				<td>&nbsp;
				</td>
                <td align="left"> 

                    <b>Title</b> 

                </td> 

                <td align="left"> 

                    <b>Last Modified</b> 

                </td> 

            </tr>]]>

      </xsl:if>

    </xsl:variable>
    <xsl:variable name="tableEnd">

      <xsl:if test="$CurPos = $Last">

        <![CDATA[</table>]]>

      </xsl:if>

    </xsl:variable>
    <xsl:value-of select="$tableStart" disable-output-escaping="yes"/>
    <TR>
      <td width="16px">
        <img src="/_layouts/images/{$ItemIconUrl}" />
      </td>
      <TD>
        <table height="100%" cellspacing="0" class="ms-unselectedtitle" 
			onmouseover="OnItem(this)" 
			CTXName="{$ContextName}" 
			Id="{$ItemIndex}" 
			Url="{$ItemUrl}" 
			DRef="{$DocumentFolder}" 
			Perm="0x7fffffffffffffff" 
			Type="{$DocType}" 
			Ext="{$ItemExtension}" 
			Icon="{$ItemIconUrl}|{$DocEditCommand}" 
			OType="0" 
			COUId="{$ItemCheckedOutUserID}" 
			SRed="" 
			COut="{$ItemCheckedOut}" 
			HCD="" 
			CSrc="{$CopySource}" 
			MS="0" 
			CType="{$ItemContentType}" 
			CId="{$ItemContentTypeID}" 
			UIS="512" 
			SUrl="">
          <tr>
            <td width="100%" Class="ms-vb">
              <A onfocus="OnLink(this)" HREF="{$ItemUrl}" 
              onclick="return DispEx(this,event,'TRUE','FALSE','TRUE','SharePoint.OpenDocuments.3','0','SharePoint.OpenDocuments','','','','1','0','0','0x7fffffffffffffff')">
                <xsl:value-of select="$DisplayTitle" />
                <img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="Use SHIFT+ENTER to open the menu (new window)." />
              </A>
            </td>
            <td>
              <img src="/_layouts/images/blank.gif" width="13" style="visibility:hidden" alt="" />
            </td>
          </tr>
        </table>
      </TD>
      <TD Class="ms-vb2">
        <xsl:value-of disable-output-escaping="no" select="ddwrt:FormatDate(string(@Modified), 3081, 5)" />
      </TD>
    </TR>
    <xsl:value-of select="$tableEnd" disable-output-escaping="yes"/>
  </xsl:template>

</xsl:stylesheet>
