X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmysql-manager.php;h=2b879de773f2d4efce72164d78e206ed41886951;hb=262c3e87d0a80ec8a4435b2564d4b666fd329bf6;hp=e1ed9ac4ea24b8b7f0b521a8dc84e74adb107acb;hpb=e0ebc4d305c2647a9cbce54602439987d7b103f4;p=mailer.git
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index e1ed9ac4ea..2b879de773 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -17,7 +17,7 @@
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2011 by Mailer Developer Team *
- * For more information visit: http://www.mxchange.org *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -46,7 +46,13 @@ function getTitleFromMenu ($mode, $what, $column = 'what', $ADD='') {
// Fix empty 'what'
if (empty($what)) {
$what = getIndexHome();
- } // END - if
+ } elseif ((isGetRequestElementSet('action')) && ($column == 'what')) {
+ // Get it from action
+ return getTitleFromMenu($mode, getAction(), 'action', $ADD);
+ } elseif ($what == 'overview') {
+ // Overview page
+ return '{--WHAT_IS_OVERVIEW--}';
+ }
// Default is not found
$data['title'] = '??? (' . $what . ')';
@@ -98,13 +104,16 @@ function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
// This is a 'what file'!
$type = 'what';
$search = substr($file, 5);
- $ADD = " AND `visible`='Y' AND `locked`='N'";
// Get access level from it
$modCheck = getModuleFromFileName($file, $accessLevel);
// Do we have admin? Then display all
- if (isAdmin()) $ADD = '';
+ $ADD = " AND `visible`='Y' AND `locked`='N'";
+ if (isAdmin()) {
+ // Display all!
+ $ADD = '';
+ } // END - if
$dummy = substr($search, 0, -4);
$ADD .= sprintf(" AND `action`='%s'", getActionFromModuleWhat($accessLevel, $dummy));
@@ -128,11 +137,12 @@ function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
$GLOBALS['nav_depth'] = '0';
// Run the pre-filter chain
- $ret = runFilterChain('pre_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ''));
+ $ret = runFilterChain('pre_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'search' => $search, 'prefix' => $prefix, 'link_add' => $LINK_ADD, 'content' => '', 'add' => $ADD));
// Add pre-content
$prefix = $ret['content'];
+ // Add default content
$prefix .= '
{--YOU_ARE_HERE--}
Home';
} elseif ($return === false) {
// Count depth
@@ -152,18 +162,20 @@ function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
$OUT = $prefix . '
' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '';
// Can we close the you-are-here navigation?
- //* DEBUG: */ debugOutput(__LINE__.'*'.$type.'/'.getWhat().'*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type . 'getWhat()=' . getWhat());
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
- //* DEBUG: */ debugOutput(__LINE__.'+'.$type.'+');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type);
// Add closing div and br-tag
- $OUT .= '
';
$GLOBALS['nav_depth'] = '0';
// Run the post-filter chain
- $ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ''));
+ $ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'search' => $search, 'prefix' => $prefix, 'link_add' => $LINK_ADD, 'content' => $OUT, 'add' => $ADD));
+
+ // Get content from filter back
+ $OUT = $ret['content'];
- // Add additional content
- $OUT .= $ret['content'];
+ // Close div-tag, so not the filters have to do it
+ $OUT .= '';
} // END - if
} // END - if
@@ -181,7 +193,6 @@ function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
function addMenu ($mode, $action, $what) {
// Init some variables
$main_cnt = '0';
- $ADD = '';
// is the menu action valid?
if (!isMenuActionValid($mode, $action, $what, true)) {
@@ -189,13 +200,15 @@ function addMenu ($mode, $action, $what) {
} // END - if
// Non-admin shall not see all menus
- if (!isAdmin()) {
- $ADD = " AND `visible`='Y' AND `locked`='N'";
+ $ADD = " AND `visible`='Y' AND `locked`='N'";
+ if (isAdmin()) {
+ // Is admin, so make all visible
+ $ADD = '';
} // END - if
// Load SQL data and add the menu to the output stream...
$result_main = SQL_QUERY_ESC("SELECT
- `title`, `what`, `action`, `visible`, `locked`
+ `title`,`what`,`action`,`visible`,`locked`
FROM
`{?_MYSQL_PREFIX?}_%s_menu`
WHERE
@@ -205,12 +218,12 @@ ORDER BY
`sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
if (!SQL_HASZERONUMS($result_main)) {
// There are menus available, so we simply display them... :)
$GLOBALS['rows'] = '';
while ($content = SQL_FETCHARRAY($result_main)) {
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
// Disable the block-mode
enableBlockMode(false);
@@ -248,7 +261,7 @@ ORDER BY
$OUT = '';
// Full file name for checking menu
- //* DEBUG: */ debugOutput(__LINE__ . ':!!!!' . $content['sub_what'] . '!!!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sub_what=' . $content['sub_what']);
$inc = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
if (isIncludeReadable($inc)) {
// Mark currently selected menu - open
@@ -256,11 +269,17 @@ ORDER BY
$OUT = '';
} // END - if
- // Navigation link
- $OUT .= '