+ function check_passed($v, $c){
+ if ($c['required'])
+ $v = $v && $c['status'];
+ return $v;
+ }
+ $checkspassed = array_reduce($checks, "check_passed", true);
+
+
+ $tpl = get_markup_template('install_checks.tpl');
+ $o .= replace_macros($tpl, array(
+ '$title' => $install_title,
+ '$pass' => t('System check'),
+ '$checks' => $checks,
+ '$passed' => $checkspassed,
+ '$see_install' => t('Please see the file "INSTALL.txt".'),
+ '$next' => t('Next'),
+ '$reload' => t('Check again'),
+ '$phpath' => $phpath,
+ '$baseurl' => $a->get_baseurl(),
+ ));
+ return $o;
+ }; break;
+
+ case 2: { // Database config
+
+ $dbhost = ((x($_POST,'dbhost')) ? notags(trim($_POST['dbhost'])) : 'localhost');
+ $dbuser = notags(trim($_POST['dbuser']));
+ $dbpass = notags(trim($_POST['dbpass']));
+ $dbdata = notags(trim($_POST['dbdata']));
+ $phpath = notags(trim($_POST['phpath']));
+
+
+ $tpl = get_markup_template('install_db.tpl');
+ $o .= replace_macros($tpl, array(
+ '$title' => $install_title,
+ '$pass' => t('Database connection'),
+ '$info_01' => t('In order to install Friendica we need to know how to connect to your database.'),
+ '$info_02' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
+ '$info_03' => t('The database you specify below should already exist. If it does not, please create it before continuing.'),
+
+ '$status' => $wizard_status,
+
+ '$dbhost' => array('dbhost', t('Database Server Name'), $dbhost, ''),
+ '$dbuser' => array('dbuser', t('Database Login Name'), $dbuser, ''),
+ '$dbpass' => array('dbpass', t('Database Login Password'), $dbpass, ''),
+ '$dbdata' => array('dbdata', t('Database Name'), $dbdata, ''),
+ '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
+
+
+
+ '$lbl_10' => t('Please select a default timezone for your website'),
+
+ '$baseurl' => $a->get_baseurl(),
+
+ '$phpath' => $phpath,
+
+ '$submit' => t('Submit'),
+
+ ));
+ return $o;
+ }; break;
+ case 3: { // Site settings
+ require_once('datetime.php');
+ $dbhost = ((x($_POST,'dbhost')) ? notags(trim($_POST['dbhost'])) : 'localhost');
+ $dbuser = notags(trim($_POST['dbuser']));
+ $dbpass = notags(trim($_POST['dbpass']));
+ $dbdata = notags(trim($_POST['dbdata']));
+ $phpath = notags(trim($_POST['phpath']));
+
+ $adminmail = notags(trim($_POST['adminmail']));
+ $timezone = ((x($_POST,'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles');
+
+ $tpl = get_markup_template('install_settings.tpl');
+ $o .= replace_macros($tpl, array(
+ '$title' => $install_title,
+ '$pass' => t('Site settings'),
+
+ '$status' => $wizard_status,
+
+ '$dbhost' => $dbhost,
+ '$dbuser' => $dbuser,
+ '$dbpass' => $dbpass,
+ '$dbdata' => $dbdata,
+ '$phpath' => $phpath,
+
+ '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
+
+
+ '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''),
+
+ '$baseurl' => $a->get_baseurl(),
+
+
+
+ '$submit' => t('Submit'),
+
+ ));
+ return $o;
+ }; break;
+
+ }