JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
add namespacify.sh
[wfpl.git] / template.php
index fc7302b..8e0028b 100644 (file)
@@ -209,10 +209,14 @@ function &tem_row_data($tem, $context)
 
        if(count($tem['args'])) {
                $auto_func = "tem_auto_" . $tem['args'][0];
-               function_exists($auto_func)
-                       or die("ERROR: template auto function '$auto_func' not found.<br>\n");
+               if (!function_exists($auto_func)) {
+                       die("ERROR: template auto function '$auto_func' not found.<br>\n");
+               }
+               # NAMESPACIFY $auto_func
+       }
+       if ($auto_func) {
+               $value = $auto_func($scope['data'][$key], $key, $scope, $tem['args']);
        }
-       if($auto_func) $value = $auto_func($scope['data'][$key], $key, $scope, $tem['args']);
        else $value = $scope['data'][$key];
 
        $rows = tem_data_as_rows($value, $key);
@@ -228,8 +232,12 @@ function tem_encoded_data($tag, $context)
        $value = tem_get_data($key, $context);
        foreach($tag['args'] as $encoding) {
                $func = "enc_$encoding";
-               if(function_exists($func)) $value = $func($value, $key);
-               else die("ERROR: encoder function '$func' not found.<br>\n");
+               if (function_exists($func)) {
+                       # NAMESPACIFY $func
+                       $value = $func($value, $key);
+               } else {
+                       die("ERROR: encoder function '$func' not found.<br>\n");
+               }
        }
        return $value;
 }