From: Anne Limoges Date: Wed, 13 Feb 2013 15:16:36 +0000 (+0100) Subject: Adds the possibility to have a link in a tableeditor. X-Git-Tag: core/1.1.9~1 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f6cfa61b4536e3a823508febe97317736dc16074;p=platal.git Adds the possibility to have a link in a tableeditor. --- 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}