PageRenderTime 14ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1<form method="post" name="main_form" action="{$virtualUrl}">	
 2<table>
 3	{assign var=primaryKey value=$object->getPrimaryKey()}
 4	{foreach from=$object key=fieldName item=fieldValue}
 5	<tr>
 6		<td>{$fieldName}:</td>
 7		{if $object->primaryKeyAssignedByDb() && in_array($fieldName, $primaryKey)}
 8			<td>{$fieldValue|default:"&lt;self-assigned&gt;"}</td>
 9		{else}
10			{if isset($fieldInfo[$fieldName].type)}
11				{if $fieldInfo[$fieldName].type == 'textarea'}
12					<td><textarea name="fields[{$fieldName}]" rows="4" cols="50">{$fieldValue}</textarea></td>
13				{else}
14					<td><input type="text" name="fields[{$fieldName}]" value="{$fieldValue}"></td>
15				{/if}
16			{elseif $object->getFieldOptions($fieldName)}
17				{assign var=relationship value=$object->getFieldOptions($fieldName)}
18				<td>{html_options name="fields[$fieldName]" selected=$fieldValue options=$relationship->getOptions()}</td>
19			{else}
20				<td><input type="text" name="fields[{$fieldName}]" value="{$fieldValue}"></td>
21			{/if}
22		{/if}
23	</tr>
24	{/foreach}
25</table>
26<input type="submit" name="save" value="save">
27</form>