1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Fixes problem where {e_PLUGIN}, {THEME} etc. are replaced with empty values when using parseTemplate(). Now retains theme for use by replaceConstants() etc.

This commit is contained in:
Cameron 2014-08-18 22:57:18 -07:00
parent 3ca4734a18
commit ceb0fff60d
2 changed files with 19 additions and 2 deletions

View File

@ -794,6 +794,8 @@ class e_parse extends e_parser
$text = $this->simpleParse($text, $extraCodes, false);
}
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
}
@ -2091,8 +2093,10 @@ class e_parse extends e_parser
'e_HANDLER/' => '{e_HANDLER}', // BC
'e_MEDIA/' => '{e_MEDIA}',
'e_WEB/' => '{e_ADMIN}',
'THEME/' => '{THEME}',
);
switch ($type)
{
case 'sc':

View File

@ -69,6 +69,7 @@ class e_parse_shortcode
protected $scClasses = array(); // Batch shortcode classes - TODO make it private
protected $scOverride = array(); // Array of codes found in override/shortcodes dir
protected $scBatchOverride = array(); // Array of codes found in override/shortcodes/batch dir
protected $ignoreCodes = array(); // Shortcodes to be ignored and remain unchanged. (ie. {THEME}, {e_PLUGIN} etc. )
/**
* @var e_vars
*/
@ -89,7 +90,7 @@ class e_parse_shortcode
function __construct()
{
$this->parseSCFiles = true; // Default probably never used, but make sure its defined.
$this->ignoreCodes = e107::getParser()->getUrlConstants(); // ignore all URL shortcodes. ie. {e_PLUGIN}
$this->loadOverrideShortcodes();
$this->loadThemeShortcodes();
$this->loadPluginShortcodes();
@ -795,6 +796,13 @@ class e_parse_shortcode
*/
function doCode($matches)
{
// print_a($matches);
if(in_array($matches[0],$this->ignoreCodes)) // Ignore all {e_PLUGIN}, {THEME} etc. otherwise it will just return blank for these items.
{
return $matches[0];
}
// XXX remove all globals, $sc_style removed
global $pref, $e107cache, $menu_pref, $parm, $sql;
@ -1020,6 +1028,11 @@ class e_parse_shortcode
$scCode = file_get_contents($scFile);
$this->scList[$code] = $scCode;
$_path = $scFile;
}
else
{
// $ret = 'Missing!';
$_path .= " MISSING!";
}
}