]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Reverted of changes in 1704, see ticket #160
[mailer.git] / inc / extensions-functions.php
index b3421876b54d6f09679de0b2da6e08775bd1d7e9..a33aabce0f13c33ae093a8315cf57f4f0c3310e7 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -866,7 +867,7 @@ function doDeactivateExtension($ext_name) {
 
                // Notify the admin
                sendAdminNotification(
 
                // Notify the admin
                sendAdminNotification(
-               getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
+                       getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
                        'admin_ext_deactivated',
                        array('ext_name' => $ext_name)
                );
                        'admin_ext_deactivated',
                        array('ext_name' => $ext_name)
                );
@@ -960,9 +961,9 @@ function ifModuleHasMenu ($mod, $forceDb = false) {
                        // Check cache and count hit
                        $ret = ($GLOBALS['cache_array']['extension']['ext_menu'][$mod] == 'Y');
                        incrementStatsEntry('cache_hits');
                        // 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
                }
        } elseif ((isExtensionInstalled('sql_patches')) && (getExtensionVersion('sql_patches') >= '0.3.6') && ((!isExtensionActive('cache')) || ($forceDb === true))) {
                // Check database for entry
@@ -984,8 +985,11 @@ function ifModuleHasMenu ($mod, $forceDb = false) {
                // Free memory
                SQL_FREERESULT($result);
        } elseif (!isExtensionInstalled('sql_patches')) {
                // 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!
+               logDebugMessage(__FUNCTION__, __LINE__, 'This should never be reached.');
        }
 
        // Return status
        }
 
        // Return status
@@ -1447,7 +1451,7 @@ function getCurrentExtensionVersion () {
        return $GLOBALS['ext_current_version'];
 }
 
        return $GLOBALS['ext_current_version'];
 }
 
-// Remove the extension from global cache array
+// Remove the extension from cache array
 function removeExtensionFromArray () {
        // "Cache" this name
        $ext_name = getCurrentExtensionName();
 function removeExtensionFromArray () {
        // "Cache" this name
        $ext_name = getCurrentExtensionName();