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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user