From 6309ffc2726a14f6151213e0a94226817def5c1f Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 5 Feb 2006 08:23:34 +0000 Subject: [PATCH] moved template setting to get request fixed fontset array git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10636 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/style.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/style.php b/src/style.php index 21147873..5d75f008 100644 --- a/src/style.php +++ b/src/style.php @@ -6,6 +6,7 @@ * Used GET arguments: * @@ -22,18 +23,25 @@ define('SM_PATH','../'); require_once(SM_PATH . 'functions/global.php'); require_once(SM_PATH . 'functions/strings.php'); require_once(SM_PATH . 'config/config.php'); -# FIXME: remove it after template setting moved to get request -require_once(SM_PATH . 'include/load_prefs.php'); /* safety check for older config.php */ if (!isset($fontsets) || !is_array($fontsets)) { $fontsets=array(); } + /* template init */ /** start block copy from right_main.php */ include_once(SM_PATH . 'class/template/template.class.php'); +/* get template name and set used template directory */ +if (sqgetGlobalVar('templateid',$templateid,SQ_GET) && + file_exists(SM_PATH.'templates/'.basename($templateid).'/stylesheet.tpl')) { + $sTplDir = SM_PATH.'templates/'.basename($templateid).'/'; +} else { + $sTplDir = SM_PATH.'templates/default/'; +} + $oTemplate = new Template($sTplDir); /** end block copy */ @@ -153,7 +161,7 @@ define('SQM_ALIGN_RIGHT', $align['right']); if (sqgetGlobalVar('fontset',$fontset,SQ_GET) && isset($fontsets[$fontset])) { - $fontfamily=$fontsets[$fontset]['STYLE']; + $fontfamily=$fontsets[$fontset]; } else { $fontfamily=''; } @@ -172,7 +180,6 @@ if ( $lastmod = @filemtime($oTemplate->template_dir . 'stylesheet.tpl') ) { $gmlastmod = gmdate('D, d M Y H:i:s', $lastmod) . ' GMT'; header('Last-Modified: ' . $gmlastmod); } - $oTemplate->display('stylesheet.tpl'); ?> -- 2.25.1