X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fexpression-functions.php;h=b1e95c2ef6932df503a5dc581664dd78c02e3fa6;hp=65b69840058f0f6f60606ed6c0d12c24cb36377a;hb=48b01b793f8953018586b10eeb3d7b0a762af765;hpb=d0db163274524c1ac548146db60d4543abcec4a9 diff --git a/inc/expression-functions.php b/inc/expression-functions.php index 65b6984005..b1e95c2ef6 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -163,5 +163,26 @@ function doExpressionFilter ($data) { 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] ?>