PageRenderTime 16ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/core/db/templates/dbzone/list.tpl

http://zoop.googlecode.com/
Smarty Template | 47 lines | 47 code | 0 blank | 0 comment | 1 complexity | bfc5259f9eb8db093ff614e06af4bc88 MD5 | raw file
 1{literal}
 2<script>
 3function submitForm(action, id)
 4{
 5	document.main_form.action.value = action;
 6	document.main_form.id.value = id;
 7	document.main_form.submit();
 8	return false;
 9}
10{/literal}
11</script>
12<form method="post" name="main_form" action="{$virtualUrl}">	
13	<table border="1">
14		<tr>
15			{foreach from=$table item=thisColumn}
16				{if $thisColumn->name <> 'filepath'}
17					<td>{$thisColumn->name}</td>
18				{/if}
19			{/foreach}
20			<td>Edit</td>
21			<td>View</td>
22			<td>Delete</td>
23		</tr>
24		{foreach from=$objects item=thisObject}
25		<tr>
26			{foreach from=$thisObject key=fieldName item=fieldValue}
27				{if $fieldName <> 'filepath'}
28					{if $fieldName == 'url'}
29						<td>{if $fieldValue}<a href="{$fieldValue}">&nbsp;url&nbsp;</a>{else}&nbsp;{/if}</td>
30					{elseif $thisObject->getFieldOptions($fieldName)}
31						{assign var=relationship value=$thisObject->getFieldOptions($fieldName)}
32						<td>{$relationship->getInfo()}</td>
33					{else}
34						<td>{$fieldValue|nl2br}</td>
35					{/if}
36				{/if}
37			{/foreach}
38			<td><a href="#" onclick="return submitForm('edit', {$thisObject->getId()})">edit</a></td>
39			<td><a href="#" onclick="return submitForm('view', {$thisObject->getId()})">view</a></td>
40			<td><a href="#" onclick="return submitForm('delete', {$thisObject->getId()})">delete</a></td>
41		</tr>
42		{/foreach}	
43	</table>
44	<input type="hidden" name="id" value="_default_">
45	<input type="hidden" name="action" value="_default_">
46	<input type="button" name="add" value="add" onclick="submitForm('add', null)">
47</form>