Commit | Line | Data |
---|---|---|
e5d2c577 PS |
1 | <?php |
2 | // This file is part of Moodle - http://moodle.org/ | |
3 | // | |
4 | // Moodle is free software: you can redistribute it and/or modify | |
5 | // it under the terms of the GNU General Public License as published by | |
6 | // the Free Software Foundation, either version 3 of the License, or | |
7 | // (at your option) any later version. | |
8 | // | |
9 | // Moodle is distributed in the hope that it will be useful, | |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | // GNU General Public License for more details. | |
13 | // | |
14 | // You should have received a copy of the GNU General Public License | |
15 | // along with Moodle. If not, see <http://www.gnu.org/licenses/>. | |
16 | ||
17 | /** | |
18 | * This script prints basic CSS for the installer | |
19 | * | |
20 | * @package core | |
21 | * @subpackage install | |
22 | * @copyright 2011 Petr Skoda (http://skodak.org) | |
23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | |
24 | */ | |
25 | ||
26 | if (file_exists(dirname(dirname(__FILE__)).'/config.php')) { | |
27 | // already installed | |
28 | die; | |
29 | } | |
30 | ||
31 | // include only the necessary stuff from themes, keep this small otherwise IE will complain... | |
32 | $files = array( | |
33 | 'base/style/pagelayout.css', | |
34 | 'base/style/core.css', | |
35 | 'standard/style/core.css', | |
36 | 'standard/style/css3.css'); | |
37 | ||
38 | ||
39 | $content = ''; | |
40 | ||
41 | foreach($files as $file) { | |
42 | $content .= file_get_contents(dirname(dirname(__FILE__)).'/theme/'.$file) . "\n"; | |
43 | } | |
44 | ||
45 | $content .= " | |
46 | ||
47 | h2 { | |
48 | text-align:center; | |
49 | } | |
50 | ||
51 | #installdiv { | |
52 | width: 800px; | |
53 | margin-left:auto; | |
54 | margin-right:auto; | |
55 | } | |
56 | ||
57 | #installdiv dt { | |
58 | font-weight: bold; | |
59 | } | |
60 | ||
61 | #installdiv dd { | |
62 | padding-bottom: 0.5em; | |
63 | } | |
64 | ||
65 | .stage { | |
66 | margin-top: 2em; | |
67 | margin-bottom: 2em; | |
68 | width: 100%; | |
69 | padding:25px; | |
70 | } | |
71 | ||
72 | #installform { | |
73 | width: 100%; | |
74 | } | |
75 | ||
76 | #nav_buttons input { | |
77 | margin: 5px; | |
78 | } | |
79 | ||
80 | #envresult { | |
81 | text-align:left; | |
82 | width: auto; | |
83 | margin-left:10em; | |
84 | } | |
85 | ||
86 | #envresult dd { | |
87 | color: red; | |
88 | } | |
89 | ||
90 | .formrow { | |
91 | clear:both; | |
92 | text-align:left; | |
93 | padding: 8px; | |
94 | } | |
95 | ||
96 | .formrow label.formlabel { | |
97 | display:block; | |
98 | float:left; | |
99 | width: 260px; | |
100 | margin-right:5px; | |
101 | text-align:right; | |
102 | } | |
103 | ||
104 | .formrow .forminput { | |
105 | display:block; | |
106 | float:left; | |
107 | } | |
108 | ||
109 | fieldset { | |
110 | text-align:center; | |
111 | border:none; | |
112 | } | |
113 | ||
114 | .hint { | |
115 | display:block; | |
116 | clear:both; | |
117 | padding-left: 265px; | |
118 | color: red; | |
119 | } | |
120 | ||
121 | .configphp { | |
122 | text-align:left; | |
123 | background-color:white; | |
124 | padding:1em; | |
125 | width:95%; | |
126 | } | |
127 | ||
128 | .stage6 .stage { | |
129 | font-weight: bold; | |
130 | color: red; | |
131 | } | |
132 | ||
133 | "; | |
134 | ||
135 | // fix used urls | |
136 | $content = str_replace('[[pix:theme|hgradient]]', '../theme/standard/pix/hgradient.jpg', $content); | |
137 | $content = str_replace('[[pix:theme|vgradient]]', '../theme/standard/pix/vgradient.jpg', $content); | |
138 | ||
139 | @header('Content-Disposition: inline; filename="css.php"'); | |
140 | @header('Cache-Control: no-store, no-cache, must-revalidate'); | |
141 | @header('Cache-Control: post-check=0, pre-check=0', false); | |
142 | @header('Pragma: no-cache'); | |
143 | @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT'); | |
144 | @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | |
145 | @header('Accept-Ranges: none'); | |
146 | @header('Content-Type: text/css; charset=utf-8'); | |
147 | ||
148 | echo $content; |