+ // Construct call-back function name
+ $callbackFunction = 'doTemplate' . $data['callback'];
+
+ // Init replacer
+ $replacer = '<!-- [' . __FUNCTION__ . ':' . __LINE__.'] Call-back function ' . $callbackFunction . ' does not exist. //-->';
+
+ // Is the function there?
+ if (!isset($GLOBALS['current_template'])) {
+ // This is very bad and needs fixing
+ reportBug(__FUNCTION__, __LINE__, 'current_template in GLOBALS not set, callbackFunction=' . $callbackFunction . ',function_exists()=' . intval(function_exists($callbackFunction)));
+ } elseif (!function_exists($callbackFunction)) {
+ // Log missing function only in debug mode
+ if (isDebugModeEnabled()) {
+ // Log it here
+ logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callbackFunction . ' does not exist.');
+ } // END - if
+ } else {
+ // Do the replacement
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
+ $replacer = '{DQUOTE} . ' . $callbackFunction . '(' . chr(39) . $GLOBALS['current_template'] . chr(39) . ', TRUE';
+
+ // Is 'value' set?
+ if (!empty($data['value'])) {
+ // Then include it as well
+ $replacer .= ', ' . chr(39) . $data['value'] . chr(39);
+ } // END - if
+
+ // Replacer is ready
+ $replacer .= ') . {DQUOTE}';
+ }
+
+ // Replace the code
+ $code = replaceExpressionCode($data, $replacer);
+
+ // Return the (maybe) replaced code
+ return $code;
+}
+
+// Expression call-back for math functions
+function doExpressionMath ($data) {