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; $reg_path = 'core/e107/templates/'.$id;
$path = self::coreTemplatePath($id, false); $path = self::coreTemplatePath($id, false);
$id = str_replace('/', '_', $id); $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); return (is_array($ret_core) ? array_merge($ret_core, $ret) : $ret);
} }
@@ -2111,7 +2112,8 @@ class e107
$id = str_replace('/', '_', $id); $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); return (is_array($ret_plug) ? array_merge($ret_plug, $ret) : $ret);
} }
@@ -2259,9 +2261,10 @@ class e107
* @param string $reg_path * @param string $reg_path
* @param string $path * @param string $path
* @param boolean $info * @param boolean $info
* @param boolean $noWrapper
* @return string|array * @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; $regPath = $reg_path;
$var = strtoupper($id).'_TEMPLATE'; $var = strtoupper($id).'_TEMPLATE';
@@ -2282,16 +2285,21 @@ class e107
self::setRegistry($regPath, (isset($$var) ? $$var : array())); self::setRegistry($regPath, (isset($$var) ? $$var : array()));
// sc_style not a global anymore and uppercase // sc_style not a global anymore and uppercase
if(isset($SC_WRAPPER))
{ // Fix template merge issue - no-wrapper sent to avoid sc wrappers confusions
self::scStyle($SC_WRAPPER); if(!$noWrapper)
} {
if(isset($SC_WRAPPER))
// ID_WRAPPER support {
if(isset($$wrapper) && !empty($$wrapper) && is_array($$wrapper)) self::scStyle($SC_WRAPPER);
{ }
self::setRegistry($wrapperRegPath, $$wrapper);
} // ID_WRAPPER support
if(isset($$wrapper) && !empty($$wrapper) && is_array($$wrapper))
{
self::setRegistry($wrapperRegPath, $$wrapper);
}
}
} }
if(null === self::getRegistry($regPathInfo)) if(null === self::getRegistry($regPathInfo))
{ {