/
config-form.html
292 lines (257 loc) · 14.6 KB
/
config-form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>SilverStripe CMS / Framework Installation</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="sapphire/thirdparty/jquery/jquery.js"></script>
<script type="text/javascript" src="sapphire/dev/install/install.js"></script>
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css">
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css">
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css">
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/install.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<div id="BgContainer">
<div id="Container">
<div id="Header">
<h1>SilverStripe CMS / Framework Installation</h1>
<p>Version <?php echo $silverstripe_version; ?></p>
</div>
<div id="Navigation"> </div>
<div class="clear"><!-- --></div>
<div id="Layout">
<div class="typography">
<p>Thanks for choosing to use SilverStripe! Please follow the instructions below and you should be up in running in no time.<br>
If you get stuck, head over to the <a href="http://www.silverstripe.org/installing-silverstripe" target="_blank">installation forum</a>, or check out our <a href="http://doc.silverstripe.org/doku.php?id=suggested-web-hosts" target="_blank">list of suggested web hosts</a> known to work with SilverStripe.
</p>
<form action="install.php" method="post">
<?php if(isset($hasErrorOtherThanDatabase)) { ?>
<p class="error">
You aren't currently able to install the software. Please <a href="#requirements">see below</a> for details.<br>
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.org/doku.php?id=server-requirements">server requirements wiki page</a>.
</p>
<?php } else { ?>
<?php if($req->hasWarnings()) { ?>
<p class="warning">
There are some issues that we recommend you look at before installing, however, you are still able to install the software.
Please see below for details.<br>
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.org/doku.php?id=server-requirements">server requirements wiki page</a>.
</p>
<?php } else if(!$dbReq->hasErrors() && !$adminReq->hasErrors()) { ?>
<p class="goodInstall"><em class="inlineBarText">You're ready to install! Please confirm the configuration options below.</em> <a href="#install">Install SilverStripe</a></p>
<?php } ?>
<?php if($dbReq->hasErrors()) { ?>
<p class="error">
The database details don't appear to be correct. Please <a href="#database_credentials">review and correct</a> before installing.
</p>
<?php } ?>
<?php if($adminReq->hasErrors()) { ?>
<p class="error">
Please <a href="#AdminAccount">enter an email address and password</a> for the default administrator account before installing.
</p>
<?php } ?>
<?php } ?>
<h4 id="requirements"><em class="inlineBarText">Requirements</em> <span>Step: 1 of 5</span></h4>
<?php $req->showTable(); ?>
<p>
Read more about our <a href="http://doc.silverstripe.org/doku.php?id=server-requirements" target="_blank">server requirements</a>.
</p>
<div class="action">
<input type="submit" class="action" value="Re-check requirements">
</div>
<h4 class="sectionHeading"><em class="inlineBarText">Database</em> <span>Step: 2 of 5</span></h4>
<div id="database_credentials" class="section">
<?php $dbReq->showTable("Database Configuration"); ?>
<p id="dbHelp" class="helpText">
SilverStripe stores its content in a relational SQL database. Please provide the username and password to connect to the server here.
If this account has permission to create databases, then we will create the database for you; otherwise, you must give the name of a
database that already exists.<br><br>
<strong>Other databases:</strong><br>
Databases in the list that are greyed out cannot currently be used. Click on them for more information and possible remedies.
</p>
<div class="fields">
<div class="field">
<ul id="database_selection">
<?php
foreach($databaseClasses as $class => $details) {
$checked = ($databaseConfig['type'] == $class || $type == $class) ? ' checked="checked"' : '';
$disabled = $help = '';
if($usingEnv) {
// All are disabled by default when environment is used
$disabled = 'disabled="disabled"';
// If SS_DATABASE_CLASS is specified, check the database in the list
if(defined('SS_DATABASE_CLASS') && SS_DATABASE_CLASS == $class) {
$checked = ' checked="checked"';
}
} else {
$disabled = !$details['supported'] || !$details['hasModule'] ? 'notavailable="true"' : '';
if ($disabled) {
if (!$details['supported'] && !$details['hasModule']) {
$help = 'PHP does not have the required extension, and SilverStripe does not have the correct module installed';
$helpText = '<li style="width:auto">'.$details['missingExtensionText'].'</li>';
$helpText .= '<li style="width:auto">'.$details['missingModuleText'].'</li>';
} else if ($details['supported'] && !$details['hasModule']) {
$help = 'PHP has the required extension, but SilverStripe is missing the module';
$helpText = '<li style="width:auto">'.$details['missingModuleText'].'</li>';
} else if (!$details['supported'] && $details['hasModule']) {
$help = 'SilverStripe has the module installed, but PHP is missing the required extension';
$helpText = '<li style="width:auto">'.$details['missingExtensionText'].'</li>';
}
$help .= "<ul>$helpText</ul>";
}
}
echo "<li>";
echo "<input id=\"$class\" class=\"databaseClass\" type=\"radio\" name=\"db[type]\" value=\"$class\"$checked $disabled>";
echo "<label class=\"left\" ".($help || $disabled ? 'style="font-weight:normal;color:grey" ' : 'style="color:green"')."for=\"$class\">{$details['title']}</label>";
if ($help) {
echo '<div class="error databaseError">'.$help.'</div>';
}
// generate db-specific config fields
echo '<div class="dbfields">';
if(isset($details['fields'])) foreach($details['fields'] as $fieldName => $fieldSpec) {
$fieldTitle = $fieldSpec['title'];
// values
$defaultValue = (isset($fieldSpec['default'])) ? $fieldSpec['default'] : null;
if($usingEnv && isset($fieldSpec['envVar']) && defined($fieldSpec['envVar'])) {
$value = constant($fieldSpec['envVar']);
} else {
$value = (isset($databaseConfig[$fieldName])) ? $databaseConfig[$fieldName] : $defaultValue;
}
// attributes
$attrs = array(
'id' => "db_{$class}_{$fieldName}",
'class' => 'text',
'type' => 'text',
'name' => "db[$class][$fieldName]",
'value' => $value,
);
if($usingEnv && isset($fieldSpec['envVar']) && defined($fieldSpec['envVar'])) {
$attrs['disabled'] = 'disabled';
}
if(isset($fieldSpec['envVar'])) {
$attrs['class'] .= ' configured-by-env';
}
$attrHTML = '';
foreach($attrs as $attrName => $attrValue) $attrHTML .= "$attrName=\"$attrValue\" ";
if(isset($fieldSpec['attributes'])) $attrs = array_merge($attrs, $fieldSpec['attributes']);
// html
echo "<div class=\"field\">";
echo "<label for=\"db_$class_$fieldName\">$fieldTitle:</label>";
echo "<span class=\"middleColumn\">";
echo "<input $attrHTML>";
echo "</span>";
echo "</div>";
}
echo '</div>';
echo "</li>";
}
?>
</ul>
<?php if($envFileExists) { ?>
<div id="use_environment_field" class="field">
<input id="use_environment" type="checkbox" name="useEnv" <?php if($usingEnv) echo "checked=\"checked\"" ?>>
<label for="use_environment">Use _ss_environment file for configuration (<a href="http://doc.silverstripe.org/doku.php?id=environment-management" target="_blank">?</a>)</label>
</div>
<?php } ?>
</div>
<div class="action">
<input type="submit" class="action" value="Re-check requirements">
</div>
</div>
</div>
<div class="clear"><!-- --></div>
<h4><em class="inlineBarText">CMS Admin Account</em> <span>Step: 3 of 5</span></h4>
<div id="AdminAccount" class="section">
<div class="fieldGroup">
<p class="helpText">We will set up the first administrator account for you automatically. You can change these details later in the "Security" section within the CMS.</p>
<div class="field">
<label for="admin_username">Email:</label>
<span class="middleColumn">
<input type="text" class="text configured-by-env" name="admin[username]" id="admin_username" value="<?php echo $adminConfig['username']; ?>" <?php if($usingEnv && defined('SS_DEFAULT_ADMIN_USERNAME')) echo 'disabled="disabled"' ?>>
</span>
</div>
<div class="field">
<label for="admin_password">Password:</label>
<span class="middleColumn">
<input type="password" class="text configured-by-env" name="admin[password]" id="admin_password" value="<?php echo $adminConfig['password']; ?>" <?php if($usingEnv && defined('SS_DEFAULT_ADMIN_PASSWORD')) echo 'disabled="disabled"' ?>>
</span>
</div>
</div>
<div class="fieldGroup">
<p class="helpText">
"Default language" determines the default locale settings
(for dates, currencies, etc.), as well as the default language
of the CMS interface. This can be changed for each user.
<br><br>
Warning: The CMS interface may be missing translations in certain locales.
</p>
<div class="field">
<label for="locale">Default language:</label>
<span class="middleColumn">
<select name="locale" id="locale">
<?php
$selectedLocale = isset($_POST['locale']) ? $_POST['locale'] : $defaultLocale;
foreach($locales as $code => $details) {
$selected = $code == $selectedLocale ? ' selected="true"' : '';
echo "<option$selected value=\"$code\">{$details[0]} - {$details[1]}</option>\n";
}
?>
</select>
</span>
</div>
</div>
</div>
<h4><em class="inlineBarText">Theme</em> <span>Step: 4 of 5</span></h4>
<p class="helpText">You can change the theme or <a href="http://silverstripe.org/themes">download</a> another from the SilverStripe website after installation.</p>
<div class="field">
<ul id="Themes">
<li><input type="radio" name="template" value="blackcandy" id="BlackCandy" <?php if(!isset($_POST['template']) || $_POST['template'] == 'blackcandy') {?>checked="checked"<?php }?>><label for="BlackCandy"><a href="http://silverstripe.org/blackcandy/">BlackCandy</a> - our default theme ready to use.</label></li>
<li><input type="radio" name="template" value="tutorial" id="EmptyTemplate" <?php if(isset($_POST['template']) && $_POST['template'] == 'tutorial') {?>checked="checked"<?php }?>><label for="EmptyTemplate">Empty template - ready to begin the <a href="http://doc.silverstripe.org/doku.php?id=tutorials" target="_blank">tutorial</a>.</label></li>
</ul>
</div>
<h4 id="install"><em class="inlineBarText">Confirm Install</em> <span>Step: 5 of 5</span></h4>
<?php if(isset($hasErrorOtherThanDatabase)) { ?>
<p class="error">
You aren't currently able to install the software. Please <a href="#requirements">see above</a> for details.<br>
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.org/doku.php?id=server-requirements">server requirements wiki page</a>.
</p>
<?php } else { ?>
<p id="stats-container">
<input type="checkbox" id="stats" name="stats" checked="checked">
<label for="stats">Send information about my webserver to silverstripe.org<br />
<small>(anonymous version information, used for statistical purposes)</small>
</label><p>
<?php if($alreadyInstalled) { ?>
<p class="warning">
<strong>Note:</strong> It seems as though SilverStripe is already installed here.<br />
If you ask me to install, I will overwrite the <strong>.htaccess</strong> and <strong>mysite/_config.php</strong> files.
<br />
<input type="checkbox" id="ReIn" name="force_reinstall"><label for="ReIn">That's okay, please re-install SilverStripe and overwrite these files.</label>
</p>
<?php } ?>
<p>
<?php if($alreadyInstalled) { ?>
<input id="install_button" type="submit" disabled="disabled" class="action" name="go" value="Install SilverStripe">
<?php } else { ?>
<input id="install_button" type="submit" class="action" name="go" value="Install SilverStripe">
<?php } ?>
<span id="saving_top" style="display: none">
<img src="cms/images/network-save.gif">
(this will take a minute or so)
</span>
</p>
<?php } ?>
</form>
</div>
</div>
<div class="clear"><!-- --></div>
</div>
<div id="Footer">
<div class="footerTop"><!-- --></div>
<p><a href="http://www.silverstripe.org">SilverStripe Open Source CMS / Framework</a> | Copyright © 2010 SilverStripe Limited</p>
</div>
</div>
</body>
</html>