1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Added {THEME} shortcode (path) to core shortcodes.

This commit is contained in:
Cameron 2021-06-01 16:07:38 -07:00
parent 8023a2b9f6
commit 3a71366954
4 changed files with 10 additions and 4 deletions

View File

@ -0,0 +1,6 @@
<?php
function theme_shortcode($parm = null)
{
return THEME_ABS;
}

View File

@ -76,7 +76,7 @@ if (varset($e107_popup) != 1)
$psc = array( $psc = array(
'</body>' => '', '</body>' => '',
'{THEME}' => THEME_ABS, // '{THEME}' => THEME_ABS, // moved to e107_core/shortcodes/single/
'{---MODAL---}' => $LAYOUT['_modal_'], '{---MODAL---}' => $LAYOUT['_modal_'],
'{---HEADER---}' => $tp->parseTemplate('{HEADER}',true), '{---HEADER---}' => $tp->parseTemplate('{HEADER}',true),
'{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true) '{---FOOTER---}' => $tp->parseTemplate('{FOOTER}',true)

View File

@ -789,7 +789,7 @@ e107::getDebug()->logTime('Render Layout');
$psc = array( $psc = array(
'magicSC'=>array( 'magicSC'=>array(
'{THEME}' => THEME_ABS, // '{THEME}' => THEME_ABS, // moved to e107_core/shortcodes/single/
'{BODY_ONLOAD}' => $body_onload, '{BODY_ONLOAD}' => $body_onload,
'{LAYOUT_ID}' => 'layout-'.e107::getForm()->name2id(THEME_LAYOUT), '{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 'THEME_LAYOUT' => THEME_LAYOUT, // BC Fall-back: Catch and replace the missing constant- ony works with PHP < 8

View File

@ -1263,7 +1263,7 @@ class e_parse_shortcode
if (is_readable(e_CORE.'shortcodes/single/'.strtolower($code).'.php')) if (is_readable(e_CORE.'shortcodes/single/'.strtolower($code).'.php'))
{ {
$_function = strtolower($code).'_shortcode'; $_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'; $_path = e_CORE.'shortcodes/single/'.strtolower($code).'.php';
include_once($_path); 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 // SecretR - fix array(parm, sc_mode) causing parm to become an array, see issue 424
if(!method_exists($_class, $_function)) 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 else
{ {