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 // Now replace the code $code = str_replace($data['matches'][0][$data['key']], "\" . " . $functionName . " . \"", $data['code']); // 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 = "\" . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', true)) . \""; } // END - if // Replace it and insert parameter for GET request $code = str_replace($data['matches'][0][$data['key']], sprintf("&ext=%s&ver=%s&rev=\" . getConfig('CURR_SVN_REVISION') . \"", $data['matches'][4][$data['key']], $replacer), $data['code']); // 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) { // Read configuration $configValue = getConfig($data['matches'][4][$data['key']]); // Do we have a call-back? if (!empty($data['callback'])) { // Parse it through this function $configValue = call_user_func_array($data['callback'], array($configValue)); } // END - if // Replace the config entry $code = str_replace($data['matches'][0][$data['key']], $configValue, $data['code']); // Return replaced code return $code; } // Expression call-back function for calling filters function doExpressionFilter ($data) { // Construct replacement $replacer = "\" . runFilterChain('" . $data['matches'][4][$data['key']] . "') . \""; // Run the filter and insert result $code = str_replace($data['matches'][0][$data['key']], $replacer, $data['code']); // 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 = str_replace($data['matches'][0][$data['key']], $replacer, $code); // Return the (maybe) replaced code return $code; } // [EOF] ?>