mirror of
https://github.com/e107inc/e107.git
synced 2025-08-09 08:06:38 +02: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:
@@ -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!";
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user