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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <div id="edit_form">
  2. <form name="edit_{$table}" method="post" action="">
  3. <input class="flat" type="hidden" name="table" value="{$table}" />
  4. <input class="flat" type="hidden" name="token" value="{$smarty.session.PFA_token|escape:"url"}" />
  5. <table>
  6. <tr>
  7. <th colspan="4">{$formtitle}</th>
  8. </tr>
  9. {foreach key=key item=field from=$struct}
  10. {if $field.display_in_form == 1}
  11. {if $table == 'foo' && $key == 'bar'}
  12. <tr><td>Special handling (complete table row) for {$table} / {$key}</td></tr>
  13. {else}
  14. <tr>
  15. <td class="label">{$field.label}</td>
  16. <td>
  17. {if $field.editable == 0}
  18. {if $field.type == 'enma'}
  19. {$struct.{$key}.options.{$value_{$key}}}
  20. {else}
  21. {$value_{$key}}
  22. {/if}
  23. {else}
  24. {if $table == 'foo' && $key == 'bar'}
  25. Special handling (td content) for {$table} / {$key}
  26. {elseif $field.type == 'bool'}
  27. <input class="flat" type="checkbox" value='1' name="value[{$key}]"{if {$value_{$key}} == 1} checked="checked"{/if}/>
  28. {elseif $field.type == 'enum'}
  29. <select class="flat" name="value[{$key}]">
  30. {html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
  31. </select>
  32. {elseif $field.type == 'enma'}
  33. <select class="flat" name="value[{$key}]">
  34. {html_options options=$struct.{$key}.options selected=$value_{$key}}
  35. </select>
  36. {elseif $field.type == 'list'}
  37. <select class="flat" name="value[{$key}][]" size="10" multiple="multiple">
  38. {html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
  39. </select>
  40. <!-- alternative:
  41. <div style='max-height:30em; overflow:auto;'>
  42. {html_checkboxes name="value[{$key}]" output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key} separator="<br />"}
  43. </div>
  44. -->
  45. {elseif $field.type == 'pass' || $field.type == 'b64p'}
  46. <input class="flat" type="password" name="value[{$key}]" />
  47. {elseif $field.type == 'txtl'}
  48. <textarea class="flat" rows="10" cols="35" name="value[{$key}]">{foreach key=key2 item=field2 from=$value_{$key}}{$field2}
  49. {/foreach}</textarea>
  50. {else}
  51. <input class="flat" type="text" name="value[{$key}]" value="{$value_{$key}}" />
  52. {/if}
  53. {/if}
  54. </td>
  55. <td>
  56. {if $table == 'foo' && $key == 'bar'}
  57. Special handling (td content) for {$table} / {$key}
  58. {else}
  59. {$field.desc}
  60. {/if}
  61. </td>
  62. <td class="error_msg">{$fielderror.{$key}}</td>
  63. </tr>
  64. {/if}
  65. {/if}
  66. {/foreach}
  67. <tr>
  68. <td>&nbsp;</td>
  69. <td colspan="3"><input class="button" type="submit" name="submit" value="{$submitbutton}" /></td>
  70. </tr>
  71. </table>
  72. </form>
  73. </div>