]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Endless redirect fixed and needless action/what sets removed
[mailer.git] / inc / extensions-functions.php
index c73a57fe4c3bc0d2adbbc45b50623c868a5f61d3..a9c6fd92391bdc6227654e03015edf95292af0a8 100644 (file)
@@ -682,7 +682,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
        $OUT = '';
 
        // Do we have queries?
-       if ((getExtensionVersion('sql_patches') >= '0.0.7') && (getConfig('verbose_sql') == 'Y')) {
+       if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
                // Init switch color
                $SW = 2;
 
@@ -721,7 +721,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
 
                // Load main template
                $OUT = loadTemplate('admin_ext_sql_table', true, $content);
-       } elseif ((getExtensionVersion('sql_patches') >= '0.0.7') && (getConfig('verbose_sql') == 'Y')) {
+       } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
                // No addional SQL commands to run
                $OUT = loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_ADDITIONAL_SQLS'));
        } // END - if
@@ -866,7 +866,7 @@ function doDeactivateExtension($ext_name) {
 
                // Notify the admin
                sendAdminNotification(
-               getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
+                       getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
                        'admin_ext_deactivated',
                        array('ext_name' => $ext_name)
                );
@@ -960,9 +960,9 @@ function ifModuleHasMenu ($mod, $forceDb = false) {
                        // Check cache and count hit
                        $ret = ($GLOBALS['cache_array']['extension']['ext_menu'][$mod] == 'Y');
                        incrementStatsEntry('cache_hits');
-               } elseif ($mod == 'admin') {
-                       // Admin module has always a menu!
-                       $ret = true;
+               } else {
+                       // Admin/guest/member/sponsor modules have always a menu!
+                       $ret = in_array($mod, array('admin', 'index', 'login', 'sponsor'));
                }
        } elseif ((isExtensionInstalled('sql_patches')) && (getExtensionVersion('sql_patches') >= '0.3.6') && ((!isExtensionActive('cache')) || ($forceDb === true))) {
                // Check database for entry
@@ -984,8 +984,11 @@ function ifModuleHasMenu ($mod, $forceDb = false) {
                // Free memory
                SQL_FREERESULT($result);
        } elseif (!isExtensionInstalled('sql_patches')) {
-               // No sql_patches installed, so maybe in admin area or no admin registered?
-               $ret = (((isAdmin()) || (!isAdminRegistered())) && ($mod == 'admin')); // Then there is a menu!
+               // No sql_patches installed, so maybe in admin/guest/member/sponsor area or no admin registered?
+               $ret = in_array($mod, array('admin', 'index', 'login', 'sponsor')); // Then there is a menu!
+       } else {
+               // Unsupported state!
+               debug_report_bug('This should never be reached.');
        }
 
        // Return status