2 /************************************************************************
\r
3 * MXChange v0.2.1 Start: 08/29/2003 *
\r
4 * =============== Last change: 12/03/2004 *
\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
14 * -------------------------------------------------------------------- *
\r
15 * Copyright (c) 2003 - 2007 by Roland Haeder *
\r
16 * For more information visit: http://www.mxchange.org *
\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
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
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
34 // Some security stuff...
\r
35 if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
\r
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
\r
46 // Add stylesheet for installation
\r
47 if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!mxchange_installed) || (isset($_GET['installing']))) $STYLES[] = "install.css";
\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
52 // Output CSS files or content or link to css.php ?
\r
53 if (($CSS == "1") || ($CONFIG['css_php'] == "DIRECT"))
\r
56 if (is_array($EXT_CSS_FILES))
\r
58 // Load extension's CSS files
\r
59 foreach ($EXT_CSS_FILES as $value) $STYLES[] = $value;
\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
70 // Output inclusion lines
\r
71 foreach ($STYLES as $value)
\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
79 switch ($CONFIG['css_php'])
\r
82 OUTPUT_HTML ("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/".$BASE."\">");
\r
86 $load = implode("", file($file));
\r
87 OUTPUT_HTML ($load);
\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
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."&installing=1", false);
\r
105 OUTPUT_HTML ("\">");
\r