]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/overview-inc.php
Naming convention applied, more cleanups, more EL
[mailer.git] / inc / modules / admin / overview-inc.php
index 1b85cbead7f86951fc864885b97bacdd709d16ad..e6019df0cf0e0541dd52e81e44b6b2b4f0e55cb5 100644 (file)
@@ -192,7 +192,7 @@ LIMIT 1",
 
                                // Initialize variables (no title for SQL commands by default)
                                $ext_name = ''; $ext_ver = '';
-                               $title = '{--TASK_NO_TITLE--}';
+                               $title = '{--ADMIN_TASK_NO_SQL_TITLE--}';
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
                                if ((isVerboseSqlEnabled()) || (!isExtensionInstalled('sql_patches'))) {
@@ -245,7 +245,7 @@ LIMIT 1",
                                        // Add SQLs to a table
                                        if ((!empty($ext_name)) && (isVerboseSqlEnabled())) {
                                                // Add verbose SQL table
-                                               $taskData['text'] .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . "<br />\n";
+                                               $taskData['text'] .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . '<br />';
                                        } // END - if
                                } elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
                                        // Run SQL commands in dry mode but only return the notes
@@ -278,18 +278,14 @@ LIMIT 1",
                                switch ($taskData['task_type']) {
                                        case 'EXTENSION': // Install new extensions
                                                $ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
-                                               $result_lines = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
-                                                       array($ext_name), __FILE__, __LINE__);
-                                               $lines = SQL_NUMROWS($result_lines);
-                                               SQL_FREERESULT($result_lines);
-                                               if ($lines == '0') {
-                                                       // New extension found
+                                               if (!isExtensionInstalled($ext_name)) {
+                                                       // New (not yet installed) extension found
                                                        $OUT .= loadTemplate('admin_extension_reg_form', true, array(
                                                                'id'       => bigintval($taskId),
                                                                'ext_name' => $ext_name
                                                        ));
                                                } else {
-                                                       // Task is closed so nothing is todo
+                                                       // Extension is already installed
                                                        $OUT .= '<div class="admin_failed">{--ADMIN_EXTENSION_ALREADY_REGISTERED--}</div>';
 
                                                        // Close task but not already closed, solved, deleted or update tasks