- obsolete templates/scripts removed
[mailer.git] / 0.2.1 / inc / stylesheet.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 08/29/2003 *\r
4  * ===============                              Last change: 12/03/2004 *\r
5  *                                                                      *\r
6  * -------------------------------------------------------------------- *\r
7  * File              : stylesheet.php                                   *\r
8  * -------------------------------------------------------------------- *\r
9  * Short description : Stylesheets are stored here                      *\r
10  * -------------------------------------------------------------------- *\r
11  * Kurzbeschreibung  : Style-Sheets werden hier abgelegt                *\r
12  * -------------------------------------------------------------------- *\r
13  *                                                                      *\r
14  * -------------------------------------------------------------------- *\r
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *\r
16  * For more information visit: http://www.mxchange.org                  *\r
17  *                                                                      *\r
18  * This program is free software; you can redistribute it and/or modify *\r
19  * it under the terms of the GNU General Public License as published by *\r
20  * the Free Software Foundation; either version 2 of the License, or    *\r
21  * (at your option) any later version.                                  *\r
22  *                                                                      *\r
23  * This program is distributed in the hope that it will be useful,      *\r
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
26  * GNU General Public License for more details.                         *\r
27  *                                                                      *\r
28  * You should have received a copy of the GNU General Public License    *\r
29  * along with this program; if not, write to the Free Software          *\r
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
31  * MA  02110-1301  USA                                                  *\r
32  ************************************************************************/\r
33 \r
34 // Some security stuff...\r
35 if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))\r
36 {\r
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";\r
38         require($INC);\r
39 }\r
40 \r
41 // Default styles\r
42 $STYLES = array(\r
43                 "general.css",\r
44 );\r
45 \r
46 // Add stylesheet for installation\r
47 if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!mxchange_installed) || (isset($_GET['installing']))) $STYLES[] = "install.css";\r
48 \r
49 // When no CSS output-mode is set, set it to file-output\r
50 if (empty($CONFIG['css_php'])) $CONFIG['css_php'] = "FILE";\r
51 \r
52 // Output CSS files or content or link to css.php ?\r
53 if (($CSS == "1") || ($CONFIG['css_php'] == "DIRECT"))\r
54 {\r
55         // Load CSS files\r
56         if (is_array($EXT_CSS_FILES))\r
57         {\r
58                 // Load extension's CSS files\r
59                 foreach ($EXT_CSS_FILES as $value) $STYLES[] = $value;\r
60         }\r
61 \r
62         // Create missing configuration file\r
63         if (!function_exists('GET_CURR_THEME')) {\r
64                 // Dummy for e.g. down database links\r
65                 function GET_CURR_THEME () {\r
66                         return "default";\r
67                 }\r
68         }\r
69 \r
70         // Output inclusion lines\r
71         foreach ($STYLES as $value)\r
72         {\r
73                 // Only include found CSS files (to reduce 404 requests)\r
74                 $BASE = PATH."theme/".GET_CURR_THEME()."/css/";\r
75                 $file = $BASE.$value;\r
76                 // Do include only existing files and whose are not empty\r
77                 if ((file_exists($file)) && (filesize($file) > 0))\r
78                 {\r
79                         switch ($CONFIG['css_php'])\r
80                         {\r
81                         case "DIRECT":\r
82                                 OUTPUT_HTML ("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/".$BASE."\">");\r
83                                 break;\r
84 \r
85                         case "FILE":\r
86                                 $load = implode("", file($file));\r
87                                 OUTPUT_HTML ($load);\r
88                                 break;\r
89                         }\r
90                 }\r
91         }\r
92 }\r
93  else\r
94 {\r
95         // Now we load all CSS files from css.php!\r
96         OUTPUT_HTML ("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/css.php", false);\r
97         if (mxchange_installing)\r
98         {\r
99                 // Default theme first\r
100                 $NEW_THEME = "default";\r
101                 if (!empty($_GET['theme'])) $NEW_THEME = $_GET['theme'];\r
102                 if (!empty($_POST['theme'])) $NEW_THEME = $_POST['theme'];\r
103                 OUTPUT_HTML ("?theme=".$NEW_THEME."&amp;installing=1", false);\r
104         }\r
105         OUTPUT_HTML ("\">");\r
106 }\r
107 \r
108 //\r
109 ?>\r