]> git.mxchange.org Git - mailer.git/blobdiff - inc/install-inc.php
Filter support added to template engine, functions renamed
[mailer.git] / inc / install-inc.php
index e8304bb0c4fe90a78d24af2d9b2aa3712a77296d..01c7ca8e0836c06f81f04376ed4cc987aad3aabe 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 08/29/2003 *
- * ===============                              Last change: 11/11/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 08/29/2003 *
+ * ===================                          Last change: 11/11/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : install-inc.php                                  *
@@ -57,30 +57,30 @@ if ((isGetRequestElementSet('page') && (getRequestElement('page') == 5))) {
        // Okay, we have to check it
        if (isPostRequestElementSet('smtp_user') && (!isPostRequestElementSet('smtp_host'))) {
                // Hostname not set
-               addToInstallContent(getMessage('INSTALL_SMTP_HOSTNAME_EMPTY') . '<br />');
+               addToInstallContent('<div class="para">' . getMessage('INSTALL_SMTP_HOSTNAME_EMPTY') . '</div>');
                setRequestGetElement('page', 3);
        } // END - if
 
        if ((!isPostRequestElementSet('smtp_pass1')) && (isPostRequestElementSet('smtp_pass2'))) {
                // Password is empty
-               addToInstallContent(getMessage('INSTALL_SMTP_PASS1_EMPTY') . '<br />');
+               addToInstallContent('<div class="para">' . getMessage('INSTALL_SMTP_PASS1_EMPTY') . '</div>');
                setRequestGetElement('page', 3);
        } // END - if
 
        if ((isPostRequestElementSet('smtp_pass1')) && (!isPostRequestElementSet('smtp_pass2'))) {
                // Password repeat is empty
-               addToInstallContent(getMessage('INSTALL_SMTP_PASS2_EMPTY') . '<br />');
+               addToInstallContent('<div class="para">' . getMessage('INSTALL_SMTP_PASS2_EMPTY') . '</div>');
                setRequestGetElement('page', 3);
        } // END - if
 
        if (postRequestElement('smtp_pass1') != postRequestElement('smtp_pass1')) {
                // Passwords are not matching
-               addToInstallContent(getMessage('INSTALL_SMTP_PASS_MISMATCH') . '<br />');
+               addToInstallContent('<div class="para">' . getMessage('INSTALL_SMTP_PASS_MISMATCH') . '</div>');
                setRequestGetElement('page', 3);
        } // END - if
 } // END - if
 
-// Is MXChange installed or no admin registered so far?
+// Is the mailer installed or no admin registered so far?
 if ((!isInstalled()) || (!isAdminRegistered())) {
        // Output page for entered value
        switch (getRequestElement('page')) {
@@ -100,11 +100,11 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                        if (empty($mysql['prefix'])) $mysql['prefix'] = 'mxchange';
                        if (empty($mysql['type']))   $mysql['type']   = 'MyISAM';
                        if (getTotalFatalErrors() > 0) {
-                               addToInstallContent('<span class="install_fatal">');
+                               addToInstallContent('<div class="install_fatal">');
                                foreach (getFatalArray() as $key => $err) {
-                                       addToInstallContent('<strong>&middot;</strong>&nbsp;{--FATAL_NO--}' . ($key + 1) . ':&nbsp;' . $err . '<br />');
+                                       addToInstallContent('<div class="para"><strong>&middot;</strong>&nbsp;{--FATAL_NO--}' . ($key + 1) . ':&nbsp;' . $err . '</div>');
                                }
-                               addToInstallContent('</span><br />');
+                               addToInstallContent('</div>');
                        }
                        $content['mysql_host']   = $mysql['host'];
                        $content['mysql_dbase']  = $mysql['dbase'];
@@ -202,7 +202,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                        addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS'));
                                                } // END - if
 
-                                               if (getTotalFatalErrors() == 0) {
+                                               if (getTotalFatalErrors() == '0') {
                                                        // Set type and prefix from POST data
                                                        setConfigEntry('_TABLE_TYPE'  , postRequestElement('mysql', 'type'));
                                                        setConfigEntry('_MYSQL_PREFIX', postRequestElement('mysql', 'prefix'));
@@ -217,9 +217,6 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                                        // Read the file
                                                                        $fileContent = readFromFile($FQFN, true);
 
-                                                                       // Compile all config entries (we use a filter here, yes...)
-                                                                       $fileContent = FILTER_COMPILE_CONFIG($fileContent);
-
                                                                        // Split it up against ";\n" and merge it into existing SQLs
                                                                        mergeSqls(explode(";\n", $fileContent), 'install');
                                                                } else {
@@ -230,7 +227,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                        //* DEBUG: */ die('<pre>'.print_r(getSqls(), true).'</pre>');
 
                                                        // Are some SQLs found?
-                                                       if (countSqls() == 0) {
+                                                       if (countSqls() == '0') {
                                                                // Abort here
                                                                addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_SQL_IMPORT_FAILED'));
                                                                return;
@@ -248,12 +245,12 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                if (getTotalFatalErrors() > 0) {
                                        $OUT = '';
                                        foreach (getFatalArray() as $value) {
-                                               $OUT .= "    <li>" . $value . "</li>\n";
+                                               $OUT .= '    <li>' . $value . '</li>';
                                        } // END foreach
                                        $content['fatal_errors'] = $OUT;
                                        $OUT = '';
                                        foreach ($mysql as $key => $value) {
-                                               $OUT .= "    <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\n";
+                                               $OUT .= '    <input type="hidden" name="mysql[' . $key . ']" value="' . $value . '" />';
                                        } // END foreach
                                        $content['mysql_hidden'] = $OUT;
                                        $content['spath']      = postRequestElement('spath');
@@ -287,7 +284,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
 
                default:
                        logDebugMessage(__FILE__, __LINE__, sprintf("Wrong page %s detected", getRequestElement('page')));
-                       addTemplateToInstallContent('admin_settings_saved', "<div class=\"install_error\">{--WRONG_PAGE--}</div>");
+                       addTemplateToInstallContent('admin_settings_saved', '<div class="install_error">{--WRONG_PAGE--}</div>');
                        break;
        } // END - switch
 } else {