X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstyle.php;h=9715a4387a698f2fbf6e217a0bb0b923ce0addf3;hb=fc58ac3cc45bbf2a1de28adadb9f3bed8ccbe39e;hp=2a6ec0144a4f235331c9653f6002ac3cd6dcbb1f;hpb=f46db954f633d93b3d1684fb27605dd830fbd2e7;p=squirrelmail.git diff --git a/src/style.php b/src/style.php index 2a6ec014..9715a438 100644 --- a/src/style.php +++ b/src/style.php @@ -14,17 +14,14 @@ *
  • fontsize - integer, sets selected font size *
  • dir - string, sets text direction variables. Possible values 'rtl' or 'ltr' * - * @copyright © 2005-2006 The SquirrelMail Project Team + * @copyright 2005-2015 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ -/** - * Set the location in order to skip unneeded validation and other includes - * in the SquirrelMail initialisation file. - */ -$sInitLocation = 'style'; +/** This is the style page */ +define('PAGE_NAME', 'style'); /** * Include the SquirrelMail initialization file. @@ -38,9 +35,9 @@ if (!isset($fontsets) || !is_array($fontsets)) { /** - * The collowing code should no longer be neccesary, but it will remain for the + * The following code should no longer be neccesary, but it will remain for the * time being, just in case. - * + * * TODO: Remove if no longer needed. **/ /* set default colors in case color theme is not full */ @@ -146,7 +143,7 @@ if (! sqgetGlobalVar('fontsize',$fontsize,SQ_GET)) { $fontsize = (int) $fontsize; } -header('Content-Type: text/css'); +$oTemplate->header('Content-Type: text/css'); /** * GOTCHA #1: When sending the headers for caching, we must send Expires, * Last-Modified, Pragma, and Cache-Control headers. If we don't PHP @@ -171,23 +168,36 @@ IDEA: So ask the Template class object to return the mtime or better yet, the fu * only need to refresh the cache if one of the font prefs changes. * Possibly some type of "force nocache flag could be set if a font pref is * changed? - * + * + * Response: Perhaps, if that can be implemented great, but I think the + * user prefs solution would definitely work: catch the font setting change + * in a custom save() routine from user prefs and away we go. + * * TODO: Fix this. :) - * */ + */ if ( $lastmod = @filemtime(SM_PATH . $oTemplate->get_template_file_directory() . 'css/stylesheet.tpl') ) { $gmlastmod = gmdate('D, d M Y H:i:s', $lastmod) . ' GMT'; $expires = gmdate('D, d M Y H:i:s', strtotime('+1 week')) . ' GMT'; - header('Last-Modified: ' . $gmlastmod); - header('Expires: '. $expires); - header('Pragma: '); - header('Cache-Control: public, must-revalidate'); + $oTemplate->header('Last-Modified: ' . $gmlastmod); + $oTemplate->header('Expires: '. $expires); + $oTemplate->header('Pragma: '); + $oTemplate->header('Cache-Control: public, must-revalidate'); } +// Steve, why did you remove this? Is it irrelevant now? If so, let's +// remove the rest of the references to it here (note that it is being +// used above in the filetime() statement) and elsewhere +// $oTemplate->display('css/stylesheet.tpl'); + +// don't show version as a security measure +//$oTemplate->header('X-Powered-By: SquirrelMail/' . SM_VERSION, FALSE); +$oTemplate->header('X-Powered-By: SquirrelMail', FALSE); /** - * Additional styles are now handled by adding stylesheets to $sTplDir/css/, - * so here, we simply define some basic styles based on user prefs. + * Additional styles are now handled by adding stylesheets to + * templates/