<input type="hidden" name="server_module_test" value="{$server.module}"/>
{assign var="cid_n" value="0"}
{foreach from=$server.configuration item="conf" key="name" name="for"}
    {assign var="cid" value="fi$cid_n"}
    {assign var="cid_n" value=$cid_n+1}
    <div class="form-group">
        <label for="{$cid}" class="col-sm-3 control-label">{$MGLANG->T('friendly_name',$conf.friendlyName)}</label>
        <div class="col-sm-9">
        {if !isset($conf.type)}
            <input type="text" class="form-control" id="{$cid}" name="conf[{$name}]" {if isset($conf.value)}value="{$conf.value|htmlspecialchars}"{/if} title="{$conf.help}" {if $conf.placeholder}placeholder="{$conf.placeholder}"{/if} {foreach from=$conf.validators key="k" item="v"}{$k}="{$v|htmlspecialchars}"{/foreach}/>
        {elseif $conf.type eq 'text' || $conf.type eq 'password' || $conf.type eq 'number' || $conf.type eq 'email'}
            <input type="{$conf.type}" class="form-control" id="{$cid}" name="conf[{$name}]" {if isset($conf.value)}value="{$conf.value|htmlspecialchars}"{/if} title="{$conf.help}" {if $conf.placeholder}placeholder="{$conf.placeholder}"{/if} {foreach from=$conf.validators key="k" item="v"}{$k}="{$v|htmlspecialchars}"{/foreach}/>
        {elseif $conf.type eq 'textarea'}
            <textarea name="conf[{$name}]" class="form-control" id="{$cid}" title="{$conf.help}" {if $conf.placeholder}placeholder="{$conf.placeholder}"{/if} {foreach from=$conf.validators key="k" item="v"}{$k}="{$v|htmlspecialchars}"{/foreach}>{if isset($conf.value)}{$conf.value|htmlspecialchars}{/if}</textarea>
        {elseif $conf.type eq 'yesno'}
            <div class="checkbox mg-tooltip-custom">
                <input type="checkbox" id="{$cid}" name="conf[{$name}]" {if isset($conf.value) && $conf.value eq 'on'}checked=""{/if}/>
            </div>
            {if $conf.help}<span class="mg-tooltip-custom option-helper"><i class="fa fa-question-circle" title="{$conf.help}"></i></span>{/if}
        {elseif $conf.type eq 'select'}
            <select name="conf[{$name}]" class="select2" id="{$cid}" title="{$conf.help}">
                {foreach from=$conf.options item="option_label" key="option_value"}
                    <option value="{$option_value}" {if isset($conf.value) && $option_value eq $conf.value}selected=""{/if}>{$option_label}</option>
                {foreachelse}
                    <option>{$MGLANG->T('no_options_available')}</option>
                {/foreach}
            </select>
        {/if}
        </div>
    </div>
{/foreach}
