]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-extensions.php
Fixed missed [sw] things in a lot templates, added more EL:
[mailer.git] / inc / modules / admin / what-extensions.php
index 1b26990c868821c931e034825ff2e7c92406ec70..c25ef8fe423ef792f06722c74ab76bddff663ed6 100644 (file)
@@ -116,7 +116,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                redirectToUrl('modules.php?module=admin&what=extensions&edited=' . countPostSelection());
        } else {
                // Edit selected entries
-               $SW = 2; $OUT = '';
+               $OUT = '';
                foreach (postRequestParameter('sel') as $ext_id => $sel) {
                        // Edit this extension?
                        if (($sel == 'Y') || ($sel != 'Y')) {
@@ -145,7 +145,6 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                                // Prepare data for the row template
                                $content = array(
-                                       'sw'     => $SW,
                                        'id'     => $ext_id,
                                        'name'   => getExtensionName($ext_id),
                                        'active' => addSelectionBox('yn', $active, 'active', $ext_id),
@@ -154,8 +153,7 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_extensions_edit_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
+                       } // END - if
                } // END - foreach
 
                // Load template
@@ -164,7 +162,7 @@ if (isGetRequestParameterSet('reg_ext')) {
        }
 } elseif ((isPostRequestParameterSet('delete')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // List extensions and when verbose is enabled SQL statements which will be executed
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $ext_id => $sel) {
                // Init variables
                $VERBOSE_OUT = '';
@@ -188,7 +186,6 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                        // Prepare data for the row template
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $ext_id,
                                'ext_name' => $ext_name,
                                'ext_ver'  => getExtensionVersion($ext_name),
@@ -200,14 +197,12 @@ if (isGetRequestParameterSet('reg_ext')) {
                } else {
                        // Prepare data for the row template
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $ext_id
                        );
 
                        // Not valid!
                        $OUT .= loadTemplate('admin_extensions_delete_row_404', true, $content);
                }
-               $SW = 3 - $SW;
        } // END - foreach
 
        // Load template
@@ -257,42 +252,39 @@ switch ($do) {
        case 'overview': // List all registered extensions
                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                        // Load extension data with CSS informations
-                       $result = SQL_QUERY("SELECT `id` AS ext_id, `ext_name`, `ext_active`, `ext_has_css` AS ext_css, `ext_version`
-FROM `{?_MYSQL_PREFIX?}_extensions`
+                       $result = SQL_QUERY("SELECT
+       `id` AS ext_id, `ext_name`, `ext_active`, `ext_has_css` AS ext_css, `ext_version`
+FROM
+       `{?_MYSQL_PREFIX?}_extensions`
 ".$where."
-ORDER BY `ext_name` ASC", __FILE__, __LINE__);
+ORDER BY
+       `ext_name` ASC", __FILE__, __LINE__);
                } else {
                        // Load extension data without CSS informations
-                       $result = SQL_QUERY("SELECT `id` AS ext_id, `ext_name`, `ext_active`, `id`, `ext_version`
-FROM `{?_MYSQL_PREFIX?}_extensions`
+                       $result = SQL_QUERY("SELECT
+       `id` AS ext_id, `ext_name`, `ext_active, `ext_version`
+FROM
+       `{?_MYSQL_PREFIX?}_extensions`
 ".$where."
-ORDER BY `ext_name` ASC", __FILE__, __LINE__);
+ORDER BY
+       `ext_name` ASC", __FILE__, __LINE__);
                }
 
                // Are there some entries?
                if (SQL_NUMROWS($result) > 0) {
                        // Extensions are registered
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Prepare CSS selection output
                                $cssSelection = '---';
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) $cssSelection = translateYesNo($content['ext_css']);
 
                                // Prepare data for the row template
-                               $content = array(
-                                       'sw'      => $SW,
-                                       'id'      => $content['ext_id'],
-                                       'name'    => $content['ext_name'],
-                                       'active'  => translateYesNo($content['ext_active']),
-                                       'act_val' => $content['ext_active'],
-                                       'css'     => $cssSelection,
-                                       'ver'     => $content['ext_version'],
-                               );
+                               $content['ext_css'] = $cssSelection;
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_extensions_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
+                       } // END - while
 
                        // Free memory
                        SQL_FREERESULT($result);
@@ -301,7 +293,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                        loadTemplate('admin_extensions', false, $OUT);
                } else {
                        // No extensions are registered
-                       loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_EXTENSION_REGISTERED'));
+                       loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_EXTENSION_REGISTERED--}');
                }
                break;
 
@@ -318,16 +310,16 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                        // id is valid so begin with registration, we first want to it's real name from task management (subject column)
                        $result = SQL_QUERY_ESC("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
                                array(bigintval($ext_id)), __FILE__, __LINE__);
-                       list($subj) = SQL_FETCHROW($result);
+                       list($subject) = SQL_FETCHROW($result);
 
                        // Free result
                        SQL_FREERESULT($result);
 
                        // Disable cache update by default
                        $cache_update = '0';
-                       if (!empty($subj)) {
+                       if (!empty($subject)) {
                                // Extract extension's name from subject...
-                               $ext_name = trim(substr($subj, 1, strpos($subj, ':') - 1));
+                               $ext_name = trim(substr($subject, 1, strpos($subject, ':') - 1));
 
                                // Test the extension for deprecation
                                loadExtension($ext_name, 'test');
@@ -345,12 +337,12 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                                                        if (isExtensionActive('task')) {
                                                                loadTemplate('admin_next_link', false, array(
                                                                        'url'   => 'modules.php?module=admin&what=list_task',
-                                                                       'title' => getMessage('ADMIN_EXTENSION_REGISTER_NEXT_LINK')
+                                                                       'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
                                                                ));
                                                        } else {
                                                                loadTemplate('admin_next_link', false, array(
                                                                        'url'   => 'modules.php?module=admin',
-                                                                       'title' => getMessage('ADMIN_EXTENSION_REGISTER_NEXT_LINK')
+                                                                       'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
                                                                ));
                                                        }
                                                } else {
@@ -369,30 +361,30 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                                                } // END - if
                                        } elseif (isExtensionInstalled($ext_name)) {
                                                // Notify the admin that we have a problem here...
-                                               loadTemplate('admin_settings_saved', false, getMessage('ADMIN_EXTENSION_REGISTRATION_FAILED_ALREADY'));
+                                               loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_ALREADY--}');
                                        } else {
                                                // Notify the admin that we have a problem here...
                                                loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_REGISTRATION_FAILED_404', $ext_name));
                                        }
                                } else {
                                        // Motify the admin that we have a problem here...
-                                       loadTemplate('admin_settings_saved', false, getMessage('ADMIN_EXTENSION_REGISTRATION_FAILED_DEPRECATED'));
+                                       loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_DEPRECATED--}');
                                }
                        } else {
                                // Extension was not found in task management
-                               loadTemplate('admin_settings_saved', false, getMessage('ADMIN_EXTENSION_REGISTRATION_FAILED_ID_404'));
+                               loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_ID_404--}');
                        }
                } elseif ($task_found == '0') {
                        // No longer assigned or old task
-                       loadTemplate('admin_settings_saved', false, getMessage('ADMIN_EXTENSION_REGISTRATION_FAILED_ASSIGED'));
+                       loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_ASSIGED--}');
                } else {
                        // id is invalid
-                       loadTemplate('admin_settings_saved', false, getMessage('ADMIN_EXTENSION_REGISTRATION_FAILED_INVALID'));
+                       loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_INVALID--}');
                }
                break;
 
        case 'demo':
-               loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_NOT_SAVED'));
+               loadTemplate('admin_settings_saved', false, '{--SETTINGS_NOT_SAVED--}');
                break;
 } // END - switch