mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Fixes #3932 Added support for dynamic header/footer templates controlled by theme_shortcodes class.
This commit is contained in:
@@ -72,6 +72,8 @@ if (varset($e107_popup) != 1)
|
|||||||
$psc = array(
|
$psc = array(
|
||||||
'</body>' => '',
|
'</body>' => '',
|
||||||
'{THEME}' => THEME_ABS,
|
'{THEME}' => THEME_ABS,
|
||||||
|
'{---HEADER---}' => $tp->parseTemplate('{HEADER}',true),
|
||||||
|
'{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true)
|
||||||
);
|
);
|
||||||
|
|
||||||
parseheader($FOOTER, $psc);
|
parseheader($FOOTER, $psc);
|
||||||
|
@@ -804,6 +804,8 @@ if ($e107_popup != 1) {
|
|||||||
'{BODY_ONLOAD}' => $body_onload,
|
'{BODY_ONLOAD}' => $body_onload,
|
||||||
'{LAYOUT_ID}' => 'layout-'.e107::getForm()->name2id(THEME_LAYOUT),
|
'{LAYOUT_ID}' => 'layout-'.e107::getForm()->name2id(THEME_LAYOUT),
|
||||||
'{---MODAL---}' => $LAYOUT['_modal_'],
|
'{---MODAL---}' => $LAYOUT['_modal_'],
|
||||||
|
'{---HEADER---}' => $tp->parseTemplate('{HEADER}',true),
|
||||||
|
'{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true),
|
||||||
);
|
);
|
||||||
|
|
||||||
parseheader($HEADER, $psc);
|
parseheader($HEADER, $psc);
|
||||||
|
@@ -2186,6 +2186,8 @@ class e_menu_layout
|
|||||||
|
|
||||||
$layout = array();
|
$layout = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($head as $k=>$v)
|
foreach($head as $k=>$v)
|
||||||
{
|
{
|
||||||
$template = $head[$k]."\n{---}".$foot[$k];
|
$template = $head[$k]."\n{---}".$foot[$k];
|
||||||
|
@@ -527,14 +527,16 @@ class e_parse_shortcode
|
|||||||
*
|
*
|
||||||
* @return e_parse_shortcode
|
* @return e_parse_shortcode
|
||||||
*/
|
*/
|
||||||
public function loadThemeShortcodes()
|
public function loadThemeShortcodes($theme=null)
|
||||||
{
|
{
|
||||||
global $register_sc;
|
global $register_sc;
|
||||||
|
|
||||||
if(file_exists(THEME."theme_shortcodes.php"))
|
$themePath = ($theme === null) ? THEME : e_THEME.$theme.'/';
|
||||||
|
|
||||||
|
if(file_exists($themePath."theme_shortcodes.php"))
|
||||||
{
|
{
|
||||||
$classFunc = 'theme_shortcodes';
|
$classFunc = 'theme_shortcodes';
|
||||||
$path = THEME."theme_shortcodes.php";
|
$path = $themePath."theme_shortcodes.php";
|
||||||
include_once($path);
|
include_once($path);
|
||||||
$this->registerClassMethods($classFunc, $path, false);
|
$this->registerClassMethods($classFunc, $path, false);
|
||||||
}
|
}
|
||||||
|
@@ -102,6 +102,19 @@ class e_theme
|
|||||||
|
|
||||||
list($LAYOUT['_header_'], $LAYOUT['_footer_']) = explode("{---LAYOUT---}", $tmp, 2);
|
list($LAYOUT['_header_'], $LAYOUT['_footer_']) = explode("{---LAYOUT---}", $tmp, 2);
|
||||||
|
|
||||||
|
$tp = e107::getParser();
|
||||||
|
e107::getScParser()->loadThemeShortcodes($theme);
|
||||||
|
|
||||||
|
if(strpos($LAYOUT['_header_'], '{---HEADER---}')!==false)
|
||||||
|
{
|
||||||
|
$LAYOUT['_header_'] = str_replace('{---HEADER---}', $tp->parseTemplate('{HEADER}', true), $LAYOUT['_header_']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strpos($LAYOUT['_footer_'], '{---FOOTER---}')!==false)
|
||||||
|
{
|
||||||
|
$LAYOUT['_footer_'] = str_replace('{---FOOTER---}', $tp->parseTemplate('{FOOTER}', true), $LAYOUT['_footer_']);
|
||||||
|
}
|
||||||
|
|
||||||
$LAYOUT[$key] = file_get_contents(e_THEME.$theme."/layouts/".$key."_layout.html");
|
$LAYOUT[$key] = file_get_contents(e_THEME.$theme."/layouts/".$key."_layout.html");
|
||||||
|
|
||||||
return $LAYOUT;
|
return $LAYOUT;
|
||||||
|
Reference in New Issue
Block a user