From: stevetruckstuff Date: Wed, 4 Oct 2006 16:39:21 +0000 (+0000) Subject: First attempt at converting $color themes to CSS stylesheets. Seems to work pretty... X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=7e2ddf11abed8b8a93bc437fde95cfeba987a091;ds=sidebyside First attempt at converting $color themes to CSS stylesheets. Seems to work pretty well. This will need to be modified as CSS is cleaned up. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11823 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/themes/color_theme_to_css.php b/themes/color_theme_to_css.php new file mode 100755 index 00000000..b01e54a9 --- /dev/null +++ b/themes/color_theme_to_css.php @@ -0,0 +1,362 @@ +#!/usr/bin/env php + my_theme.css + * + * @copyright © 1999-2006 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package squirrelmail + * @subpackage templates + * @author Steve Brown + * @since 1.5.2 + */ + +if (empty($argv[1])) { + echo "Please provide the path to the file containing the \$color theme you\n" . + "wish to convert to a stylesheet.\n\n"; + exit (1); +} + +$theme_file = $argv[1]; +if (!is_file($theme_file) || !is_readable($theme_file)) { + echo "The requested theme could not be converted because the file could not\n" . + "be opened. Please specify a theme file that can be read.\n\n"; + exit(1); +} + +/* set default colors in case color theme is not full */ +$def_color = array(); +$def_color[0] = '#dcdcdc'; // (light gray) TitleBar +$def_color[1] = '#800000'; // (red) +$def_color[2] = '#cc0000'; // (light red) Warning/Error Messages +$def_color[3] = '#a0b8c8'; // (green-blue) Left Bar Background +$def_color[4] = '#ffffff'; // (white) Normal Background +$def_color[5] = '#ffffcc'; // (light yellow) Table Headers +$def_color[6] = '#000000'; // (black) Text on left bar +$def_color[7] = '#0000cc'; // (blue) Links +$def_color[8] = '#000000'; // (black) Normal text +$def_color[9] = '#ababab'; // (mid-gray) Darker version of #0 +$def_color[10] = '#666666'; // (dark gray) Darker version of #9 +$def_color[11] = '#770000'; // (dark red) Special Folders color +$def_color[12] = '#ededed'; // (light gray) Alternate color for message list +$def_color[13] = '#800000'; // (dark red) Color for quoted text -- > 1 quote +$def_color[14] = '#ff0000'; // (red) Color for quoted text -- >> 2 or more +$def_color[15] = '#002266'; // (dark blue) Unselectable folders +$def_color[16] = '#ff9933'; // (orange) Highlight color + +$color = $def_color; +include($theme_file); +if ($color === $def_color) { + echo "The theme file you specified did not make any alterations to the default\n" . + "color scheme. Please choose a different file.\n\n"; + exit(1); +} + +$css_source = << \ No newline at end of file