$used_fontset = (!empty($chosen_fontset) ? $chosen_fontset : $default_fontset);
$used_fontsize = (!empty($chosen_fontsize) ? $chosen_fontsize : $default_fontsize);
- $used_theme = !isset($chosen_theme) && $user_theme_default != 'none' ? $user_themes[$user_theme_default]['PATH'].'/default.css' : $chosen_theme_path;
+ $used_theme = !isset($chosen_theme) && $user_theme_default != 'none' && is_dir($chosen_theme) && is_readable($chosen_theme)? $user_themes[$user_theme_default]['PATH'].'/default.css' : $chosen_theme_path;
/**
* Stylesheets are loaded in the following order:
// 2. Option user-defined stylesheet from preferences.
if (!empty($used_theme)) {
/**
- * User styles just point to a directory, so we need to include all .css
- * files in that directory. Template themes point to a specific stylesheet,
- * so we simply include it.
+ * All styles just point to a directory, so we need to include all .css
+ * files in that directory.
*/
- if (is_dir($used_theme)) {
- $styles = list_files($used_theme, '.css');
- foreach ($styles as $sheet) {
- $aUserStyles[] = $used_theme .'/'.$sheet;
- }
- } else {
- $aUserStyles[] = $used_theme;
+ $styles = list_files($used_theme, '.css');
+ foreach ($styles as $sheet) {
+ $aUserStyles[] = $used_theme .'/'.$sheet;
}
}
if ($do_hook) {
// NOTE! plugins here must assign output to template
// and NOT echo anything directly!!
- do_hook('generic_header');
+ global $null;
+ do_hook('generic_header', $null);
}
$header_tags .= $xtra;
* @param string target the target frame for this link
*/
function makeInternalLink($path, $text, $target='') {
- global $base_uri;
+ global $base_uri, $oTemplate;
// sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
- if ($target != '') {
- $target = " target=\"$target\"";
- }
// This is an inefficient hook and is only used by
// one plugin that still needs to patch this code,
// here just in case we find a good (non-visual?)
// use for the internal_link hook.
//
- //$hooktext = do_hook_function('internal_link',$text);
- //if ($hooktext != '')
- // $text = $hooktext;
+ //do_hook('internal_link', $text);
- return '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
+ return create_hyperlink($base_uri . $path, $text, $target);
}
/**