2011-10-30 21:27:08 +01:00
|
|
|
<div id="edit_form">
|
|
|
|
<form name="edit_{$table}" method="post" action="">
|
2011-11-13 23:34:40 +01:00
|
|
|
<input class="flat" type="hidden" name="table" value="{$table}" />
|
2016-05-20 22:42:04 +02:00
|
|
|
<input class="flat" type="hidden" name="token" value="{$smarty.session.PFA_token|escape:"url"}" />
|
2011-10-30 21:27:08 +01:00
|
|
|
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th colspan="4">{$formtitle}</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
{foreach key=key item=field from=$struct}
|
|
|
|
{if $field.display_in_form == 1}
|
|
|
|
|
|
|
|
{if $table == 'foo' && $key == 'bar'}
|
|
|
|
<tr><td>Special handling (complete table row) for {$table} / {$key}</td></tr>
|
|
|
|
{else}
|
|
|
|
<tr>
|
|
|
|
<td class="label">{$field.label}</td>
|
|
|
|
<td>
|
|
|
|
{if $field.editable == 0}
|
2014-11-01 22:26:27 +01:00
|
|
|
{if $field.type == 'enma'}
|
|
|
|
{$struct.{$key}.options.{$value_{$key}}}
|
|
|
|
{else}
|
|
|
|
{$value_{$key}}
|
|
|
|
{/if}
|
2011-10-30 21:27:08 +01:00
|
|
|
{else}
|
|
|
|
{if $table == 'foo' && $key == 'bar'}
|
|
|
|
Special handling (td content) for {$table} / {$key}
|
|
|
|
{elseif $field.type == 'bool'}
|
2014-01-21 19:24:25 +01:00
|
|
|
<input class="flat" type="checkbox" value='1' name="value[{$key}]"{if {$value_{$key}} == 1} checked="checked"{/if}/>
|
2011-10-30 21:27:08 +01:00
|
|
|
{elseif $field.type == 'enum'}
|
2014-01-21 19:24:25 +01:00
|
|
|
<select class="flat" name="value[{$key}]">
|
2011-11-28 01:11:03 +01:00
|
|
|
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
|
2011-10-31 22:45:00 +01:00
|
|
|
</select>
|
2014-11-01 22:22:30 +01:00
|
|
|
{elseif $field.type == 'enma'}
|
|
|
|
<select class="flat" name="value[{$key}]">
|
|
|
|
{html_options options=$struct.{$key}.options selected=$value_{$key}}
|
|
|
|
</select>
|
2011-11-28 01:11:03 +01:00
|
|
|
{elseif $field.type == 'list'}
|
2014-01-21 19:24:25 +01:00
|
|
|
<select class="flat" name="value[{$key}][]" size="10" multiple="multiple">
|
2011-11-28 01:11:03 +01:00
|
|
|
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- alternative:
|
|
|
|
<div style='max-height:30em; overflow:auto;'>
|
2014-01-21 19:24:25 +01:00
|
|
|
{html_checkboxes name="value[{$key}]" output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key} separator="<br />"}
|
2011-11-28 01:11:03 +01:00
|
|
|
</div>
|
|
|
|
-->
|
2015-03-17 22:19:36 +01:00
|
|
|
{elseif $field.type == 'pass' || $field.type == 'b64p'}
|
2014-01-21 19:24:25 +01:00
|
|
|
<input class="flat" type="password" name="value[{$key}]" />
|
2011-12-27 19:13:32 +01:00
|
|
|
{elseif $field.type == 'txtl'}
|
2014-01-21 19:24:25 +01:00
|
|
|
<textarea class="flat" rows="10" cols="35" name="value[{$key}]">{foreach key=key2 item=field2 from=$value_{$key}}{$field2}
|
2011-12-27 19:13:32 +01:00
|
|
|
{/foreach}</textarea>
|
2011-10-30 21:27:08 +01:00
|
|
|
{else}
|
2014-01-21 19:24:25 +01:00
|
|
|
<input class="flat" type="text" name="value[{$key}]" value="{$value_{$key}}" />
|
2011-10-30 21:27:08 +01:00
|
|
|
{/if}
|
|
|
|
{/if}
|
|
|
|
</td>
|
2016-03-11 22:19:14 +01:00
|
|
|
<td>
|
|
|
|
{if $table == 'foo' && $key == 'bar'}
|
|
|
|
Special handling (td content) for {$table} / {$key}
|
|
|
|
{else}
|
|
|
|
{$field.desc}
|
|
|
|
{/if}
|
|
|
|
</td>
|
2011-10-30 21:27:08 +01:00
|
|
|
<td class="error_msg">{$fielderror.{$key}}</td>
|
|
|
|
</tr>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
{/if}
|
|
|
|
{/foreach}
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td> </td>
|
|
|
|
<td colspan="3"><input class="button" type="submit" name="submit" value="{$submitbutton}" /></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</div>
|