// We need callback and extra_func: callback is really the call-back function, extra_func is our value
$replacer = $data['extra_func'];
- // Is the extra_func empty and value set?
- if ((empty($replacer)) && (isset($data['value']))) {
- // Then use this
- $replacer = $data['value'];
- } // END - if
-
// Do we have a call-back? Should always be there!
if (!empty($data['callback'])) {
- // Parse it through this function
- $replacer = '{DQUOTE} . ' . $data['extra_func'] . '(' . $data['callback'] . "('" . $replacer . "')) . {DQUOTE}";
+ //if ($data['callback'] == 'getMemberId') die('<pre>'.encodeEntities(print_r($data, true)).'</pre>');
+ // If the value is empty, we don't add it
+ if (empty($data['value'])) {
+ // No value is set
+ $replacer = '{DQUOTE} . ' . $data['extra_func2'] . '(' . $data['extra_func'] . '(' . $data['callback'] . '())) . {DQUOTE}';
+ } else {
+ // Some value is set
+ $replacer = '{DQUOTE} . ' . $data['extra_func2'] . '(' . $data['extra_func'] . '(' . $data['callback'] . "('" . $data['value'] . "'))) . {DQUOTE}";
+ }
} // END - if
// Replace the config entry
function doExpressionTemplate ($data) {
// Do the replacement
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
- $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true) . {DQUOTE}";
+ $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true";
+
+ // Is 'value' set?
+ if (!empty($data['value'])) {
+ // Then include it as well
+ $replacer .= ", '" . $data['value'] . "'";
+ } // END - if
+
+ // Replacer is ready
+ $replacer .= ') . {DQUOTE}';
// Replace the code
$code = replaceExpressionCode($data, $replacer);