2 /************************************************************************
3 * MXChange v0.2.1 Start: 08/29/2003 *
4 * =============== Last change: 12/03/2004 *
6 * -------------------------------------------------------------------- *
7 * File : stylesheet.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Stylesheets are stored here *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Style-Sheets werden hier abgelegt *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
45 // Add stylesheet for installation
46 if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (REQUEST_ISSET_GET(('installing')))) $STYLES[] = "install.css";
48 // When no CSS output-mode is set, set it to file-output
49 if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', "FILE");
51 // Output CSS files or content or link to css.php ?
52 if (($GLOBALS['output_mode'] == "1") || (getConfig('css_php') == "DIRECT")) {
54 $STYLES = merge_array($STYLES, EXT_GET_CSS_FILES());
56 // Output inclusion lines
57 foreach ($STYLES as $value) {
58 // Only include found CSS files (to reduce 404 requests)
59 $BASE = sprintf("%stheme/%s/css/", constant('PATH'), GET_CURR_THEME());
62 // Do include only existing files and whose are not empty
63 if ((FILE_READABLE($FQFN)) && (filesize($FQFN) > 0)) {
64 switch (getConfig('css_php')) {
66 OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"{!URL!}/theme/".GET_CURR_THEME()."/".$value."\" />");
70 OUTPUT_HTML(READ_FILE($FQFN));
76 // Now we load all CSS files from css.php!
77 OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"{!URL!}/css.php", false);
78 if (isBooleanConstantAndTrue('mxchange_installing')) {
79 // Default theme first
80 $NEW_THEME = "default";
81 if (REQUEST_ISSET_GET(('theme'))) $NEW_THEME = SQL_ESCAPE(REQUEST_GET('theme'));
82 if (REQUEST_ISSET_POST(('theme'))) $NEW_THEME = SQL_ESCAPE(REQUEST_POST('theme'));
83 OUTPUT_HTML("?theme=".$NEW_THEME."&installing=1", false);