1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Issue #3103 -Wrappers containing parms were not overriding wrappers of the same name without parms.

This commit is contained in:
Cameron
2018-08-16 11:34:29 -07:00
parent 73fbe980a4
commit ec3a2e28b5
2 changed files with 13 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ if (!defined('e107_INIT'))
*/
function initShortcodeClass($class, $force = false, $eVars = null)
{
return e107::getScParser()->initShortcodeClass($class, $eVars, $force);
return e107::getScParser()->initShortcodeClass($class, $force);
}
@@ -93,6 +93,8 @@ class e_parse_shortcode
private $legacyBatch = array(); // List of legacy batch file codes. eg. using SC_BEGIN etc.
private $legacyBatchFile = null;
private $debug_legacy = array();
/** @var e_vars */
protected $eVars = null;
protected $wrappers = array(); // Wrappers array for the current parsing cycle, see contact_template.php and $CONTACT_WRAPPER variable
protected $wrapper = null; // current wrapper being processed.
@@ -1429,14 +1431,14 @@ class e_parse_shortcode
{
$pre = $post = '';
if(isset($this->wrappers[$code]) && !empty($this->wrappers[$code])) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE']
{
list($pre, $post) = explode("{---}", $this->wrappers[$code], 2);
}
elseif(!empty($fullShortcodeKey) && !empty($this->wrappers[$fullShortcodeKey]) ) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE: item=1']
if(!empty($fullShortcodeKey) && !empty($this->wrappers[$fullShortcodeKey]) ) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE: item=1']
{
list($pre, $post) = explode("{---}", $this->wrappers[$fullShortcodeKey], 2);
}
elseif(isset($this->wrappers[$code]) && !empty($this->wrappers[$code])) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE']
{
list($pre, $post) = explode("{---}", $this->wrappers[$code], 2);
}
else
{
//if $sc_mode exists, we need it to parse $sc_style

View File

@@ -152,6 +152,9 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
$PAGE_WRAPPER['customfields']['CPAGEFIELDTITLE'] = "<tr id='customfields-{CPAGEFIELDNAME}'><td>{---}</td>";
$PAGE_WRAPPER['customfields']['CPAGEFIELD'] = "<td>{---}</td></tr>";
// Override the wrapper above for {CPAGEFIELD: name=myvideo}
$PAGE_WRAPPER['customfields']['CPAGEFIELD: name=myvideo'] = "<tr><td colspan='2'>{---}</td></tr>";
$PAGE_TEMPLATE['customfields']['body'] = '
<div class="col-xs-12 col-md-5 pull-right" style="margin-right:-15px">
@@ -159,6 +162,7 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
<tr>
<th class="text-center" colspan="2">Custom Fields</th>
</tr>
{CPAGEFIELD: name=myvideo}
{CPAGEFIELDTITLE: name=mybbarea}
{CPAGEFIELD: name=mybbarea}
{CPAGEFIELDTITLE: name=myboolean}
@@ -191,8 +195,7 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
{CPAGEFIELD: name=mytext}
{CPAGEFIELDTITLE: name=myurl}
{CPAGEFIELD: name=myurl}
{CPAGEFIELDTITLE: name=myvideo}
{CPAGEFIELD: name=myvideo}
</table>
{CPAGEEDIT}
</div>