- distinguish between errors and warnings

This commit is contained in:
steinm 2011-10-26 07:32:57 +00:00
parent 8f2ec90fb2
commit c7b0d1979b

View File

@ -46,7 +46,15 @@ if (!file_exists("settings.xml.template_install")) {
* Functions
*/
function printError($error) { /* {{{ */
print "<div class=\"error\">";
print "<div class=\"install_error\">";
print "Error<br />";
print $error;
print "</div>";
} /* }}} */
function printWarning($error) { /* {{{ */
print "<div class=\"install_warning\">";
print "Warning<br />";
print $error;
print "</div>";
} /* }}} */
@ -54,7 +62,8 @@ function printError($error) { /* {{{ */
function printCheckError($resCheck) { /* {{{ */
$hasError = false;
foreach($resCheck as $keyRes => $paramRes) {
$hasError = true;
if(isset($paramRes['type']) && $paramRes['type'] == 'error')
$hasError = true;
$errorMes = getMLText("settings_$keyRes"). " : " . getMLText("settings_".$paramRes["status"]);
if (isset($paramRes["currentvalue"]))
@ -66,7 +75,10 @@ function printCheckError($resCheck) { /* {{{ */
if (isset($paramRes["systemerror"]))
$errorMes .= "<br/> =&gt; " . $paramRes["systemerror"];
printError($errorMes);
if(isset($paramRes['type']) && $paramRes['type'] == 'error')
printError($errorMes);
else
printWarning($errorMes);
}
return $hasError;
@ -169,6 +181,8 @@ if (printCheckError( $settings->checkSystem())) {
echo "<br/>PHP version: " . phpversion();
echo "<br/>PHP include path: " . ini_get('include_path');
echo '<br/>';
echo '<br/>';
echo '<a href="' . $httpRoot . 'install/install.php">' . getMLText("refresh") . '</a>';
@ -204,9 +218,9 @@ if ($action=="setSettings") {
$settings->_luceneClassDir = $_POST["luceneClassDir"];
/**
* Check Parameters
* Check Parameters, require version 3.3.x
*/
$hasError = printCheckError( $settings->check());
$hasError = printCheckError( $settings->check('33'));
if (!$hasError)
{