MDL-14924 language autorefresh and starting to reimplement welcome.html support ...
[moodle.git] / install.php
CommitLineData
8b5b1028 1<?php /// $Id$
2 /// install.php - helps admin user to create a config.php file
3
8b5b1028 4
3b093310 5if (isset($_REQUEST['lang'])) {
6 $lang = eregi_replace('[^A-Za-z0-9_-]', '', $_REQUEST['lang']);
8b5b1028 7} else {
3b093310 8 $lang = 'en_utf8';
8b5b1028 9}
10
3b093310 11if (isset($_REQUEST['admin'])) {
12 $admin = eregi_replace('[^A-Za-z0-9_-]', '', $_REQUEST['admin']);
13} else {
14 $admin = 'admin';
8b5b1028 15}
16
3b093310 17/// If config.php exists we just created config.php and need to redirect to continue installation
18$configfile = './config.php';
19if (file_exists($configfile)) {
20 header("Location: $admin/index.php?lang=$lang");
21 die;
d36afd6d 22}
8d783716 23
3b093310 24/// make sure PHP errors are displayed - helps with diagnosing of problems
25@error_reporting(E_ALL);
26@ini_set('display_errors', '1');
27// we need a lot of memory
28@ini_set('memory_limit', '40M');
29
30/// Check that PHP is of a sufficient version
31if (version_compare(phpversion(), "5.2.0") < 0) {
32 $phpversion = phpversion();
33 // do NOT localise - lang strings would not work here and we CAN not move it after installib
34 echo "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion). ";
35 echo "Please upgrade your server software or install latest Moodle 1.9.x instead.";
36 die;
8b5b1028 37}
38
3b093310 39require dirname(__FILE__).'/lib/installlib.php';
bd507453 40
3b093310 41// TODO: add lang detection here if empty $_REQUEST['lang']
3b3b8029 42
3b093310 43$config = new stdClass();
44$config->lang = $lang;
3b3b8029 45
3b093310 46if (!empty($_POST)) {
47 if (install_ini_get_bool('magic_quotes_gpc')) {
fa53493e 48 $_POST = array_map('stripslashes', $_POST);
3b093310 49 }
3b3b8029 50
3b093310 51 $config->stage = (int)$_POST['stage'];
56ca1c60 52
3b093310 53 if (isset($_POST['previous'])) {
54 $config->stage--;
55 if ($config->stage == INSTALL_ENVIRONMENT or $config->stage == INSTALL_DOWNLOADLANG) {
56 $config->stage--;
56ca1c60 57 }
3b093310 58 } else if (isset($_POST['next'])) {
59 $config->stage++;
d36afd6d 60 }
3b3b8029 61
3b093310 62 $config->dbtype = trim($_POST['dbtype']);
63 $config->dbhost = trim($_POST['dbhost']);
64 $config->dbuser = trim($_POST['dbuser']);
65 $config->dbpass = trim($_POST['dbpass']);
66 $config->dbname = trim($_POST['dbname']);
67 $config->prefix = trim($_POST['prefix']);
68 $config->dbsocket = (int)(!empty($_POST['dbsocket']));
3b3b8029 69
3b093310 70 $config->dirroot = trim($_POST['dirroot']);
71 $config->admin = empty($_POST['admin']) ? 'admin' : trim($_POST['admin']);
53a0367d 72
3b093310 73 $config->dataroot = trim($_POST['dataroot']);
d36afd6d 74
3b3b8029 75} else {
3b093310 76 $config->stage = INSTALL_WELCOME;
8b5b1028 77
3b093310 78 $config->dbtype = '';
79 $config->dbhost = 'localhost';
80 $config->dbuser = '';
81 $config->dbpass = '';
82 $config->dbname = 'moodle';
83 $config->prefix = 'mdl_';
84 $config->dbsocket = 0;
53a0367d 85
3b093310 86 $config->dirroot = dirname(__FILE__);
87 $config->admin = 'admin';
8b5b1028 88
3b093310 89 $config->dataroot = null; // initialised later after including libs
90}
8b5b1028 91
92/// Fake some settings so that we can use selected functions from moodlelib.php and weblib.php
3b093310 93$CFG = new stdClass();
94$CFG->lang = $config->lang;
95$CFG->dirroot = dirname(__FILE__);
96$CFG->libdir = "$CFG->dirroot/lib";
97$CFG->wwwroot = install_guess_wwwroot(); // can not be changed - ppl must use the real address when installing
98$CFG->httpswwwroot = $CFG->wwwroot;
99$CFG->httpsthemewww = $CFG->wwwroot;
100$CFG->dataroot = $config->dataroot;
101$CFG->admin = $config->admin;
102$CFG->docroot = 'http://docs.moodle.org';
4b9efec4 103$CFG->directorypermissions = 00777;
3b093310 104$CFG->running_installer = true;
8d783716 105
3b093310 106/// Require all needed libs
d36afd6d 107require_once($CFG->libdir.'/setuplib.php');
3b093310 108require_once($CFG->libdir.'/textlib.class.php');
d36afd6d 109require_once($CFG->libdir.'/weblib.php');
3b093310 110require_once($CFG->libdir.'/dmllib.php');
251387d0 111require_once($CFG->libdir.'/moodlelib.php');
3b093310 112require_once($CFG->libdir.'/deprecatedlib.php');
251387d0 113require_once($CFG->libdir.'/adminlib.php');
d36afd6d 114require_once($CFG->libdir.'/environmentlib.php');
115require_once($CFG->libdir.'/xmlize.php');
116require_once($CFG->libdir.'/componentlib.class.php');
3b093310 117
118require('version.php');
119$CFG->release = $release;
120
121$SESSION = new object();
122$SESSION->lang = $CFG->lang;
123
124$USER = new object();
125$USER->id = 0;
126
127$COURSE = new object();
128$COURSE->id = 0;
129
130$SITE = $COURSE;
131define('SITEID', 0);
132
133$hint_dataroot = '';
134$hint_dirroot = '';
135$hint_admindir = '';
136$hint_database = '';
137
138/// Are we in help mode?
139if (isset($_GET['help'])) {
140 install_print_help_page($_GET['help']);
141}
142
143/// send css?
144if (isset($_GET['css'])) {
145 install_css_styles();
6d5a22b2 146}
8b5b1028 147
3b093310 148///first time here? find out suitable dataroot
149if (is_null($CFG->dataroot)) {
150 $CFG->dataroot = str_replace('\\', '/', dirname(dirname(__FILE__)).'/moodledata');
add47d44 151
add47d44 152 $i = 0; //safety check - dirname might return some unexpected results
153 while(is_dataroot_insecure()) {
154 $parrent = dirname($CFG->dataroot);
155 $i++;
b735d140 156 if ($parrent == '/' or $parrent == '.' or preg_match('/^[a-z]:\\\?$/i', $parrent) or ($i > 100)) {
add47d44 157 $CFG->dataroot = ''; //can not find secure location for dataroot
158 break;
159 }
160 $CFG->dataroot = dirname($parrent).'/moodledata';
161 }
3b093310 162 $config->dataroot = $CFG->dataroot;
163 $config->stage = INSTALL_WELCOME;
8b5b1028 164}
165
3b093310 166// now let's do the stage work
167if ($config->stage < INSTALL_WELCOME) {
168 $config->stage = INSTALL_WELCOME;
169}
170if ($config->stage > INSTALL_SAVE) {
171 $config->stage = INSTALL_SAVE;
8d783716 172}
173
174
51e3e0b9 175
3b093310 176if ($config->stage == INSTALL_SAVE) {
177 $database = moodle_database::get_driver_instance($config->dbtype, 'native');
178 if (!$database->driver_installed()) {
179 $config->stage = INSTALL_DATABASETYPE;
180 } else {
181 $hint_database = install_db_validate($database, $config->dbhost, $config->dbuser, $config->dbpass, $config->dbname, $config->prefix, array('dbpersit'=>0, 'dbsocket'=>$config->dbsocket));
edd3a5db 182
3b093310 183 if ($hint_database === '') {
184 $configphp = '<?php /// Moodle Configuration File ' . "\r\n\r\n";
8d783716 185
3b093310 186 $configphp .= 'unset($CFG);'."\r\n";
187 $configphp .= '$CFG = new stdClass();'."\r\n\r\n"; // prevent PHP5 strict warnings
51e3e0b9 188
3b093310 189 $dbconfig = $database->export_dbconfig();
51e3e0b9 190
3b093310 191 foreach ($dbconfig as $key=>$value) {
192 $key = str_pad($key, 9);
193 $configphp .= '$CFG->'.$key.' = '.var_export($value, true).";\r\n";
194 }
195 $configphp .= "\r\n";
8b5b1028 196
3b093310 197 $configphp .= '$CFG->wwwroot = '.var_export($CFG->wwwroot, true).";\r\n";
8b5b1028 198
3b093310 199 if ($CFG->dirroot !== $config->dirroot) {
200 $configphp .= '$CFG->dirroot = realpath('.var_export($config->dirroot, true).");\r\n"; // fix for sym links
201 } else {
202 $dirroot = str_replace('\\', '/', $CFG->dirroot); // win32 fix
203 $dirroot = rtrim($dirroot, '/'); // no trailing /
204 $configphp .= '$CFG->dirroot = '.var_export($dirroot, true).";\r\n";
205 }
8b5b1028 206
3b093310 207 $dataroot = str_replace('\\', '/', $config->dataroot); // win32 fix
208 $dataroot = rtrim($dataroot, '/'); // no trailing /
209 $configphp .= '$CFG->dataroot = '.var_export($dataroot, true).";\r\n";
8d783716 210
3b093310 211 $configphp .= '$CFG->admin = '.var_export($config->admin, true).";\r\n\r\n";
8b5b1028 212
3b093310 213 $configphp .= '$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode'."\r\n";
214 $configphp .= "\r\n";
53a0367d 215
3b093310 216 $configphp .= 'require_once("$CFG->dirroot/lib/setup.php");'."\r\n\r\n";
217 $configphp .= '// There is no php closing tag in this file,'."\r\n";
218 $configphp .= '// it is intentional because it prevents trailing whitespace problems!'."\r\n";
53a0367d 219
3b093310 220 umask(0137);
221
222 if (($fh = @fopen($configfile, 'w')) !== false) {
223 fwrite($fh, $configphp);
224 fclose($fh);
225 }
226
227 if (file_exists($configfile)) {
228 // config created, let's continue!
229 redirect("$CFG->wwwroot/$config->admin/index.php?lang=$config->lang");
230 }
2df3a721 231
3b093310 232 install_print_header($config, 'config.php',
233 get_string('configurationcompletehead', 'install'),
234 get_string('configurationcompletesub', 'install').get_string('configfilenotwritten', 'install'));
235 echo '<div class="configphp"><pre>';
236 echo p($configphp);
237 echo '</pre></div>';
bba0beae 238
3b093310 239 install_print_footer($config);
240 die;
8b5b1028 241
3b093310 242 } else {
243 $config->stage = INSTALL_DATABASE;
244 }
6d5a22b2 245 }
8b5b1028 246}
247
248
249
3b093310 250if ($config->stage == INSTALL_DATABASE) {
251 $database = moodle_database::get_driver_instance($config->dbtype, 'native');
8b5b1028 252
3b093310 253 $sub = '<h3>'.$database->get_name().'</h3>'.$database->get_configuration_help();
8d783716 254
3b093310 255 install_print_header($config, get_string('database', 'install'), get_string('databasehead', 'install'), $sub);
53a0367d 256
3b093310 257 $strdbhost = get_string('databasehost', 'install');
258 $strdbname = get_string('databasename', 'install');
259 $strdbuser = get_string('databaseuser', 'install');
260 $strdbpass = get_string('databasepass', 'install');
261 $strprefix = get_string('dbprefix', 'install');
262 $strdbsocket = get_string('databasesocket', 'install');
8d783716 263
3b093310 264 echo '<div class="userinput">';
265 echo '<div class="formrow"><label for="id_dbhost" class="formlabel">'.$strdbhost.'</label>';
266 echo '<input id="id_dbhost" name="dbhost" type="text" value="'.s($config->dbhost).'" size="30" class="forminput" />';
267 echo '</div>';
8b5b1028 268
3b093310 269 echo '<div class="formrow"><label for="id_dbname" class="formlabel">'.$strdbname.'</label>';
270 echo '<input id="id_dbname" name="dbname" type="text" value="'.s($config->dbname).'" size="30" class="forminput" />';
271 echo '</div>';
86453d8b 272
3b093310 273 echo '<div class="formrow"><label for="id_dbuser" class="formlabel">'.$strdbuser.'</label>';
274 echo '<input id="id_dbuser" name="dbuser" type="text" value="'.s($config->dbuser).'" size="30" class="forminput" />';
275 echo '</div>';
86453d8b 276
3b093310 277 echo '<div class="formrow"><label for="id_dbpass" class="formlabel">'.$strdbpass.'</label>';
278 // no password field here, the password may be visible in config.php if we can not write it to disk
279 echo '<input id="id_dbpass" name="dbpass" type="text" value="'.s($config->dbpass).'" size="30" class="forminput" />';
280 echo '</div>';
86453d8b 281
3b093310 282 echo '<div class="formrow"><label for="id_prefix" class="formlabel">'.$strprefix.'</label>';
283 echo '<input id="id_prefix" name="prefix" type="text" value="'.s($config->prefix).'" size="10" class="forminput" />';
284 echo '</div>';
fe515206 285
3b093310 286 if (!(stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin'))) {
287 $checked = $config->dbsocket ? 'checked="checked' : '';
288 echo '<div class="formrow"><label for="id_dbsocket" class="formlabel">'.$strdbsocket.'</label>';
289 echo '<input type="hidden" value="0" name="dbsocket" />';
290 echo '<input type="checkbox" id="id_dbsocket" value="1" name="dbsocket" '.$checked.' class="forminput" />';
291 echo '</div>';
8b5b1028 292 }
293
3b093310 294 echo '<div class="hint">'.$hint_database.'</div>';
295 echo '</div>';
296 install_print_footer($config);
297 die;
8b5b1028 298}
299
300
301
3b093310 302if ($config->stage == INSTALL_DOWNLOADLANG) {
303 if (empty($CFG->dataroot)) {
304 $config->stage = INSTALL_PATHS;
8b5b1028 305
3b093310 306 } else if (is_dataroot_insecure()) {
307 $hint_dataroot = get_string('pathsunsecuredataroot', 'install');
308 $config->stage = INSTALL_PATHS;
8b5b1028 309
3b093310 310 } else if (!is_writable($CFG->dataroot)) {
311 $hint_dataroot = get_string('pathsrodataroot', 'install');
312 $config->stage = INSTALL_PATHS;
8b5b1028 313 }
8b5b1028 314
3b093310 315 if ($config->dirroot === '' or !file_exists($config->dirroot)) {
316 $hint_dirroot = get_string('pathswrongdirroot', 'install');
317 $config->stage = INSTALL_PATHS;
318 }
6d5a22b2 319
3b093310 320 if ($config->admin === '' or !file_exists($config->dirroot.'/'.$config->admin.'/environment.xml')) {
321 $hint_admindir = get_string('pathswrongadmindir', 'install');
322 $config->stage = INSTALL_PATHS;
3b3b8029 323 }
324}
8b5b1028 325
cdef6d42 326
327
3b093310 328if ($config->stage == INSTALL_DOWNLOADLANG) {
329 if ($CFG->lang == 'en_utf8') {
330 $config->stage = INSTALL_DATABASETYPE;
331 }
332}
cdef6d42 333
cdef6d42 334
cdef6d42 335
3b093310 336if ($config->stage == INSTALL_DOWNLOADLANG) {
cdef6d42 337 $downloaderror = '';
338
cdef6d42 339/// Create necessary lang dir
340 if (!make_upload_directory('lang', false)) {
341 $downloaderror = get_string('cannotcreatelangdir', 'error');
cdef6d42 342
3b093310 343/// Download and install lang component
344 } else if ($cd = new component_installer('http://download.moodle.org', 'lang16', $CFG->lang.'.zip', 'languages.md5', 'lang')) {
345 if ($cd->install() == COMPONENT_ERROR) {
346 if ($cd->get_error() == 'remotedownloaderror') {
347 $a = new stdClass();
348 $a->url = 'http://download.moodle.org/lang16/'.$INSTALL['language'].'.zip';
349 $a->dest = $CFG->dataroot.'/lang';
350 $downloaderror = get_string($cd->get_error(), 'error', $a);
351 } else {
352 $downloaderror = get_string($cd->get_error(), 'error');
353 }
cdef6d42 354 }
cdef6d42 355 }
356
3b093310 357 if ($downloaderror !== '') {
358 install_print_header($config, get_string('language'), get_string('langdownloaderror', 'install', $CFG->lang), $downloaderror);
359 install_print_footer($config);
360 die;
cdef6d42 361 } else {
3b093310 362 $config->stage = INSTALL_DATABASETYPE;
cdef6d42 363 }
53a0367d 364}
cdef6d42 365
366
367
3b093310 368if ($config->stage == INSTALL_DATABASETYPE) {
369 /// Finally ask for DB type
370 install_print_header($config, get_string('database', 'install'),
371 get_string('databasetypehead', 'install'),
372 get_string('databasetypesub', 'install'));
51e3e0b9 373
3b093310 374 // TODO: move this PHP5 code to lib/installib.php so that this file parses in PHP4
375 $databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
376 'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
377 'oci' => moodle_database::get_driver_instance('oci', 'native'),
378 //'sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native'), // new MS sql driver - win32 only
379 //'mssql' => moodle_database::get_driver_instance('mssql', 'native'), // FreeTDS driver
380 );
51e3e0b9 381
3b093310 382 echo '<div class="userinput">';
383 echo '<div class="formrow"><label class="formlabel" for="dbtype">'.get_string('dbtype', 'install').'</label>';
384 echo '<select id="dbtype" name="dbtype" class="forminput">';
385 $disabled = array();
386 $options = array();
387 foreach ($databases as $type=>$database) {
388 if ($database->driver_installed() !== true) {
389 $disabled[$type] = $database;
390 continue;
391 }
392 echo '<option value="'.s($type).'">'.$database->get_name().'</option>';
51e3e0b9 393 }
3b093310 394 if ($disabled) {
395 echo '<optgroup label="'.s(get_string('notavailable')).'">';
396 foreach ($disabled as $type=>$database) {
397 echo '<option value="'.s($type).'" class="notavailable">'.$database->get_name().'</option>';
398 }
399 echo '</optgroup>';
8b5b1028 400 }
3b093310 401 echo '</select></div>';
402 echo '</div>';
53a0367d 403
3b093310 404 install_print_footer($config);
405 die;
8b5b1028 406}
407
408
409
3b093310 410if ($config->stage == INSTALL_ENVIRONMENT or $config->stage == INSTALL_PATHS) {
411 $version_fail = (version_compare(phpversion(), "5.2.8") < 0);
412 $curl_fail = ($lang !== 'en_utf8' and !extension_loaded('curl')); // needed for lang pack download
413 $zip_fail = ($lang !== 'en_utf8' and !extension_loaded('zip')); // needed for lang pack download
8b5b1028 414
3b093310 415 if ($version_fail or $curl_fail or $zip_fail) {
416 $config->stage = INSTALL_ENVIRONMENT;
8b5b1028 417
3b093310 418 install_print_header($config, get_string('environment', 'install'),
419 get_string('errorsinenvironment', 'install'),
420 get_string('environmentsub2', 'install'));
8b5b1028 421
3b093310 422 echo '<div id="envresult"><dl>';
423 if ($version_fail) {
424 $a = (object)array('needed'=>'5.2.8', 'current'=>phpversion());
425 echo '<dt>'.get_string('phpversion', 'install').'</dt><dd>'.get_string('environmentrequireversion', 'admin', $a).'</dd>';
426 }
427 if ($curl_fail) {
428 echo '<dt>'.get_string('phpextension', 'install', 'cURL').'</dt><dd>'.get_string('environmentrequireinstall', 'admin').'</dd>';
429 }
430 if ($zip_fail) {
431 echo '<dt>'.get_string('phpextension', 'install', 'Zip').'</dt><dd>'.get_string('environmentrequireinstall', 'admin').'</dd>';
432 }
433 echo '</dl></div>';
8d783716 434
3b093310 435 install_print_footer($config, true);
436 die;
51e3e0b9 437
8b5b1028 438 } else {
3b093310 439 $config->stage = INSTALL_PATHS;
8b5b1028 440 }
8b5b1028 441}
442
8b5b1028 443
8b5b1028 444
4d928665 445if ($config->stage == INSTALL_DISTRIBUTION) {
446 // TODO: reimplement welcome.html support for win installer
447 $config->stage = INSTALL_PATHS;
448}
449
450
451
3b093310 452if ($config->stage == INSTALL_PATHS) {
453 $paths = array('wwwroot' => get_string('wwwroot', 'install'),
454 'dirroot' => get_string('dirroot', 'install'),
455 'dataroot' => get_string('dataroot', 'install'),
456 'admindir' => get_string('admindirname', 'install'));
627d326a 457
3b093310 458 $sub = '<dl>';
459 foreach ($paths as $path=>$name) {
460 $sub .= '<dt>'.$name.'</dt><dd>'.get_string('pathssub'.$path, 'install').'</dd>';
8b5b1028 461 }
3b093310 462 $sub .= '</dl>';
cd0e958e 463
3b093310 464 install_print_header($config, get_string('paths', 'install'), get_string('pathshead', 'install'), $sub);
627d326a 465
3b093310 466 $strwwwroot = get_string('wwwroot', 'install');
467 $strdirroot = get_string('dirroot', 'install');
468 $strdataroot = get_string('dataroot', 'install');
469 $stradmindirname = get_string('admindirname', 'install');
cdef6d42 470
3b093310 471 echo '<div class="userinput">';
472 echo '<div class="formrow"><label for="id_wwwroot" class="formlabel">'.$paths['wwwroot'].'</label>';
473 echo '<input id="id_wwwroot" name="wwwroot" type="text" value="'.s($CFG->wwwroot).'" disabled="disabled" size="45" class="forminput" />';
474 echo '</div>';
cd0e958e 475
3b093310 476 echo '<div class="formrow"><label for="id_dirroot" class="formlabel">'.$paths['dirroot'].'</label>';
477 echo '<input id="id_dirroot" name="dirroot" type="text" value="'.s($config->dirroot).'" size="45"class="forminput" />';
478 if ($hint_dirroot !== '') {
479 echo '<div class="hint">'.$hint_dirroot.'</div>';
cdef6d42 480 }
3b093310 481 echo '</div>';
53a0367d 482
3b093310 483 echo '<div class="formrow"><label for="id_dataroot" class="formlabel">'.$paths['dataroot'].'</label>';
484 echo '<input id="id_dataroot" name="dataroot" type="text" value="'.s($config->dataroot).'" size="45" class="forminput" />';
485 if ($hint_dataroot !== '') {
486 echo '<div class="hint">'.$hint_dataroot.'</div>';
cdef6d42 487 }
3b093310 488 echo '</div>';
8b5b1028 489
8d783716 490
3b093310 491 if (file_exists("$CFG->dirroot/admin/environment.xml")) {
492 $disabled = 'disabled="disabled"';
8d783716 493 } else {
3b093310 494 $disabled = '';
8d783716 495 }
3b093310 496 echo '<div class="formrow"><label for="id_admin" class="formlabel">'.$paths['admindir'].'</label>';
497 echo '<input id="id_admin" name="admin" type="text" value="'.s($config->admin).'" '.$disabled.' size="10" class="forminput" />';
498 if ($hint_admindir !== '') {
499 echo '<div class="hint">'.$hint_admindir.'</div>';
8d783716 500 }
3b093310 501 echo '</div>';
8d783716 502
3b093310 503 echo '</div>';
8d783716 504
3b093310 505 install_print_footer($config);
506 die;
8d783716 507}
508
86453d8b 509
86453d8b 510
3b093310 511$config->stage = INSTALL_WELCOME;
512install_print_header($config, get_string('language'),
513 get_string('chooselanguagehead', 'install'),
514 get_string('chooselanguagesub', 'install'));
86453d8b 515
3b093310 516$languages = install_get_list_of_languages();
517echo '<div class="userinput">';
518echo '<div class="formrow"><label class="formlabel" for="langselect">'.get_string('language').'</label>';
4d928665 519echo '<select id="langselect" name="lang" class="forminput" onchange="this.form.submit()">';
3b093310 520foreach ($languages as $name=>$value) {
521 $selected = ($name == $CFG->lang) ? 'selected="selected"' : '';
522 echo '<option value="'.s($name).'" '.$selected.'>'.$value.'</option>';
86453d8b 523}
3b093310 524echo '</select></div>';
525echo '</div>';
86453d8b 526
3b093310 527install_print_footer($config);
528die;
2961367e 529