]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Rewrites/fixes for surfbar
[mailer.git] / inc / extensions-functions.php
index 80513f4db8478e3085293586cfc3638ca45c0a5d..af6f615564a4c64766b55fc337f9023e12d8386b 100644 (file)
@@ -166,9 +166,9 @@ function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run =
 }
 
 // Registeres an extension and possible update depencies
-function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = true) {
+function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true) {
        // Set current extension name
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $task_id . ',dry_run=' . intval($dry_run) . ',logout=' . intval($logout) . ' - ENTERED!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $taskId . ',dry_run=' . intval($dry_run) . ',logout=' . intval($logout) . ' - ENTERED!');
        setCurrentExtensionName($ext_name);
 
        // Enable dry-run
@@ -200,14 +200,14 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
        } // END - if
 
        // Is the task id zero? Then we need to auto-fix it here
-       if ($task_id == '0') {
+       if ($taskId == '0') {
                // Try to find the task
-               $task_id = determineExtensionTaskId(getCurrentExtensionName());
+               $taskId = determineExtensionTaskId(getCurrentExtensionName());
 
                // Still zero and not in dry-run?
-               if (($task_id == '0') && (!isExtensionDryRun())) {
+               if (($taskId == '0') && (!isExtensionDryRun())) {
                        // Now try to create a new task
-                       $task_id = createNewExtensionTask(getCurrentExtensionName());
+                       $taskId = createNewExtensionTask(getCurrentExtensionName());
 
                        // Is it still zero?
                        if ($taskId == '0') {
@@ -370,7 +370,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                                runFilterChain('post_extension_installed', array(
                                        'pool'     => 'extension',
                                        'ext_name' => getCurrentExtensionName(),
-                                       'task_id'  => $task_id
+                                       'task_id'  => $taskId
                                ));
 
                                // Re-init queries and notes
@@ -397,11 +397,11 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName());
                        $ret = false;
                }
-       } elseif (($task_id > 0) && (getCurrentExtensionName() != '')) {
+       } elseif (($taskId > 0) && (getCurrentExtensionName() != '')) {
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
                // Remove task from system when id and extension's name is valid
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `status`='NEW' LIMIT 1",
-                       array(bigintval($task_id)), __FUNCTION__, __LINE__);
+                       array(bigintval($taskId)), __FUNCTION__, __LINE__);
        }
 
        // Is this the sql_patches?
@@ -738,9 +738,6 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
 
        // Do we have queries?
        if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
-               // Init switch color
-               $SW = 2;
-
                // Get all SQLs
                foreach (getExtensionSqls() as $sqls) {
                        // New array format is recursive
@@ -752,16 +749,12 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
                                if (!empty($sql)) {
                                        // Prepare output for template
                                        $content = array(
-                                               'sw'  => $SW,
                                                'i'   => ($idx+1),
                                                'sql' => $sql
                                        );
 
                                        // Load row template
                                        $OUT .= loadTemplate('admin_ext_sql_row', true, $content);
-
-                                       // Switch color
-                                       $SW = 3 - $SW;
                                } // END - if
                        } // END - foreach
                } // END - foreach
@@ -921,7 +914,7 @@ function doDeactivateExtension($ext_name) {
 
                // Notify the admin
                sendAdminNotification(
-                       getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
+                       '{--ADMIN_EXTENSION_DEACTIVATED_SUBJECT--}',
                        'admin_ext_deactivated',
                        array('ext_name' => $ext_name)
                );
@@ -944,7 +937,7 @@ function isExtensionOlder ($ext_name, $ext_ver) {
 // Creates a new task for updated extension
 function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
        // Create subject line
-       $subject = '[UPDATE-' . $ext_name . '-' . $ext_ver . ':] {--ADMIN_UPDATE_EXTENSION_SUBJ--}';
+       $subject = '[UPDATE-' . $ext_name . '-' . $ext_ver . ':] {--ADMIN_UPDATE_EXTENSION_SUBJECT--}';
 
        // Get task id
        $taskId = determineTaskIdBySubject($subject);
@@ -1005,7 +998,7 @@ function createNewExtensionTask ($ext_name) {
 // Creates a task for automatically deactivated (deprecated) extension
 function createExtensionDeactivationTask ($ext_name) {
        // Create subject line
-       $subject = sprintf("[%s:] %s", $ext_name, '{--TASK_SUBJ_EXTENSION_DEACTIVATED--}');
+       $subject = sprintf("[%s:] %s", $ext_name, '{--ADMIN_TASK_EXTENSION_DEACTIVATED_SUBJECT--}');
 
        // Get task id
        $taskId = determineTaskIdBySubject($subject);