Example #1
0
        if ($aTemplateSet[$i]['ID'] == $sTemplateID) {
            $found_templateset = true;
            break;
        }
    }
}
// FIXME: do we need/want to check here for actual presence of template sets?
// selected template not available, fall back to default template
//
if (!$found_templateset) {
    $sTemplateID = $sDefaultTemplateID;
}
// need to build this object now because it is used below to validate
// user css theme choice
//
$oTemplate = Template::construct_template($sTemplateID);
// Make sure the chosen theme is a legitimate one.
//
// need to adjust $chosen_theme path with SM_PATH
$chosen_theme_path = preg_replace("/(\\.\\.\\/){1,}/", SM_PATH, $chosen_theme_path);
$found_theme = false;
while (!$found_theme && (list($index, $data) = each($user_themes))) {
    if ($data['PATH'] == $chosen_theme_path) {
        $found_theme = true;
    }
}
if (!$found_theme) {
    $template_themes = $oTemplate->get_alternative_stylesheets(true);
    while (!$found_theme && (list($path, $name) = each($template_themes))) {
        if ($path == $chosen_theme_path) {
            $found_theme = true;