0) { // User data found $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 $functionName = "getUserData('" . $data['callback'] . "')"; } // Do we have another function to run (e.g. translations) if (!empty($data['extra_func'])) { // Surround the original function call with it $functionName = $data['extra_func'] . '(' . $functionName . ')'; } // END - if // Generate replacer $replacer = '{DQUOTE} . ' . $functionName . ' . {DQUOTE}'; // Now replace the code $code = replaceExpressionCode($data, $replacer); // Return replaced code return $code; } // Expression call-back function for getting extension data function doExpressionExt ($data) { // Not installed is default $replacer = 'false'; // Is the extension installed? if (isExtensionInstalled($data['matches'][4][$data['key']])) { // Construct call-back function name $functionName = 'getExtension' . ucfirst(strtolower($data['callback'])); // Construct call of the function $replacer = "{DQUOTE} . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', true)) . {DQUOTE}"; } // END - if // Generate replacer $replacer = sprintf("&ext=%s&ver=%s&rev={DQUOTE} . getConfig('CURR_SVN_REVISION') . {DQUOTE}", $data['matches'][4][$data['key']], $replacer); // Replace it and insert parameter for GET request $code = replaceExpressionCode($data, $replacer); // Return replaced code return $code; } // Expression call-back function for getting configuration 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} . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}'; // Replace the config entry $code = replaceExpressionCode($data, $replacer); // Return replaced code return $code; } // Expression call-back function for piping data through functions function doExpressionPipe ($data) { // 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['callback'] . "('" . $replacer . "') . {DQUOTE}"; } // END - if // Replace the config entry $code = replaceExpressionCode($data, $replacer); // Return replaced code return $code; } // Expression call-back function for calling filters function doExpressionFilter ($data) { // Construct replacement $replacer = "{DQUOTE} . runFilterChain('" . $data['matches'][4][$data['key']] . "') . {DQUOTE}"; // Run the filter and insert result $code = replaceExpressionCode($data, $replacer); // Return replaced code return $code; } // Expression call-back function for validator links function doExpressionValidatorLinks ($data) { // Default is nothing $replacer = ''; // Get the code from data array for replacement/pipe-through $code = $data['code']; // Should we generally include validator links? if ((isExtensionInstalled('validator')) && (getConfig('enable_validator') == 'Y') && (!in_array(getModule(), array('admin', 'login')))) { // Load the validator template $replacer = escapeQuotes(loadTemplate('validator_links', true)); } // END - if // Replace the code $code = replaceExpressionCode($data, $replacer); // Return the (maybe) replaced code return $code; } // Expression call-back for dynamic messages function doExpressionMessage ($data) { // Message string replacement depends on if message is masked if (isMessageMasked($data['callback'])) { // Message should be masked $replacer = "{DQUOTE} . getMaskedMessage('" . $data['callback'] . "', '" . $data['extra_func'] . "') . {DQUOTE}"; } else { // Regular message $replacer = "{DQUOTE} . getMessage('" . $data['callback'] . "') . {DQUOTE}"; } // Replace the code $code = replaceExpressionCode($data, $replacer); // Return the (maybe) replaced code return $code; } // [EOF] ?>