1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-06 06:59:07 +01:00

Issue #1597 - Legacy Batch Shortcode fix.

This commit is contained in:
Cameron 2016-05-03 15:52:02 -07:00
parent fd3f4d489e
commit 8d228a08dd

View File

@ -91,6 +91,7 @@ class e_parse_shortcode
protected $ignoreCodes = array(); // Shortcodes to be ignored and remain unchanged. (ie. {THEME}, {e_PLUGIN} etc. ) protected $ignoreCodes = array(); // Shortcodes to be ignored and remain unchanged. (ie. {THEME}, {e_PLUGIN} etc. )
protected $addonOverride = array(); // Overrides coming from e_shortcode.php protected $addonOverride = array(); // Overrides coming from e_shortcode.php
private $legacyBatch = array(); // List of legacy batch file codes. eg. using SC_BEGIN etc. private $legacyBatch = array(); // List of legacy batch file codes. eg. using SC_BEGIN etc.
private $legacyBatchFile = null;
private $debug_legacy = array(); private $debug_legacy = array();
protected $eVars = null; protected $eVars = null;
protected $wrappers = array(); // Wrappers array for the current parsing cycle, see contact_template.php and $CONTACT_WRAPPER variable protected $wrappers = array(); // Wrappers array for the current parsing cycle, see contact_template.php and $CONTACT_WRAPPER variable
@ -829,7 +830,7 @@ class e_parse_shortcode
$this->addedCodes = $saveCodes; $this->addedCodes = $saveCodes;
$this->eVars = $saveVars; // restore eVars $this->eVars = $saveVars; // restore eVars
$this->debug_legacy = null; $this->debug_legacy = null;
$this->legacyBatch = array();
// $this->sc_style = array(); //XXX Adding this will also fix #2 above. // $this->sc_style = array(); //XXX Adding this will also fix #2 above.
@ -967,18 +968,19 @@ class e_parse_shortcode
//$this->legacyBatch //$this->legacyBatch
if(in_array($code,$this->legacyBatch)) if(in_array($code,$this->legacyBatch))
{ {
$_type = 'legacy batch';
$_path = $this->legacyBatchFile;
$scCode = $this->addedCodes[$code]; $scCode = $this->addedCodes[$code];
} }
else else
{ {
$_type = 'array';
$_path = "(direct to parser)";
$ret = $this->addedCodes[$code]; $ret = $this->addedCodes[$code];
} }
// $_class = "n/a";
// $_function = "n/a";
$_type = 'array';
$_path = "(direct to parser)";
} }
elseif (array_key_exists($code, $this->scList)) // Check to see if we've already loaded the .sc file contents elseif (array_key_exists($code, $this->scList)) // Check to see if we've already loaded the .sc file contents
@ -1378,6 +1380,7 @@ class e_parse_shortcode
$this->legacyBatch = array_keys($cur_shortcodes); $this->legacyBatch = array_keys($cur_shortcodes);
$this->legacyBatchFile = str_replace(e_ROOT, '', $fname);
return $cur_shortcodes; return $cur_shortcodes;
} }