You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postfixadmin/templates/editform.tpl

74 lines
2.4 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}
{if $field.type == 'enma'}
{$struct.{$key}.options.{$value_{$key}}}
{else}
{$value_{$key}}
{/if}
{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="value[{$key}]"{if {$value_{$key}} == 1} checked="checked"{/if}/>
{elseif $field.type == 'enum'}
<select class="flat" name="value[{$key}]">
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
</select>
{elseif $field.type == 'enma'}
<select class="flat" name="value[{$key}]">
{html_options options=$struct.{$key}.options selected=$value_{$key}}
</select>
{elseif $field.type == 'list'}
<select class="flat" name="value[{$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="value[{$key}]" output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key} separator="<br />"}
</div>
-->
{elseif $field.type == 'pass' || $field.type == 'b64p'}
<input class="flat" type="password" name="value[{$key}]" />
AliasHandler now works with edit.php in many cases (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
13 years ago
{elseif $field.type == 'txtl'}
<textarea class="flat" rows="10" cols="35" name="value[{$key}]">{foreach key=key2 item=field2 from=$value_{$key}}{$field2}
AliasHandler now works with edit.php in many cases (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
13 years ago
{/foreach}</textarea>
{else}
<input class="flat" type="text" name="value[{$key}]" value="{$value_{$key}}" />
{/if}
{/if}
</td>
<td>{$field.desc}</td>
<td class="error_msg">{$fielderror.{$key}}</td>
</tr>
{/if}
{/if}
{/foreach}
<tr>
<td>&nbsp;</td>
<td colspan="3"><input class="button" type="submit" name="submit" value="{$submitbutton}" /></td>
</tr>
</table>
</form>
</div>