{*<!--

+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+

-->
*}

{if $elem.type == 'text' || $elem.type == 'password' || $elem.type == 'submit' || !$elem.type}
  {if $elem.prefix}<span class="affix prefix">{$elem.prefix}</span>{/if}<input {oa_form_input_attributes elem=$elem parent=$parent} />{if $elem.suffix}<span class="affix suffix">{$elem.suffix}</span>{/if}

{elseif $elem.type == 'checkbox' || $elem.type == 'radio'}
  {if $elem.prefix}<span class="affix prefix">{$elem.prefix}</span>{/if}{$elem.html}{if $elem.suffix}<span class="affix suffix">{$elem.suffix}</span>{/if}

{elseif $elem.type == 'textarea'}
  {if $elem.prefix}<span class="affix prefix">{$elem.prefix}</span>{/if}<textarea {oa_form_input_attributes elem=$elem parent=$parent}>{$elem.value|escape}</textarea>{if $elem.suffix}<span class="affix suffix">{$elem.suffix}</span>{/if}

{elseif $elem.type == 'select'}
  {if $elem.prefix}<span class="affix prefix">{$elem.prefix}</span>{/if}<select {oa_form_input_attributes elem=$elem parent=$parent} >
  {html_options options=$elem.options selected=$elem.value}
  </select>{if $elem.suffix}<span class="affix suffix">{$elem.suffix}</span>{/if}
{elseif $elem.type == 'plugin-custom'}
    {include file=$pluginBaseDir|cat:$elem.plugin|cat:$pluginTemplateDir|cat:$elem.templateId|cat:'.html'}
{elseif $elem.type == 'script'}
    {include file=$oaTemplateDir|cat:'form/script-'|cat:$elem.name|cat:'.html'}
{elseif $elem.type == 'plugin-script'}
    {include file=$pluginBaseDir|cat:$elem.plugin|cat:$pluginTemplateDir|cat:$elem.name|cat:'.html' plugin=$elem.plugin pluginWebPath=$adminPluginWebPath|cat:'/'|cat:$elem.plugin}
{else}
  {$elem.html}
{/if}