]> git.mxchange.org Git - mailer.git/blobdiff - inc/ajax/ajax_installer.php
Installation NG continued (still not fully working)
[mailer.git] / inc / ajax / ajax_installer.php
index f6fd6e781108444c5aeeed2a8682bf851727d944..425c81b0295faad77ea8ca548954e1df6e08ac92 100644 (file)
@@ -56,7 +56,7 @@ function doAjaxProcessInstall () {
        } // END - if
 
        // Notify all modules that we are installing
-       $GLOBALS['__mailer_installing'] =  true;
+       $GLOBALS['__mailer_installing'] = TRUE;
 
        // Again we do a call-back, so generate a function name depending on 'do'
        $callbackName = 'doAjaxInstaller' . capitalizeUnderscoreString(postRequestElement('do'));
@@ -107,6 +107,10 @@ function doAjaxInstallerFooterNavigation () {
 
                case 'overview': // Enable only 'previous'
                        array_push($enabledNavigations, 'previous');
+                       if (isInstallationDataCompleted()) {
+                               // Add 'finish'
+                               array_push($enabledNavigations, 'finish');
+                       } // END - if
                        break;
 
                default: // Unsupported value
@@ -400,12 +404,9 @@ function doAjaxPrepareInstallerOverview () {
        $output     = '';
 
        // Check all data in session
-       foreach (getSessionArray() as $key => $value) {
-               // Skip 'mailer_theme', 'tab' and 'installer'
-               if (in_array($key, array('mailer_theme', 'tab', 'installer'))) {
-                       // Skip this
-                       continue;
-               } // END - if
+       foreach (array_keys($GLOBALS['installer_groups']) as $key) {
+               // Get values from session
+               $value = getSession($key);
 
                // Is the data valid?
                $verificationStatus['is_valid'] = (isInstallerDataValid($verificationStatus, $key, $value));
@@ -422,7 +423,7 @@ function doAjaxPrepareInstallerOverview () {
        } // END - foreach
 
        // Is it still true?
-       if ($isAllValid === TRUE) {
+       if ((isInstallationDataCompleted()) && ($isAllValid === TRUE)) {
                // Set 'done' and message
                $verificationStatus['status']  = 'done';
                $verificationStatus['message'] = '{--INSTALLER_OVERVIEW_FINAL_CHECK_DONE--}';
@@ -434,27 +435,24 @@ function doAjaxPrepareInstallerOverview () {
        // Is it still valid?
        if ($verificationStatus['status'] != 'done') {
                // Log message away
-               logDebugMessage(__FUNCTION__, __LINE__, 'Final check on all stored data failed. message=' . $verificationStatus['message']);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Final check on all stored data failed. message=' . $verificationStatus['message']);
+
+               // Process failed fields
+               $verificationStatus['failed_fields'] = handleInstallerFailedFields($verificationStatus['failed_fields']);
 
                // Output the array for JSON reply
-               setAjaxReplyContent(json_encode($verificationStatus, JSON_FORCE_OBJECT));
+               setAjaxReplyContent(loadTemplate('install_overview_failed', TRUE, $verificationStatus));
 
                /*
                 * Something went wrong, this might happen when e.g. the user has tried
                 * to save invalid database login data but hit reload button on error
                 * message.
                 */
-               setHttpStatus('500 Internal Server Error');
+               setHttpStatus('200 OK');
 
                // Abort here
                return;
        } // END - if
-
-       // Output final rendered content
-       setAjaxReplyContent($output);
-
-       // All okay if we reach this point
-       setHttpStatus('200 OK');
 }
 
 // [EOF]