// Loads an email template and compiles it
function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = true) {
- // @TODO $DATA is deprecated and should be avoided and replaced with $content
- global $DATA;
-
// Make sure all template names are lowercase!
$template = strtolower($template);
<div class="para">
{--TEMPLATE_CONTENT--}:
<pre>' . print_r($content, true) . '</pre>
- {--TEMPLATE_DATA--}:
- <pre>' . print_r($DATA, true) . '</pre>
</div>';
// Debug mode not active? Then remove the HTML tags
// Remove content and data
unset($content);
- unset($DATA);
// Return content
return $newContent;
return $code;
}
-// Compiles the code (use compileCode() only for HTML because of the comments)
+// Compiles the code
// @TODO $simple/$constants are deprecated
function compileRawCode ($code, $simple = false, $constants = true, $full = true, $compileCode = true) {
// Is the code a string or shall we not compile?
$code = str_replace($secChars['to'], $secChars['from'], $code);
// Find $content[bla][blub] entries
- // @TODO Do only use $content and deprecate $DATA in templates
- preg_match_all('/\$(content|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
+ preg_match_all('/\$content((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
// Are some matches found?
if ((count($matches) > 0) && (count($matches[0]) > 0)) {
// Handle message codes from URL
function handleCodeMessage () {
+ // Is 'code' set?
if (isGetRequestParameterSet('code')) {
// Default extension is 'unknown'
$ext = 'unknown';