Skip to content

Instantly share code, notes, and snippets.

@firstred
Created July 1, 2016 07:17
Show Gist options
  • Save firstred/b5016aab980ade678d741691e5b15c5b to your computer and use it in GitHub Desktop.
Save firstred/b5016aab980ade678d741691e5b15c5b to your computer and use it in GitHub Desktop.
Form.tpl 1.5 backwards compatibility
{extends file="helpers/form/form.tpl"}
{block name="input"}
{if $input.type == 'switch' && $smarty.const._PS_VERSION_|@addcslashes:'\'' < '1.6'}
{foreach $input.values as $value}
<input type="radio" name="{$input.name|escape:'htmlall':'UTF-8'}"
id="{$input.name|escape:'htmlall':'UTF-8'}_{$value.id|escape:'htmlall':'UTF-8'}"
value="{$value.value|escape:'htmlall':'UTF-8'}"
{if $fields_value[$input.name] == $value.value}checked="checked"{/if}
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
<label class="t" for="{$input.name|escape:'htmlall':'UTF-8'}_{$value.id|escape:'htmlall':'UTF-8'}">
{if isset($input.is_bool) && $input.is_bool == true}
{if $value.value == 1}
<img src="../img/admin/enabled.gif" alt="{$value.label|escape:'htmlall':'UTF-8'}"
title="{$value.label|escape:'htmlall':'UTF-8'}" />
{else}
<img src="../img/admin/disabled.gif" alt="{$value.label|escape:'htmlall':'UTF-8'}"
title="{$value.label|escape:'htmlall':'UTF-8'}" />
{/if}
{else}
{$value.label|escape:'htmlall':'UTF-8'}
{/if}
</label>
{if isset($input.br) && $input.br}<br />{/if}
{if isset($value.p) && $value.p}<p>{$value.p|escape:'htmlall':'UTF-8'}</p>{/if}
{/foreach}
{else}
{$smarty.block.parent}
{/if}
{/block}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment