mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-20 03:36:20 +02:00
d39a802d00
(TODO: catchall handling, mailbox and vacation aliases) AliasHandler.php - drop unused $username - set $domain_field - initStruct(): - use correct labels - set 'domain' field options to allowed domains - add (virtual) 'localpart' field - add comments for more virtual fields - add webformConfig() (note: modifies $struct on $new - otherwise we couldn't use the domain dropdown in the web interface) - add mergeId to merge localpart and domain to address (called by edit.php _before_ ->init) - add validate_new_id() (doesn't work for catchall yet) - add setmore() to - fill 'domain' based on 'address' - convert $values[goto] from array to comma-separated string - add read_from_db_postprocess to split goto to an array (TODO: handling of mailbox and vacation aliases) - add _field_goto() validator - add empty, commented dummy delete() that will replace the "old" delete function one day - make hasAliasRecord() private (only used internally) - mark all "old" functions as obsolete edit.php: - add handling of txtl field (convert textarea to array) - call $handler->mergeId if $id_field is editable, but not displayed in form (usecase: merge localpart + domain to address) editform.tpl: - add handling of txtl fields (textarea, filled by array) PFAHandler.php: - add setmore() hook function - runs at the end of set() AdminHandler.php: - add a comment for 'txtl' (array of one line texts, like alias goto) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1311 a1433add-5e2c-0410-b055-b7f2511e0802
66 lines
2.1 KiB
Smarty
66 lines
2.1 KiB
Smarty
<div id="edit_form">
|
|
<form name="edit_{$table}" method="post" action="">
|
|
<input class="flat" type="hidden" name="table" value="{$table}" />
|
|
|
|
<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}
|
|
{$value_{$key}}
|
|
{else}
|
|
{if $table == 'foo' && $key == 'bar'}
|
|
Special handling (td content) for {$table} / {$key}
|
|
{elseif $field.type == 'bool'}
|
|
<input class="flat" type="checkbox" value='1' name="{$key}"{if {$value_{$key}} == 1} checked="checked"{/if}/>
|
|
{elseif $field.type == 'enum'}
|
|
<select class="flat" name="{$key}">
|
|
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
|
|
</select>
|
|
{elseif $field.type == 'list'}
|
|
<select class="flat" name="{$key}[]" size="10" multiple="multiple">
|
|
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
|
|
</select>
|
|
|
|
<!-- alternative:
|
|
<div style='max-height:30em; overflow:auto;'>
|
|
{html_checkboxes name={$key} output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key} separator="<br />"}
|
|
</div>
|
|
-->
|
|
{elseif $field.type == 'pass'}
|
|
<input class="flat" type="password" name="{$key}" />
|
|
{elseif $field.type == 'txtl'}
|
|
<textarea class="flat" rows="10" cols="35" name="{$key}">{foreach key=key2 item=field2 from=$value_{$key}}{$field2}
|
|
{/foreach}</textarea>
|
|
{else}
|
|
<input class="flat" type="text" name="{$key}" value="{$value_{$key}}" />
|
|
{/if}
|
|
{/if}
|
|
</td>
|
|
<td>{$field.desc}</td>
|
|
<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>
|