]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/overview-inc.php
Moved language strings, more EL in templates
[mailer.git] / inc / modules / admin / overview-inc.php
index 73077463a7090f2e2a0b18a1478ec1e46e318cb5..db1e154849cc5becddc63b7ae12d1a588e46a43a 100644 (file)
@@ -40,7 +40,7 @@
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
-}
+} // END - if
 
 // @TODO This function does also check for uncompleted tasks
 function outputStandardOverview (&$result_tasks) {
@@ -162,7 +162,7 @@ LIMIT 1",
 
                                $add = '';
                                // @TODO Rewrite this to a filter
-                               if ($taskData['task_type'] == 'SUPPORT_MEMBER') {
+                               if ($taskData['task_type'] == 'MEMBER_SUPPORT') {
                                        $mode = substr($taskData['text'], 0, strpos($taskData['text'], ':'));
                                        $taskData['text'] = substr($taskData['text'], strpos($taskData['text'], ':') + 1);
                                        $add = '<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>' . $mode . '</strong></li>';
@@ -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'))) {
@@ -207,7 +207,7 @@ LIMIT 1",
                                                // Is this non-productive?
                                                if (isExtensionProductive() === false) {
                                                        // Issue warning
-                                                       $taskData['text'] .= loadTemplate('admin_settings_saved', true, getMaskedMessage('ADMIN_EXTENSION_IS_NON_PRODUCTIVE', $ext_name));
+                                                       $taskData['text'] = loadTemplate('admin_settings_saved', true, getMaskedMessage('ADMIN_EXTENSION_IS_NON_PRODUCTIVE', $ext_name)) . $taskData['text'];
                                                } // END - if
 
                                                // Set current extension name
@@ -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
@@ -311,7 +307,7 @@ LIMIT 1",
                                                } // END - if
                                                break;
 
-                                       case 'SUPPORT_MEMBER': // Assign on member's support request
+                                       case 'MEMBER_SUPPORT': // Assign on member's support request
                                                // @TODO This may also be rewritten to include files
                                                switch ($mode) {
                                                        default: // @TODO Unknown support mode
@@ -451,7 +447,7 @@ LIMIT 1",
                        $content['task_created'] = generateDateTime($content['task_created'], 2);
 
                        // Do we have extension task?
-                       if (($content['task_type'] == 'EXTENSION') && (isExtensionNameValid($content['infos'])) && (!isExtensionInstalled($content['infos']))) {
+                       if (isExtensionTask($content)) {
                                // Load extension row template
                                $OUT .= loadTemplate('admin_overview_list_ext_rows', true, $content);
                        } else {