Fixed issues with themes
[mailer.git] / inc / modules / guest / action-themes.php
index 8b4ee7ff02b5afa0c2c73ed33a1e127329ddac73..28c50740610b686d6fcb250e4c547149ec44b1c1 100644 (file)
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} // END - if
-
-// Add description as navigation point
-addMenuDescription('guest', __FILE__);
+} elseif (!isBlockModeEnabled()) {
+       // Non-block mode detected
+       return;
+}
 
 if ((!isExtensionActive('theme')) && (!isAdmin())) {
        loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('theme'));
@@ -51,13 +51,14 @@ if ((!isExtensionActive('theme')) && (!isAdmin())) {
 
 // Get total num
 if (isAdmin()) {
-       // Load only active designs for user
-       $num_themes = countSumTotalData('Y', 'themes', 'id', 'theme_active', true);
-} else {
        // Load all themes for admin
        $num_themes = countSumTotalData('', 'themes', 'id', '', true);
+} else {
+       // Load only active designs for user
+       $num_themes = countSumTotalData('Y', 'themes', 'id', 'theme_active', true);
 }
 
+$OUT = '';
 if ($num_themes > 1) {
        // If more than 1 is installed output selection box
        $OUT = generateThemeSelectionBox();
@@ -66,7 +67,7 @@ if ($num_themes > 1) {
        $OUT = loadTemplate('theme_one', true, getCurrentThemeName());
 } elseif (isAdmin()) {
        // If there is no theme installed and there's an admin notify him!
-       $OUT = loadTemplate('admin_settings_saved', true, "<div class=\"admin_note\">{--ADMIN_NO_THEME_INSTALLED_WARNING--}</div>");
+       $OUT = '{--ADMIN_NO_THEME_INSTALLED_WARNING--}';
 }
 
 // Load final box template