From 35fad174f703040abfece82a915f380d29c2ebb8 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mon, 6 Apr 2015 21:09:54 +0000 Subject: [PATCH] smarty.inc.php: - assign(): additionally provide the unsanitized values as RAW_$key PFAHandler.php: - document 'html' field type (used for raw html), including a big warning list.tpl: - add handling to display raw html fields This is a preparation to use the status markers with list.tpl without introducing too big changes. git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1775 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/PFAHandler.php | 1 + smarty.inc.php | 1 + templates/list.tpl | 2 ++ 3 files changed, 4 insertions(+) diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 4d91ad75..e48db32a 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -225,6 +225,7 @@ abstract class PFAHandler { * available values for the "type" column: * text one line of text * *vtxt "virtual" line of text, coming from JOINs etc. + * html raw html (use carefully, won't get auto-escaped by smarty! Don't use with user input!) * pass password (will be encrypted with pacrypt()) * b64p password (will be stored with base64_encode()) * num number diff --git a/smarty.inc.php b/smarty.inc.php index 68b63d5e..4ac28793 100644 --- a/smarty.inc.php +++ b/smarty.inc.php @@ -17,6 +17,7 @@ class PFASmarty { } public function assign($key, $value, $sanitise = true) { + $this->template->assign("RAW_$key", $value); if($sanitise == false) { return $this->template->assign($key, $value); } diff --git a/templates/list.tpl b/templates/list.tpl index b36669bd..a46d9e2a 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -96,6 +96,8 @@ {elseif $field.type == 'txtl'} {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} + {elseif $field.type == 'html'} + {$RAW_items.{$item.{$msg.id_field}}.$key} {else} {$linktext} {/if}