<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:strip-space elements="*"/>
	<xsl:output method="html" indent="yes" encoding="utf-8"/>
	
	<xsl:template match="CATEGORY-FORM">
	</xsl:template>
	
	<xsl:template match="CATEGORY-FORM" mode="initAfterBody">
		<!--<script type="text/javascript" src="/modules/ImageGallery/js/categories.js?{$version}.{$build}"></script>-->
		<xsl:call-template name="MODAL-FORM">
			<xsl:with-param name="formName">modalForm</xsl:with-param>
			<xsl:with-param name="formTitle" select="/SITEBUILDER-PAGE/LOCALE/FORM-TITLE"/>
			<!--<xsl:with-param name="helpHint" select="/SITEBUILDER-PAGE/LOCALE/HELP-HINT"/>-->
			<!--<xsl:with-param name="closeHint" select="@CLOSE-HINT"/>-->
			<xsl:with-param name="additionalFormStyle">width: 650px; height: 420px;</xsl:with-param>
			<xsl:with-param name="content" select="current()"/>
			<xsl:with-param name="onCloseAction">sbNavigationObject.go();</xsl:with-param>
		</xsl:call-template>
	</xsl:template>	
		
	<xsl:template match="MAIN-CARD">
		<table cellspacing="0" cellpadding="5" border="0" style="border-width:0px;width:100%;">
			<tr>
				<td><xsl:value-of select="CURRENT-CATEGORY-IMAGE/@TITLE"/>&#160;<span class="sb-asterix">*</span></td>
				<td>
					<input type="text" name="name" id="name" class="sb-control-input-input" maxlength="50">
						<xsl:attribute name="value">
							<xsl:value-of select="CURRENT-CATEGORY-IMAGE/@VALUE"/>
						</xsl:attribute>
					</input>	
				</td>
			</tr>
			<tr>
				<td> <xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/CURRENT-IMAGE-TITLE"/> </td>
				<td>
					<xsl:choose>
						<xsl:when test="CURRENT-CATEGORY-IMAGE/@IMAGE-FILE-PATH!=''">
							<img border="0">
								<xsl:attribute name="src"><xsl:value-of select="CURRENT-CATEGORY-IMAGE/@IMAGE-URL"/></xsl:attribute>
								<xsl:attribute name="width"><xsl:value-of select="CURRENT-CATEGORY-IMAGE/@WIDTH"/></xsl:attribute>
								<xsl:attribute name="height"><xsl:value-of select="CURRENT-CATEGORY-IMAGE/@HEIGHT"/></xsl:attribute>
							</img>
						</xsl:when>
						<xsl:otherwise>
							<xsl:call-template name="NO-IMAGE" />
						</xsl:otherwise>
					</xsl:choose>
					<input type="hidden" name="image">
						<xsl:attribute name="value"><xsl:value-of select="CURRENT-CATEGORY-IMAGE/@IMAGE-FILE-PATH"/></xsl:attribute>
					</input>
				</td>
			</tr>
			<tr>
				<td><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/NEW-IMAGE"/></td>
				<td>
					<table cellspacing="0" cellpadding="0" border="0">
					<tr>
						<td>
							<input type="file" name="image" size="40" style="border-color:#999EA1;border-width:1px;border-style:Solid;" />
						</td>	
						<td style="padding-left:5px;">
							<xsl:call-template name="BUTTON-CONTROL">
								<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/UPLOAD"/></xsl:with-param>
								<xsl:with-param name="action">setWizardFormAction("<xsl:value-of select="/SITEBUILDER-PAGE/VIEW-CONTENT/@ACTION"/>/Modules/ImageGallery/Category/Image/Upload");wizardFormSubmit();</xsl:with-param>
							</xsl:call-template>
						</td>
						<td style="padding-left:5px;">
							<xsl:if test="CURRENT-CATEGORY-IMAGE/@IMAGE-FILE-PATH!=''">
								<xsl:call-template name="BUTTON-CONTROL">
									<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/DELETE"/></xsl:with-param>
									<xsl:with-param name="action">setWizardFormAction("<xsl:value-of select="/SITEBUILDER-PAGE/VIEW-CONTENT/@ACTION"/>/Modules/ImageGallery/Category/Image/Delete");wizardFormSubmit();</xsl:with-param>
									<xsl:with-param name="icon">delete.png</xsl:with-param>
								</xsl:call-template>
							</xsl:if>
						</td>
					</tr>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>	
	
	<xsl:template match="DESCRIPTION-CARD">
		<table width="100%" border="0">
			<tr>
				<td>
					<xsl:apply-templates select="WYSIWYG" />
				</td>
			</tr>
		</table>
	</xsl:template>	
	
	<xsl:template name="NO-IMAGE">
		<table style="width: 102px; height: 70px; background-color: #A4A4A4;">
			<tr>
				<td valign="middle" align="center">
					<span style="vertical-align: middle; color: #FFFFFF;"><b><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/NO-IMAGE"/></b></span>
				</td>
			</tr>
		</table>
	</xsl:template>	
	
	<xsl:template match="POSITION">
		<option >
			<xsl:attribute name="value"><xsl:value-of select="@VALUE"/></xsl:attribute>
			<xsl:if test="@SELECTED=1">
				<xsl:attribute name="selected">true</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="@VALUE"/>
		</option>
	</xsl:template>	
	
</xsl:stylesheet>