{if $method eq "checkbox" or $method eq "multicheckbox"}
	{* we expect to be passed a variable named data which is an assosiative array of checkbox values and the name of the option (configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0" width="350">
       	{if $layout eq 1}<tr>{/if}
        {foreach from=$data item=value key=name}
        	{if $layout neq 1}<tr>{/if}
        		<td class="formhead">
    				<input type="checkbox" name="{$optionName}[]" value="{$value.value}"{$value.check}>{$value.name}
            	</td>
            {if $layout neq 1}</tr>{/if}
           	{/foreach}
        </tr>
        {if $layout eq 1}</tr>{/if}
    </table>
{elseif $method eq "text"}
    {* we expect to be passed a variable named data which is an array containing the value and the size textbox (named configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0" width="350">
       	<tr>
       		<td class="formhead">
    			<input type="text" name="{$optionName}[]" value="{$data.value|escape:"html"}" maxlength="{$data.size}" class="formtext"{if $data.width} style="width: {$data.width}px;"{/if}>
           	</td>
        </tr>
    </table>
{elseif $method eq "select"}
    {* we expect to be passed a variable named data which is an array of select option and the name of the option (configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0" width="350">
       		{foreach from=$data item=selectbox}
        	<tr>
        		<td class="formhead">
                	<select name="{$optionName}[]" size="1" class="formselect">
                	{foreach from=$selectbox.value item=selectOption}
    					<option value="{$selectOption[0]}"{if $selectOption[0] eq $selectbox.active} selected{/if}>{$selectOption[1]}</option>
                    {/foreach}
                    </select>{$selectbox.name}
            	</td>
            </tr>
           	{/foreach}
        </tr>
    </table>
{elseif $method eq "radio"}
    {* we expect to be passed a variable named data which is an assosiative array of checkbox values and the name of the option (configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0" width="350">
       	{foreach from=$data item=value key=name}
        	<tr>
        		<td class="formhead">
    				<input type="radio" name="{$optionName}[]" value="{$value.value}"{$value.check}>{$value.name}
            	</td>
            </tr>
           	{/foreach}
        </tr>
    </table>
{elseif $method eq "textarea"}
    {* we expect to be passed a variable named data which is an array containing the value and the size textbox (named configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0">
       	<tr>
       		<td class="formhead">
    			<textarea name="{$optionName}" maxlength="{$data.size}" class="formtextarea"{if $data.width or $data.height} style="{if $data.width}width: {$data.width}px;{/if} {if $data.height}height: {$data.height}px;{/if}"{/if}>{$data.value}</textarea>
           	</td>
        </tr>
    </table>
{elseif $method eq "file"}
    {* we expect to be passed a variable named data which is an array containing the value and the size textbox (named configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0">
       	<tr>
       		<td class="formhead">
    			<input type="file" enctype="multipart/form-data" name="{$optionName}">
           	</td>
            <td class="formhead">
    			{* <object type="{$data.type}" data="{$data.value}"></object> *}
           	</td>
        </tr>
    </table>
{elseif $method eq "password"}
    {* we expect to be passed a variable named data which is an array containing the value and the size textbox (named configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0">
       	<tr>
       		<td class="formhead">
    			<input type="password" name="{$optionName}[]" value="" maxlength="{$data.size}" class="formtext">
           	</td>
        </tr>
    </table>
{elseif $method eq "date"}
    {* we expect to be passed a unix timestamp named data which is an array containing the value and the size textbox (named configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0">
       	<tr>
	  <td class="formhead">
	    {mgw_html_select_date prefix="$optionName" start_year=$data.start end_year=$data.end time=$data.value}
	    {datepick form="form1" field="`$optionName`Year,`$optionName`Month,`$optionName`Day"}
	  </td>
        </tr>
    </table>
{else}
    {* we expect to be passed a variable named data which is an array containing the value and the size textbox (named configtagname) *} 
    <table border="0" cellpadding="0" cellspacing="0" width="350">
       	<tr>
       		<td class="formhead">
    			<input type="text" name="{$optionName}[]" value="{$data.value}" maxlength="{$data.size}" class="formtext">
           	</td>
        </tr>
    </table>
{/if} 

