X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstyle.php;h=1e2334a700a27e5f2a80afcca9c613256710768f;hb=c8bd2d5acd59c8ab335a7c75ded5bf15bda79d4a;hp=15853436392be0f1204f811ae1623cb7f497aeab;hpb=f549a7069891846f86ee287bc3afd09f47fbf8b9;p=squirrelmail.git diff --git a/src/style.php b/src/style.php index 15853436..1e2334a7 100644 --- a/src/style.php +++ b/src/style.php @@ -16,27 +16,29 @@ * @package squirrelmail */ -/** @ignore */ -define('SM_PATH','../'); +/** + * Set the location in order to skip unneeded validation and other includes + * in the SquirrelMail initialisation file. + */ +$sInitLocation = 'style'; -/* SquirrelMail required files. */ -require_once(SM_PATH . 'functions/global.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'config/config.php'); +/** + * Include the SquirrelMail initialization file. + */ +require('../include/init.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')) { +/** + * get template name and set used template directory + * + * Existing file check has been moved into the template object, so it is + * not neccesary to do file_exists() here. + * */ +if (sqgetGlobalVar('templateid',$templateid,SQ_GET)) { $sTplDir = SM_PATH.'templates/'.basename($templateid).'/'; } else { $sTplDir = SM_PATH.'templates/default/'; @@ -177,4 +179,10 @@ if ( $lastmod = @filemtime($oTemplate->template_dir . 'stylesheet.tpl') ) { } $oTemplate->display('stylesheet.tpl'); -?> +/** + * Include any additional stylesheets provided by the template + */ +$template_css = $oTemplate->getAdditionalStyleSheets(); +foreach ($template_css as $stylesheet) { + $oTemplate->display($stylesheet); +}