X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=ac33024157fe66bd8571ab9c771c204517f1512e;hb=8d4176053d397a86baca20b4d7ab7ed526355be8;hp=afd2f1caab172368b776823d70d96b759c5d6298;hpb=8f14df8c3232a31917df0ac57363dbd6e975c147;p=mailer.git
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index afd2f1caab..ac33024157 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -139,10 +139,10 @@ function checkModulePermissions ($module = '') {
// Check for prefix is a extension...
$modSplit = explode('_', $module);
$extension = ''; $module_chk = $module;
- //* DEBUG: */ print(__LINE__."*".count($modSplit)."*/".$module."*
");
+ //* DEBUG: */ debugOutput(__LINE__.'*'.count($modSplit).'/'.$module.'*');
if (count($modSplit) == 2) {
// Okay, there is a seperator (_) in the name so is the first part a module?
- //* DEBUG: */ print(__LINE__."*".$modSplit[0]."*
");
+ //* DEBUG: */ debugOutput(__LINE__.'*'.$modSplit[0].'*');
if (isExtensionActive($modSplit[0])) {
// The prefix is an extension's name, so let's set it
$extension = $modSplit[0]; $module = $modSplit[1];
@@ -302,6 +302,7 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) {
$LINK_ADD = '';
$OUT = '';
$ADD = '';
+ $prefix = '';
// First we have to do some analysis...
if (substr($file, 0, 7) == 'action-') {
@@ -344,11 +345,19 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) {
// Begin the navigation line
if ((!isset($GLOBALS['nav_depth'])) && ($return === false)) {
+ // Init nav_depth
$GLOBALS['nav_depth'] = '0';
- $prefix = '
{--YOU_ARE_HERE--}
Home';
- } else {
- if ($return === false) $GLOBALS['nav_depth']++;
- $prefix = '';
+
+ // Run the pre-filter chain
+ $ret = runFilterChain('pre_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ''));
+
+ // Add pre-content
+ $prefix = $ret['content'];
+
+ $prefix .= '
{--YOU_ARE_HERE--}
Home';
+ } elseif ($return === false) {
+ // Count depth
+ $GLOBALS['nav_depth']++;
}
$prefix .= ' -> ';
@@ -364,20 +373,20 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) {
$OUT = $prefix . '
' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '';
// Can we close the you-are-here navigation?
- //* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*
");
+ //* DEBUG: */ debugOutput(__LINE__.'*'.$type.'/'.getWhat().'*');
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
- //* DEBUG: */ print(__LINE__.'+'.$type."+
");
+ //* DEBUG: */ debugOutput(__LINE__.'+'.$type.'+');
// Add closing div and br-tag
- $OUT .= '
';
+ $OUT .= '
';
$GLOBALS['nav_depth'] = '0';
- // Run the filter chain
+ // Run the post-filter chain
$ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ''));
// Add additional content
$OUT .= $ret['content'];
} // END - if
- }
+ } // END - if
// Return or output HTML code?
if ($return === true) {
@@ -406,24 +415,44 @@ function addMenu ($mode, $action, $what) {
} // END - if
// Load SQL data and add the menu to the output stream...
- $result_main = SQL_QUERY_ESC("SELECT `title`, `action`, `visible`, `locked` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$ADD." ORDER BY `sort` ASC",
+ $result_main = SQL_QUERY_ESC("SELECT
+ `title`, `what`, `action`, `visible`, `locked`
+FROM
+ `{?_MYSQL_PREFIX?}_%s_menu`
+WHERE
+ (`what`='' OR `what` IS NULL)
+ ".$ADD."
+ORDER BY
+ `sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ print(__LINE__.'/'.$main_cnt.':'.getWhat()."*
");
+ //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
if (SQL_NUMROWS($result_main) > 0) {
// There are menus available, so we simply display them... :)
$GLOBALS['rows'] = '';
while ($content = SQL_FETCHARRAY($result_main)) {
- //* DEBUG: */ print(__LINE__.'/'.$main_cnt.'/'.$content['action'].':'.getWhat()."*
");
- // Init/"translate" variables
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . ':' . getWhat() . '*');
+ // Disable the block-mode
enableBlockMode(false);
- $content = translateMenuVisibleLocked($content);
// Load menu header template
$GLOBALS['rows'] .= loadTemplate($mode . '_menu_title', true, $content);
// Sub menu
- $result_sub = SQL_QUERY_ESC("SELECT `title` AS sub_title, `what` AS sub_what, `visible` AS sub_visible, `locked` AS sub_locked FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$ADD." ORDER BY `sort` ASC",
+ $result_sub = SQL_QUERY_ESC("SELECT
+ `title` AS `sub_title`,
+ `what` AS `sub_what`,
+ `visible` AS `sub_visible`,
+ `locked` AS `sub_locked`
+FROM
+ `{?_MYSQL_PREFIX?}_%s_menu`
+WHERE
+ `action`='%s' AND
+ `what` != '' AND
+ `what` IS NOT NULL
+ ".$ADD."
+ORDER BY
+ `sort` ASC",
array($mode, $content['action']), __FUNCTION__, __LINE__);
// Do we have some entries?
@@ -436,14 +465,11 @@ function addMenu ($mode, $action, $what) {
// Merge both arrays in one
$content = merge_array($content, $content2);
- // Translate visible/locked again
- $content = translateMenuVisibleLocked($content, 'sub_');
-
// Init content
$OUT = '';
// Full file name for checking menu
- //* DEBUG: */ print(__LINE__ . ':!!!!' . $content['sub_what'] . '!!!
');
+ //* DEBUG: */ debugOutput(__LINE__ . ':!!!!' . $content['sub_what'] . '!!!');
$inc = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
if (isIncludeReadable($inc)) {
// Mark currently selected menu - open
@@ -455,7 +481,7 @@ function addMenu ($mode, $action, $what) {
$OUT .= '