X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=890392a5b0a96b45798dce52efc1e32f3bc6fd9f;hb=4ba0d29f12dae79ebde25004a1df4155e0faf69c;hp=781acb611c96eb8582371e38506db7ea1d4bb088;hpb=5deec33be1baf2135eefc2bbb0d1b63c6cbd2f9a;p=mailer.git
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index 781acb611c..890392a5b0 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -10,7 +10,12 @@
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Alle MySQL-Relevanten Funktionen *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: 856 $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
@@ -114,6 +119,12 @@ function checkModulePermissions ($mod) {
// Check if cache is latest version
if (GET_EXT_VERSION("cache") >= "0.1.2") {
+ // Is the cache there?
+ if (!isset($GLOBALS['cache_array']['modules'])) {
+ // This should normally not happen...
+ debug_report_bug("Cache 'modules' is gone.");
+ } // END - if
+
// Is the module cached?
if (isset($GLOBALS['cache_array']['modules']['locked'][$mod_chk])) {
// Check cache
@@ -306,7 +317,7 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
list($ret) = SQL_FETCHROW($result);
// Shall we return it?
- if ($return) {
+ if ($return === true) {
// Return title
return $ret;
} elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && (getConfig('youre_here') == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) {
@@ -351,13 +362,13 @@ function ADD_MENU ($MODE, $act, $wht) {
// is the menu action valid?
if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) {
- return getMessage('CODE_MENU_NOT_VALID');
+ return getCode('MENU_NOT_VALID');
} // END - if
// Non-admin shall not see all menus
if (!IS_ADMIN()) {
$AND = " AND `visible`='Y' AND `locked`='N'";
- }
+ } // 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`",
@@ -366,60 +377,69 @@ function ADD_MENU ($MODE, $act, $wht) {
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("
");
// There are menus available, so we simply display them... :)
- while (list($main_title, $main_action) = SQL_FETCHROW($result_main)) {
- //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."* \n";
+ while ($content = SQL_FETCHARRAY($result_main)) {
+ //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$sub_what.":".$GLOBALS['what']."* \n";
// Init variables
- $BLOCK_MODE = false; $act = $main_action;
-
- // Prepare content
- $content = array(
- 'action' => $main_action,
- 'title' => $main_title
- );
+ $GLOBALS['block_mode'] = false;
+ $act = $content['action'];
// Load menu header template
LOAD_TEMPLATE($MODE."_menu_title", false, $content);
- $result_sub = SQL_QUERY_ESC("SELECT title, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`",
- array($MODE, $main_action), __FUNCTION__, __LINE__);
+ // 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`",
+ array($MODE, $content['action']), __FUNCTION__, __LINE__);
+
+ // Get number of rows
$ctl = SQL_NUMROWS($result_sub);
+
+ // Do we have some entries?
if ($ctl > 0) {
- $cnt=0;
- while (list($sub_title, $sub_what) = SQL_FETCHROW($result_sub)) {
+ // Init counter
+ $cnt = 0;
+
+ // Load all sub menus
+ while ($content2 = SQL_FETCHARRAY($result_sub)) {
+ // Merge both arrays in one
+ $content = merge_array($content, $content2);
+
// Init content
- $content = "";
+ $OUT = "";
// Full file name for checking menu
- //* DEBUG: */ echo __LINE__.":!!!!".$sub_what."!!! \n";
- $FQFN = sprintf("%sinc/modules/%s/what-%s.php", constant('PATH'), $MODE, $sub_what);
- if (FILE_READABLE($FQFN)) {
- if ((!empty($wht)) && (($wht == $sub_what))) {
- $content = "";
+ //* DEBUG: */ echo __LINE__.":!!!!".$content['sub_what']."!!! \n";
+ $INC = sprintf("inc/modules/%s/what-%s.php", $MODE, $content['sub_what']);
+ if (INCLUDE_READABLE($INC)) {
+ if ((!empty($wht)) && (($wht == $content['sub_what']))) {
+ $OUT = "";
}
// Navigation link
- $content .= "";
+ $OUT .= "";
} else {
- $content .= "";
+ $OUT .= "";
}
// Menu title
- $content .= getConfig('menu_blur_spacer') . $sub_title;
+ $OUT .= getConfig('menu_blur_spacer') . $content['sub_title'];
- if (FILE_READABLE($FQFN)) {
- $content .= "";
+ if (INCLUDE_READABLE($INC)) {
+ $OUT .= "";
} else {
- $content .= "";
+ $OUT .= "";
}
- if ((!empty($wht)) && (($wht == $sub_what))) {
- $content .= "";
- }
- $wht = $sub_what; $cnt++;
- // Prepare array
+ if ((!empty($wht)) && (($wht == $content['sub_what']))) {
+ $OUT .= "";
+ } // END - if
+
+ // Remember 'what' for next round and count it up
+ $wht = $content['sub_what']; $cnt++;
+
+ // Rewrite array
$content = array(
- 'menu' => $content,
- 'what' => $sub_what
+ 'menu' => $OUT,
+ 'what' => $content['sub_what']
);
// Add regular menu row or bottom row?
@@ -431,31 +451,33 @@ function ADD_MENU ($MODE, $act, $wht) {
}
} else {
// This is a menu block... ;-)
- $BLOCK_MODE = true;
- $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $MODE, $main_action);
+ $GLOBALS['block_mode'] = true;
+ $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $MODE, $content['action']);
if (FILE_READABLE($INC_BLOCK)) {
// Load include file
- if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("
+ if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == "online")) OUTPUT_HTML("