]> git.mxchange.org Git - friendica.git/commitdiff
template proc: avoid a notice and allow template name to include to be passed with...
authorFabio Comuni <fabrix.xm@gmail.com>
Thu, 1 Mar 2012 10:32:49 +0000 (11:32 +0100)
committerFabio Comuni <fabrix.xm@gmail.com>
Thu, 1 Mar 2012 10:32:49 +0000 (11:32 +0100)
include/template_processor.php

index 28c3f07ddd1e46dfc477deb4f0fc9b7a1479d6c4..b4d444e1c622ee7d472d00d990ba8fbb3369531c 100755 (executable)
                 * {{ inc <templatefile> [with $var1=$var2] }}{{ endinc }}
                 */
                private function _replcb_inc($args){
-                       list($tplfile, $newctx) = array_map('trim', explode("with",$args[2]));
+                       if (strpos($args[2],"with")) {
+                               list($tplfile, $newctx) = array_map('trim', explode("with",$args[2]));
+                       } else {
+                               $tplfile = trim($args[2]);
+                               $newctx = null;
+                       }
+                       
+                       if ($tplfile[0]=="$") $tplfile = $this->_get_var($tplfile);
+                       
                        $this->_push_stack();
                        $r = $this->r;
                        if (!is_null($newctx)) {