From 3a7136695435ffb04923e86531e75970e734ccca Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 1 Jun 2021 16:07:38 -0700 Subject: [PATCH] Added {THEME} shortcode (path) to core shortcodes. --- e107_core/shortcodes/single/theme.php | 6 ++++++ e107_core/templates/footer_default.php | 2 +- e107_core/templates/header_default.php | 2 +- e107_handlers/shortcode_handler.php | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 e107_core/shortcodes/single/theme.php diff --git a/e107_core/shortcodes/single/theme.php b/e107_core/shortcodes/single/theme.php new file mode 100644 index 000000000..75d46702a --- /dev/null +++ b/e107_core/shortcodes/single/theme.php @@ -0,0 +1,6 @@ +' => '', - '{THEME}' => THEME_ABS, + // '{THEME}' => THEME_ABS, // moved to e107_core/shortcodes/single/ '{---MODAL---}' => $LAYOUT['_modal_'], '{---HEADER---}' => $tp->parseTemplate('{HEADER}',true), '{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true) diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 40f46d027..0993e0a10 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -789,7 +789,7 @@ e107::getDebug()->logTime('Render Layout'); $psc = array( 'magicSC'=>array( - '{THEME}' => THEME_ABS, + // '{THEME}' => THEME_ABS, // moved to e107_core/shortcodes/single/ '{BODY_ONLOAD}' => $body_onload, '{LAYOUT_ID}' => 'layout-'.e107::getForm()->name2id(THEME_LAYOUT), 'THEME_LAYOUT' => THEME_LAYOUT, // BC Fall-back: Catch and replace the missing constant- ony works with PHP < 8 diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index 12aea68fb..a076e9580 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -1263,7 +1263,7 @@ class e_parse_shortcode if (is_readable(e_CORE.'shortcodes/single/'.strtolower($code).'.php')) { $_function = strtolower($code).'_shortcode'; - $_class = strtolower($code); + $_class = ($code === 'sitelinks_alt') ? sitelinks_alt : null; // all others are plain functions. $_path = e_CORE.'shortcodes/single/'.strtolower($code).'.php'; include_once($_path); @@ -1274,7 +1274,7 @@ class e_parse_shortcode // SecretR - fix array(parm, sc_mode) causing parm to become an array, see issue 424 if(!method_exists($_class, $_function)) { - trigger_error($_function." doesn't exist in ".$_path, E_USER_NOTICE); + trigger_error("Method ".$_function." doesn't exist in class ".$_class." within file ".$_path); } else {