<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->

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


    <xsl:template name="uiSelectAllDropdown">
        <xsl:param name="id" />
        <xsl:param name="disabled" />
        <xsl:param name="className" />

        <xsl:variable name="checkAllDropdownItems">
            <map>
                <mapEntry>
                    <name>All</name>
                    <value>all</value>
                    <custom>true</custom>
                </mapEntry>
                <mapEntry>
                    <name>None</name>
                    <value>none</value>
                    <custom>true</custom>
                </mapEntry>
            </map>
        </xsl:variable>

        <xsl:call-template name="uiDropdown">
            <xsl:with-param name="items" select="$checkAllDropdownItems"/>
            <xsl:with-param name="className">
                <xsl:text>SelectAllDropdown</xsl:text>
                <xsl:if test="$className">
                    <xsl:text> </xsl:text><xsl:value-of select="$className" />
                </xsl:if>
            </xsl:with-param>
            <xsl:with-param name="renderIndependent" select="'true'"/>
            <xsl:with-param name="align" select="'left'"/>
            <xsl:with-param name="id" select="$id"/>
            <xsl:with-param name="name" select="$id"/>
            <xsl:with-param name="captionNode">
                <xsl:call-template name="uiCheckbox">
                    <xsl:with-param name="className" select="'SelectAllDropdown-checkbox'" />
                    <xsl:with-param name="id">
                        <xsl:value-of select="$id" />-checkbox
                    </xsl:with-param>
                    <xsl:with-param name="name">
                        <xsl:value-of select="$id" />-checkbox
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:with-param>

            <xsl:with-param name="disabled" select="$disabled" />
        </xsl:call-template>
    </xsl:template>

</xsl:stylesheet>
