diff --git a/list.php b/list.php new file mode 100644 index 00000000..74c21cc6 --- /dev/null +++ b/list.php @@ -0,0 +1,67 @@ +webformConfig(); + +authentication_require_role($formconf['required_role']); + +$handler->getList(''); +$items = $handler->result(); + +$smarty->assign ('select_options', select_options($list_admins, array ($fUsername)), false); +#if ($is_superadmin) { + $smarty->assign('smarty_template', 'list'); + $smarty->assign('struct', $handler->getStruct()); + $smarty->assign('msg', $handler->getMsg()); + $smarty->assign('table', $table); + $smarty->assign('items', $items); + $smarty->assign('id_field', $handler->getId_field()); + $smarty->assign('formconf', $formconf); +#} else { +# $smarty->assign ('smarty_template', 'overview-get'); +#} + +$smarty->display ('index.tpl'); + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ +?> diff --git a/templates/list.tpl b/templates/list.tpl new file mode 100644 index 00000000..31176f46 --- /dev/null +++ b/templates/list.tpl @@ -0,0 +1,68 @@ +
+
+ + +
+{#form_search#} +
+ + +
+ + + + {foreach key=key item=field from=$struct} + {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} + + {/if} + {/foreach} + + + + +{foreach from=$items item=item} + {#tr_hilightoff#} + + {foreach key=key item=field from=$struct} + {if $field.display_in_list == 1 && $field.label} + + {if $table == 'foo' && $key == 'bar'} + + {else} + + {/if} + {/if} + {/foreach} + + + + +{/foreach} + +
{$field.label}  
Special handling (complete table row) for {$table} / {$key}
+ {if $table == 'foo' && $key == 'bar'} + Special handling (td content) for {$table} / {$key} +{* {elseif $table == 'domain' && $key == 'domain'} + {$item.domain} +*} + {elseif $key == 'active'} + {$item._active} + {elseif $field.type == 'bool'} + {assign "tmpkey" "_{$key}"}{$item.{$tmpkey}} + {elseif $field.type == 'list'} + {foreach key=key2 item=field2 from=$value_{$key}}

{$field2} {/foreach} + {elseif $field.type == 'pass'} + (hidden) + {elseif $field.type == 'txtl'} + {foreach key=key2 item=field2 from=$value_{$key}}

{$field2} {/foreach} + {else} +{$item.{$key}} + {/if} +

{if $item._can_edit}{$PALANG.edit}{else} {/if}{if $item._can_delete}{$PALANG.del}{else} {/if}
+ +
{$PALANG.{$formconf.create_button}}
+ +