From 34e0146d8e462293c0ea8145dc8979a562d65dbb Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Mar 2016 16:33:46 +0000 Subject: [PATCH] Added {calc} operation to produce inline calculations in templates --- alerts.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/alerts.php b/alerts.php index 6d791d213d..4be4e34a61 100755 --- a/alerts.php +++ b/alerts.php @@ -390,6 +390,10 @@ function FormatAlertTpl($obj) { $pos = $x; $for = true; } + else if ($buff == '{calc') { + $pos = $x; + $calc = true; + } if ($pos != -1 && $msg[$x] == '}') { $orig = $buff; @@ -411,6 +415,14 @@ function FormatAlertTpl($obj) { ' as $key=>$value) { $ret .= "', ); } + else if ($calc) { + $calc = false; + $o = 5; + $native = array( + '"; $ret .= (float) (0+(', + ')); $ret .= "', + ); + } else { continue; }