1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-25 23:36:29 +02:00

More email templates cleanup. /signup.php?preview working again.

This commit is contained in:
Cameron
2014-08-17 20:53:44 -07:00
parent f9111fd5ca
commit f4bb971696
6 changed files with 171 additions and 93 deletions

View File

@@ -781,12 +781,50 @@ class e_parse extends e_parser
return $this->toHTML($text, TRUE, $extra);
}
/**
* @param $text - template to parse.
* @param boolean $parseSCFiles - parse core 'single' shortcodes
* @param array $extraCodes - support legacy shortcode content (eg. content within .sc) as well as simpleParse array format.
* @param object $eVars - XXX more info needed.
*/
function parseTemplate($text, $parseSCFiles = TRUE, $extraCodes = null, $eVars = null)
{
if(!empty($extraCodes) && $this->isSimpleParse($extraCodes)) // support for a combined simple and standard template parse. - (eg. used by signup email template.)
{
$text = $this->simpleParse($text, $extraCodes, false);
}
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
}
/**
* Check if we are using the simple-Parse array format, or a legacy .sc format which contains 'return '
* @param array $extraCodes
*/
private function isSimpleParse($extraCodes)
{
if(!is_array($extraCodes))
{
return false;
}
foreach ($extraCodes as $sc => $code)
{
if(!strpos($code, 'return '))
{
return true;
}
else
{
return false;
}
}
}
/**
* Simple parser
*