Updates in SmartyExtend set var calls

Removed cms object from Frontend and replaced with optional smarty data
array (HEADER, DATA, DEBUG_DATA)
Updated admin call that if $cms is given above data will be extracted.
Added a CONTENT_PATH option for admin, must be set if $cms is set
Is used for the adbTopMenu call
Moved the $cms global check and trigger to the admin call branch only
This commit is contained in:
Clemens Schwaighofer
2023-03-13 11:29:21 +09:00
parent d56ee68482
commit fc57aabf5d
3 changed files with 64 additions and 27 deletions

View File

@@ -46,6 +46,14 @@ $smarty = new CoreLibs\Template\SmartyExtend(
CACHE_ID,
COMPILE_ID,
);
$adm = new CoreLibs\Admin\Backend(
new CoreLibs\DB\IO(DB_CONFIG, $log),
$log,
new CoreLibs\Create\Session(EDIT_SESSION_NAME),
$l10n,
80
);
$adm->DATA['adm_set'] = 'SET from admin class';
$PAGE_NAME = 'TEST CLASS: SMARTY';
print "<!DOCTYPE html>";
@@ -146,8 +154,10 @@ $smarty->setSmartyVarsAdmin(
'admin_stylesheet' => ADMIN_STYLESHEET,
'admin_javascript' => ADMIN_JAVASCRIPT,
'page_width' => PAGE_WIDTH,
'content_path' => CONTENT_PATH,
'user_name' => $_SESSION['USER_NAME'] ?? ''
]
],
$adm
);
// error message