From f6cfa61b4536e3a823508febe97317736dc16074 Mon Sep 17 00:00:00 2001 From: Anne Limoges Date: Wed, 13 Feb 2013 16:16:36 +0100 Subject: [PATCH] Adds the possibility to have a link in a tableeditor. --- classes/pltableeditor.php | 5 +++++ templates/table-editor.tpl | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/classes/pltableeditor.php b/classes/pltableeditor.php index 89c0b14..28ca26f 100644 --- a/classes/pltableeditor.php +++ b/classes/pltableeditor.php @@ -234,6 +234,11 @@ class PLTableEditor } } + // add a link on a field, the field value will be added at the end of the url + public function addLink($field, $url) { + $this->vars[$field]['url'] = $url; + } + // force the value of a field in select and add public function force_field_value($field, $value) { diff --git a/templates/table-editor.tpl b/templates/table-editor.tpl index 80b6caa..5a847a6 100644 --- a/templates/table-editor.tpl +++ b/templates/table-editor.tpl @@ -69,6 +69,8 @@ {elseif $myval.Type eq 'ip_address'} {$myrow.$myfield|uint_to_ip} + {elseif $myval.url} + {$myrow.$myfield} {else} {$myrow.$myfield} {/if} @@ -76,10 +78,10 @@ {/if}{/foreach} {if !$hideactions} - {if !$readonly and !$deleteonly} + {if !$readonly and !$deleteonly and !addonly} {icon name=page_edit title='éditer'} {/if} - {if !$readonly} + {if !$readonly and !$addonly} {icon name=delete title='supprimer'} {/if} -- 2.1.4