if ($data['matches'][4][$data['key']] == '$userid') {
// Use dynamic call
$functionName = "getFetchedUserData('userid', \$userid, '" . $data['callback'] . "')";
- } elseif ($data['matches'][4][$data['key']] > 0) {
+ } elseif (!empty($data['matches'][4][$data['key']])) {
// User data found
- $functionName = "getFetchedUserData('userid', " . $data['matches'][4][$data['key']] . ", " . $data['callback'] . "')";
+ $functionName = "getFetchedUserData('userid', " . $data['matches'][4][$data['key']] . ", '" . $data['callback'] . "')";
}
} elseif ((!empty($data['callback'])) && (isUserDataValid())) {
// "Call-back" alias column for current logged in user's data
// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
function doExpressionConfig ($data) {
// Default replacer is the config value itself
- $replacer = '{DQUOTE} . getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ') . {DQUOTE}';
-
- // Is there a call-back function provided?
- if (!empty($data['callback'])) {
- // Construct a new expression
- $replacer = '{%pipe,' . $data['callback'] . ',' . $configValue . '%}';
- } // END - if
+ $replacer = '{DQUOTE} . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}';
// Replace the config entry
$code = replaceExpressionCode($data, $replacer);
// Expression call-back for dynamic messages
function doExpressionMessage ($data) {
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callback=' . $data['callback'] . ',extra_func=' . $data['extra_func'] . ',value=' . $data['value']);
+
// Message string replacement depends on if message is masked
- if (isMessageMasked($data['callback'])) {
+ if ((isMessageMasked($data['callback'])) && ((!empty($data['extra_func'])) || ($data['extra_func'] == '0'))) {
// Message should be masked
$replacer = "{DQUOTE} . getMaskedMessage('" . $data['callback'] . "', '" . $data['extra_func'] . "') . {DQUOTE}";
+ } elseif (!empty($data['value'])) {
+ // value is set, so it is masked message
+ $replacer = "{DQUOTE} . getMaskedMessage('" . $data['callback'] . "', '" . $data['value'] . "') . {DQUOTE}";
} else {
// Regular message
$replacer = "{DQUOTE} . getMessage('" . $data['callback'] . "') . {DQUOTE}";
return $code;
}
+// Expression call-back for template functions
+function doExpressionTemplate ($data) {
+ // Do the replacement
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
+ $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true) . {DQUOTE}";
+
+ // Replace the code
+ $code = replaceExpressionCode($data, $replacer);
+
+ // Return the (maybe) replaced code
+ return $code;
+}
+
// [EOF]
?>