{extends file=$element.methods->getTemplatePath('general')}

{block name=input append}
	
	{* INTERVAL START ************************************************************************** *}
	<div>
		<select name="{$element.name}[start][reference]">
			{foreach $element['dateReferences'] as $ref}
				<option value="{$ref}"
					{if $element['value']['start']['reference']==$ref}selected="1"{/if}
				>{$_LANG['formField']['inputs']['DateIntervalSmart']['reference'][$ref]}</option>
			{/foreach}
		</select>
		
		<select name="{$element.name}[start][operation]">
			<option value="plus"
				{if $element['value']['start']['operation']=='plus'}selected="1"{/if}
			>+</option>
			<option value="minus"
				{if $element['value']['start']['operation']=='minus'}selected="1"{/if}
			>-</option>
		</select>
		
		<input type="text" name="{$element.name}[start][amount]" value="{$element['value']['start']['amount']}" style="width:40px;" />
		
		<select name="{$element.name}[start][unit]">
			<option value="days"
				{if $element['value']['start']['unit']=='days'}selected="1"{/if}
			>{$_LANG['timeUnitName']['days']}</option>
			<option value="weeks"
				{if $element['value']['start']['unit']=='weeks'}selected="1"{/if}
			>{$_LANG['timeUnitName']['weeks']}</option>
			<option value="months"
				{if $element['value']['start']['unit']=='months'}selected="1"{/if}
			>{$_LANG['timeUnitName']['months']}</option>
			<option value="years"
				{if $element['value']['start']['unit']=='years'}selected="1"{/if}
			>{$_LANG['timeUnitName']['years']}</option>
		</select>
		[{$_LANG['formField']['inputs']['DateIntervalSmart']['direction']['start']}]
	</div>
	
	{* separator *}
	<div style="height:3px;"></div>
	
	{* INTERVAL END **************************************************************************** *}
	<div>
		<select name="{$element.name}[end][reference]">
			{foreach $element['dateReferences'] as $ref}
				<option value="{$ref}"
					{if $element['value']['end']['reference']==$ref}selected="1"{/if}
				>{$_LANG['formField']['inputs']['DateIntervalSmart']['reference'][$ref]}</option>
			{/foreach}
		</select>
		
		<select name="{$element.name}[end][operation]">
			<option value="plus"
				{if $element['value']['end']['operation']=='plus'}selected="1"{/if}
			>+</option>
			<option value="minus"
				{if $element['value']['end']['operation']=='minus'}selected="1"{/if}
			>-</option>
		</select>
		
		<input type="text" name="{$element.name}[end][amount]" value="{$element['value']['end']['amount']}" style="width:40px;" />
		
		<select name="{$element.name}[end][unit]">
			<option value="days"
				{if $element['value']['end']['unit']=='days'}selected="1"{/if}
			>{$_LANG['timeUnitName']['days']}</option>
			<option value="weeks"
				{if $element['value']['end']['unit']=='weeks'}selected="1"{/if}
			>{$_LANG['timeUnitName']['weeks']}</option>
			<option value="months"
				{if $element['value']['end']['unit']=='months'}selected="1"{/if}
			>{$_LANG['timeUnitName']['months']}</option>
			<option value="years"
				{if $element['value']['end']['unit']=='years'}selected="1"{/if}
			>{$_LANG['timeUnitName']['years']}</option>
		</select>
		[{$_LANG['formField']['inputs']['DateIntervalSmart']['direction']['end']}]
	</div>	
	
{/block}