1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 22:27:34 +02:00

Fix SC wrappers confusions - introduced by merging templates feature

This commit is contained in:
SecretR
2014-11-04 22:47:24 +02:00
parent adc1f826b8
commit e981f32714

View File

@@ -2047,7 +2047,8 @@ class e107
$reg_path = 'core/e107/templates/'.$id;
$path = self::coreTemplatePath($id, false);
$id = str_replace('/', '_', $id);
$ret_core = self::_getTemplate($id, $key, $reg_path, $path, $info);
// Introducing noWrapper when merging
$ret_core = self::_getTemplate($id, $key, $reg_path, $path, $info, true);
return (is_array($ret_core) ? array_merge($ret_core, $ret) : $ret);
}
@@ -2111,7 +2112,8 @@ class e107
$id = str_replace('/', '_', $id);
$ret_plug = self::_getTemplate($id, $key, $reg_path, $path, $info);
// Introduced noWrapper when merging
$ret_plug = self::_getTemplate($id, $key, $reg_path, $path, $info, true);
return (is_array($ret_plug) ? array_merge($ret_plug, $ret) : $ret);
}
@@ -2259,9 +2261,10 @@ class e107
* @param string $reg_path
* @param string $path
* @param boolean $info
* @param boolean $noWrapper
* @return string|array
*/
public static function _getTemplate($id, $key, $reg_path, $path, $info = false)
public static function _getTemplate($id, $key, $reg_path, $path, $info = false, $noWrapper = false)
{
$regPath = $reg_path;
$var = strtoupper($id).'_TEMPLATE';
@@ -2282,6 +2285,10 @@ class e107
self::setRegistry($regPath, (isset($$var) ? $$var : array()));
// sc_style not a global anymore and uppercase
// Fix template merge issue - no-wrapper sent to avoid sc wrappers confusions
if(!$noWrapper)
{
if(isset($SC_WRAPPER))
{
self::scStyle($SC_WRAPPER);
@@ -2292,6 +2299,7 @@ class e107
{
self::setRegistry($wrapperRegPath, $$wrapper);
}
}
}
if(null === self::getRegistry($regPathInfo))
{