New wrapper functions enableBlockMode() and isBlockModeEnabled() introduced
[mailer.git] / inc / mysql-manager.php
index d0edc7d94fb381bb8337a3dae2ceedb09cd149a7..726ddbd2053f115cc376782e439317c299957269 100644 (file)
@@ -410,8 +410,8 @@ function ADD_MENU ($mode, $act, $wht) {
        } // END - if
 
        // Load SQL data and add the menu to the output stream...
-       $result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
-       array($mode), __FUNCTION__, __LINE__);
+       $result_main = SQL_QUERY_ESC("SELECT `title`, `action` FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
+               array($mode), __FUNCTION__, __LINE__);
        //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />\n";
        if (SQL_NUMROWS($result_main) > 0) {
                OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
@@ -419,11 +419,11 @@ function ADD_MENU ($mode, $act, $wht) {
                while ($content = SQL_FETCHARRAY($result_main)) {
                        //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />\n";
                        // Init variables
-                       $GLOBALS['block_mode'] = false;
+                       enableBlockMode(false);
                        $act = $content['action'];
 
                        // Load menu header template
-                       LOAD_TEMPLATE($mode."_menu_title", false, $content);
+                       LOAD_TEMPLATE($mode . '_menu_title', false, $content);
 
                        // Sub menu
                        $result_sub = SQL_QUERY_ESC("SELECT title AS sub_title, what AS sub_what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`",
@@ -490,7 +490,7 @@ function ADD_MENU ($mode, $act, $wht) {
                                }
                        } else {
                                // This is a menu block... ;-)
-                               $GLOBALS['block_mode'] = true;
+                               enableBlockMode();
                                $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
                                if (isFileReadable($INC_BLOCK)) {
                                        // Load include file