mirror of
https://github.com/e107inc/e107.git
synced 2025-05-02 02:07:52 +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:
parent
3ca4734a18
commit
ceb0fff60d
@ -794,6 +794,8 @@ class e_parse extends e_parser
|
|||||||
$text = $this->simpleParse($text, $extraCodes, false);
|
$text = $this->simpleParse($text, $extraCodes, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
|
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2091,8 +2093,10 @@ class e_parse extends e_parser
|
|||||||
'e_HANDLER/' => '{e_HANDLER}', // BC
|
'e_HANDLER/' => '{e_HANDLER}', // BC
|
||||||
'e_MEDIA/' => '{e_MEDIA}',
|
'e_MEDIA/' => '{e_MEDIA}',
|
||||||
'e_WEB/' => '{e_ADMIN}',
|
'e_WEB/' => '{e_ADMIN}',
|
||||||
|
'THEME/' => '{THEME}',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 'sc':
|
case 'sc':
|
||||||
|
@ -69,6 +69,7 @@ class e_parse_shortcode
|
|||||||
protected $scClasses = array(); // Batch shortcode classes - TODO make it private
|
protected $scClasses = array(); // Batch shortcode classes - TODO make it private
|
||||||
protected $scOverride = array(); // Array of codes found in override/shortcodes dir
|
protected $scOverride = array(); // Array of codes found in override/shortcodes dir
|
||||||
protected $scBatchOverride = array(); // Array of codes found in override/shortcodes/batch 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
|
* @var e_vars
|
||||||
*/
|
*/
|
||||||
@ -89,7 +90,7 @@ class e_parse_shortcode
|
|||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
$this->parseSCFiles = true; // Default probably never used, but make sure its defined.
|
$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->loadOverrideShortcodes();
|
||||||
$this->loadThemeShortcodes();
|
$this->loadThemeShortcodes();
|
||||||
$this->loadPluginShortcodes();
|
$this->loadPluginShortcodes();
|
||||||
@ -795,6 +796,13 @@ class e_parse_shortcode
|
|||||||
*/
|
*/
|
||||||
function doCode($matches)
|
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
|
// XXX remove all globals, $sc_style removed
|
||||||
global $pref, $e107cache, $menu_pref, $parm, $sql;
|
global $pref, $e107cache, $menu_pref, $parm, $sql;
|
||||||
|
|
||||||
@ -1020,6 +1028,11 @@ class e_parse_shortcode
|
|||||||
$scCode = file_get_contents($scFile);
|
$scCode = file_get_contents($scFile);
|
||||||
$this->scList[$code] = $scCode;
|
$this->scList[$code] = $scCode;
|
||||||
$_path = $scFile;
|
$_path = $scFile;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// $ret = 'Missing!';
|
||||||
|
$_path .= " MISSING!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user