From d2490f61530bfae3d5aa0061c00b5577c0297518 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 2 Nov 2014 21:47:31 +0000 Subject: [PATCH] list.tpl: - add support for $struct[linkto] git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1727 a1433add-5e2c-0410-b055-b7f2511e0802 --- templates/list.tpl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/templates/list.tpl b/templates/list.tpl index dee0b468..68af8a65 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -28,6 +28,13 @@ {foreach key=key item=field from=$struct} {if $field.display_in_list == 1 && $field.label} + {if $field.linkto != '' && ($item.$id_field != '' || $item.$id_field > 0) } + {assign "linkto" "{$field.linkto|replace:'%s':{$item.$id_field|escape:url}}"} {* TODO: use label field instead *} + {assign "linktext" "{$item.{$key}}"} + {else} + {assign "linktext" $item.$key} + {/if} + {if $table == 'foo' && $key == 'bar'} Special handling (complete table row) for {$table} / {$key} {else} @@ -58,7 +65,7 @@ {if $item[$tmpkey] > -1}
-
{$item[$key]}
+
{$linktext}
{else} {$item[$key]} {/if} @@ -66,7 +73,7 @@ {elseif $field.type == 'txtl'} {foreach key=key2 item=field2 from=$value_{$key}}

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