protected function _prepareTpl() { $lang = jApp::config()->locale; if (!$this->getParam('no_lang_check')) { $locale = jLocale::getPreferedLocaleFromRequest(); if (!$locale) { $locale = 'en_US'; } jApp::config()->locale = $locale; } $reporter = new checkZoneInstallReporter(); $check = new jInstallCheck($reporter, $lang); $reporter->messageProvider = $check->messages; $check->run(); $this->_tpl->assign('wwwpath', jApp::wwwPath()); $this->_tpl->assign('configpath', jApp::configPath()); $this->_tpl->assign('check', $reporter->trace); }
/** * action to display the page * @param jTpl $tpl the template container */ function show($tpl) { $this->tpl = $tpl; $check = new jInstallCheck($this); if (isset($this->config['verbose'])) { $check->verbose = !!$this->config['verbose']; } if (isset($this->config['databases'])) { $db = explode(',', trim($this->config['databases'])); $check->addDatabaseCheck($db, true); } if (isset($this->config['pathcheck'])) { if (is_string($this->config['pathcheck'])) { $files = explode(',', trim($this->config['pathcheck'])); } else { $files = $this->config['pathcheck']; } $check->addWritablePathCheck($files); } $check->checkForInstallation = true; $check->run(); return $check->nbError == 0; }
echo '<p>', $checker->messages->get($checker->nbError > 1 ? 'conclusion.errors' : 'conclusion.error'), '</p>'; } else { if ($checker->nbWarning) { echo '<p>', $checker->messages->get($checker->nbWarning > 1 ? 'conclusion.warnings' : 'conclusion.warning'), '</p>'; } else { if ($checker->nbNotice) { echo '<p>', $checker->messages->get($checker->nbNotice > 1 ? 'conclusion.notices' : 'conclusion.notice'), '</p>'; } else { echo '<p>', $checker->messages->get('conclusion.ok'), '</p>'; } } } echo "</div>"; } } $check = new jInstallCheck(new jHtmlInstallChecker()); header("Content-type:text/html;charset=UTF-8"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $check->messages->getLang(); ?> " lang="<?php echo $check->messages->getLang(); ?> "> <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> <title><?php echo htmlspecialchars($check->messages->get('checker.title'));
} else { if ($nbWarning) { echo '<p>' . $this->messageProvider->get($nbWarning > 1 ? 'conclusion.warnings' : 'conclusion.warning') . '</p>'; } else { if ($nbNotice) { echo '<p>' . $this->messageProvider->get($nbNotice > 1 ? 'conclusion.notices' : 'conclusion.notice') . '</p>'; } else { echo '<p>' . $this->messageProvider->get('conclusion.ok') . '</p>'; } } } echo "</div>"; } } $reporter = new jHtmlInstallChecker(); $check = new jInstallCheck($reporter); if (isset($_GET['verbose'])) { $check->verbose = true; } $check->addDatabaseCheck(array('mysqli', 'sqlite3', 'pgsql', 'oci', 'mssql'), false); $reporter->messageProvider = $check->messages; header("Content-type:text/html;charset=UTF-8"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $check->messages->getLang(); ?> " lang="<?php echo $check->messages->getLang(); ?>
protected function _prepareTpl() { $lang = $GLOBALS['gJConfig']->locale; if (!$this->getParam('no_lang_check')) { $languages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); foreach ($languages as $bl) { if (preg_match("/^([a-zA-Z]{2})(?:[-_]([a-zA-Z]{2}))?(;q=[0-9]\\.[0-9])?\$/", $bl, $match)) { if (isset($match[2])) { $lang = strtolower($match[1]) . '_' . strtoupper($match[2]); } else { $lang = strtolower($match[1]) . '_' . strtoupper($match[1]); } break; } } if ($lang != 'fr_FR' && $lang != 'en_EN' && $lang != 'en_US') { $lang = 'en_EN'; } $GLOBALS['gJConfig']->locale = $lang; } $reporter = new checkZoneInstallReporter(); $check = new jInstallCheck($reporter, $lang); $check->run(); $this->_tpl->assign('wwwpath', JELIX_APP_WWW_PATH); $this->_tpl->assign('configpath', JELIX_APP_CONFIG_PATH); $this->_tpl->assign('check', $reporter->trace); }