aboutsummaryrefslogtreecommitdiffstats
path: root/include/template_processor.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-08-11 18:54:23 -0700
committerfriendica <info@friendica.com>2012-08-11 18:54:23 -0700
commite80d69d25b816cda36e2c772db2805f2dc744bbe (patch)
tree1b5f9f40061639d41b22591ae29491964934dc05 /include/template_processor.php
parentcac2d408329c8ad0f2f7faed07c4615be12acdf5 (diff)
downloadvolse-hubzilla-e80d69d25b816cda36e2c772db2805f2dc744bbe.tar.gz
volse-hubzilla-e80d69d25b816cda36e2c772db2805f2dc744bbe.tar.bz2
volse-hubzilla-e80d69d25b816cda36e2c772db2805f2dc744bbe.zip
merge upstream
Diffstat (limited to 'include/template_processor.php')
-rw-r--r--include/template_processor.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/template_processor.php b/include/template_processor.php
index 9c6e27916..0f52d12a4 100644
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -63,7 +63,7 @@
if ($b[0]=="$") $b = $this->_get_var($b);
$val = ($a == $b);
} else if (strpos($args[2],"!=")>0){
- list($a,$b) = explode("!=",$args[2]);
+ list($a,$b) = array_map("trim", explode("!=",$args[2]));
$a = $this->_get_var($a);
if ($b[0]=="$") $b = $this->_get_var($b);
$val = ($a != $b);
@@ -133,6 +133,26 @@
return $ret;
}
+
+ /**
+ * DEBUG node
+ *
+ * {{ debug $var [$var [$var [...]]] }}{{ enddebug }}
+ *
+ * replace node with <pre>var_dump($var, $var, ...);</pre>
+ */
+ private function _replcb_debug($args){
+ $vars = array_map('trim', explode(" ",$args[2]));
+ $vars[] = $args[1];
+
+ $ret = "<pre>";
+ foreach ($vars as $var){
+ $ret .= htmlspecialchars(var_export( $this->_get_var($var), true ));
+ $ret .= "\n";
+ }
+ $ret .= "</pre>";
+ return $ret;
+ }
private function _replcb_node($m) {
$node = $this->nodes[$m[1]];