All, except security block, include()/require() rewritten to own LOAD_INC()/LOAD_INC_...
[mailer.git] / inc / mysql-manager.php
index 9e82899320d6fc47a5ed41c1364f7b03d1a9006b..7afa45ddfe290674249104cfc6bbb967d42c746e 100644 (file)
@@ -155,7 +155,7 @@ function CHECK_MODULE ($mod) {
        // Still no luck or not found?
        if (($ret == "cache_miss") || (!$found)) {
                //              ----- Legacy module -----                                   ---- Module in base folder  ----                       --- Module with extension's name ---
-               if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", PATH, $extension, $mod)))) {
+               if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
                        // Data is missing so we add it
                        if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
                                // Since 0.3.6 we have a has_menu column, this took me a half hour
@@ -369,9 +369,8 @@ function ADD_MENU ($MODE, $act, $wht) {
 
                                        // Full file name for checking menu
                                        //* DEBUG: */ echo __LINE__.":!!!!".$sub_what."!!!<br />\n";
-                                       $test_inc = sprintf("%sinc/modules/%s/what-%s.php", PATH, $MODE, $sub_what);
-                                       $test = (FILE_READABLE($test_inc));
-                                       if ($test) {
+                                       $FQFN = sprintf("%sinc/modules/%s/what-%s.php", constant('PATH'), $MODE, $sub_what);
+                                       if (FILE_READABLE($FQFN)) {
                                                if ((!empty($wht)) && (($wht == $sub_what))) {
                                                        $content = "<strong>";
                                                }
@@ -385,7 +384,7 @@ function ADD_MENU ($MODE, $act, $wht) {
                                        // Menu title
                                        $content .= getConfig('menu_blur_spacer') . $sub_title;
 
-                                       if ($test) {
+                                       if (FILE_READABLE($FQFN)) {
                                                $content .= "</a>";
                                        } else {
                                                $content .= "</em>";
@@ -411,14 +410,14 @@ function ADD_MENU ($MODE, $act, $wht) {
                        } else {
                                // This is a menu block... ;-)
                                $BLOCK_MODE = true;
-                               $INC_BLOCK = sprintf("%sinc/modules/%s/action-%s.php", PATH, $MODE, $main_action);
+                               $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $MODE, $main_action);
                                if (FILE_READABLE($INC_BLOCK)) {
                                        // Load include file
                                        if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("<tr>
 
   <td class=\"".$MODE."_menu_whats\">");
                                        //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
-                                       include ($INC_BLOCK);
+                                       LOAD_INC($INC_BLOCK);
                                        //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
                                        if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("  </td>
 </tr>");