<?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 msethod="html" indent="yes" encoding="utf-8"/>
	
	<xsl:template match="SETTINGS">
		<script type="text/javascript" src="/modules/ImageGallery/js/settings.js?{$version}.{$build}"></script>
		
		<table cellpadding="0" cellspacing="0" border="0" class="control-title-input">
			<xsl:call-template name="IMAGE-GALLERY-SETTINGS-ROW">
				<xsl:with-param name="name">categoryWidth</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="IMAGE-GALLERY-SETTINGS-ROW">
				<xsl:with-param name="name">imageWidth</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="IMAGE-GALLERY-SETTINGS-ROW">
				<xsl:with-param name="name">imageHeight</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="IMAGE-GALLERY-SETTINGS-ROW">
				<xsl:with-param name="name">previewWidth</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="IMAGE-GALLERY-SETTINGS-ROW">
				<xsl:with-param name="name">imagePerPage</xsl:with-param>
				<xsl:with-param name="maxlength">2</xsl:with-param>
			</xsl:call-template>
		</table>
		<input type="hidden" id="saveSettings" name="saveSettings" value="0"/>
	</xsl:template>

	<xsl:template name="IMAGE-GALLERY-SETTINGS-ROW">
		<xsl:param name="name"/>
		<xsl:param name="maxlength">4</xsl:param>
		
		<tr>
			<td class="title-block">
				<xsl:apply-templates select="CONTROL[@NAME=$name]" mode="label">
					<xsl:with-param name="require">true</xsl:with-param>
				</xsl:apply-templates>
			</td>
			<td class="input-block">
				<xsl:apply-templates select="CONTROL[@NAME=$name]" mode="control">
					<xsl:with-param name="maxlength" select="$maxlength"/>
					<xsl:with-param name="onchange">setSaveSettings(); self.sbApplyChangesObject.registerChange();</xsl:with-param>
					<xsl:with-param name="require">true</xsl:with-param>
					<xsl:with-param name="size">10</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>
	</xsl:template>

</xsl:stylesheet>