1
I am trying to include a different admin navigation theme file depending on the permissions of the administration group logged into the backend area. I tried doing the code with just smarty but had difficulty, so I thought I could make it happen using php. However, when I try and include a file containing smarty code, it doesnt render it correctly - the smart code in the included files gets displayed to the browser.
What am I doing wrong, and also, how could the below be performed using just smarty coding?
Quote:
<{php}>
global $xoopsUser;
if ($xoopsUser) {
$groups = $xoopsUser->getGroups();
$special_group_id = 4;
if (in_array($special_group_id,$groups)) {
include("../../themes/default/navigation/theme_adminnav_special.html");
} else {
include("../../themes/default/navigation/theme_adminnav.html");
}
}
<{/php}>
Note, I also had to use relative paths to include the theme files which doesnt seem right - smarty includes them like
<{include file="default/navigation/theme_adminnav.html"}>