mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Issue #2029 Allow wrappers to contain core shortcodes.
This commit is contained in:
@@ -1372,28 +1372,27 @@ class e_parse_shortcode
|
|||||||
*/
|
*/
|
||||||
private function makeWrapper($ret, $code, $fullShortcodeKey, $sc_mode)
|
private function makeWrapper($ret, $code, $fullShortcodeKey, $sc_mode)
|
||||||
{
|
{
|
||||||
|
$pre = $post = '';
|
||||||
|
|
||||||
if(isset($this->wrappers[$code]) && !empty($this->wrappers[$code])) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE']
|
if(isset($this->wrappers[$code]) && !empty($this->wrappers[$code])) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE']
|
||||||
{
|
{
|
||||||
list($pre, $post) = explode("{---}", $this->wrappers[$code], 2);
|
list($pre, $post) = explode("{---}", $this->wrappers[$code], 2);
|
||||||
return $pre.$ret.$post;
|
|
||||||
}
|
}
|
||||||
|
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);
|
list($pre, $post) = explode("{---}", $this->wrappers[$fullShortcodeKey], 2);
|
||||||
return $pre.$ret.$post;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
//if $sc_mode exists, we need it to parse $sc_style
|
//if $sc_mode exists, we need it to parse $sc_style
|
||||||
if ($sc_mode)
|
if($sc_mode)
|
||||||
{
|
{
|
||||||
$code = $code.'|'.$sc_mode;
|
$code = $code.'|'.$sc_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($this->sc_style) && array_key_exists($code, $this->sc_style))
|
if (is_array($this->sc_style) && array_key_exists($code, $this->sc_style))
|
||||||
{
|
{
|
||||||
$pre = $post = '';
|
|
||||||
// old way - pre/post keys
|
// old way - pre/post keys
|
||||||
if(is_array($this->sc_style[$code]))
|
if(is_array($this->sc_style[$code]))
|
||||||
{
|
{
|
||||||
@@ -1411,11 +1410,21 @@ class e_parse_shortcode
|
|||||||
list($pre, $post) = explode("{---}", $this->sc_style[$code], 2);
|
list($pre, $post) = explode("{---}", $this->sc_style[$code], 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = $pre.$ret.$post;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $ret;
|
if(strpos($pre, '{') !== false) // shortcode found in wrapper
|
||||||
|
{
|
||||||
|
$pre = $this->parseCodes($pre, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strpos($post, '{') !== false) // shortcode found in wrapper
|
||||||
|
{
|
||||||
|
$post = $this->parseCodes($post, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $pre.$ret.$post;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user