/framework/core/db/templates/dbzone/edit.tpl
http://zoop.googlecode.com/ · Smarty Template · 27 lines · 27 code · 0 blank · 0 comment · 2 complexity · c6f5aeb54e20f3de1852f7b22ff41ed8 MD5 · raw file
- <form method="post" name="main_form" action="{$virtualUrl}">
- <table>
- {assign var=primaryKey value=$object->getPrimaryKey()}
- {foreach from=$object key=fieldName item=fieldValue}
- <tr>
- <td>{$fieldName}:</td>
- {if $object->primaryKeyAssignedByDb() && in_array($fieldName, $primaryKey)}
- <td>{$fieldValue|default:"<self-assigned>"}</td>
- {else}
- {if isset($fieldInfo[$fieldName].type)}
- {if $fieldInfo[$fieldName].type == 'textarea'}
- <td><textarea name="fields[{$fieldName}]" rows="4" cols="50">{$fieldValue}</textarea></td>
- {else}
- <td><input type="text" name="fields[{$fieldName}]" value="{$fieldValue}"></td>
- {/if}
- {elseif $object->getFieldOptions($fieldName)}
- {assign var=relationship value=$object->getFieldOptions($fieldName)}
- <td>{html_options name="fields[$fieldName]" selected=$fieldValue options=$relationship->getOptions()}</td>
- {else}
- <td><input type="text" name="fields[{$fieldName}]" value="{$fieldValue}"></td>
- {/if}
- {/if}
- </tr>
- {/foreach}
- </table>
- <input type="submit" name="save" value="save">
- </form>