X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=c9c73e5718505fb6c716136322221c4c54f7b48f;hp=e691d6cf7cc8a5ea6e4fe1da19b04f9cdf7a4d65;hb=1e1188491367caefea828ed0dca143c7115c02c5;hpb=41d7cc2d4ab3b725d1cd2cbe022dd49fbfc0065a
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index e691d6cf7c..c9c73e5718 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -91,7 +91,7 @@ function getModuleTitle ($mod) {
// "Getter" for module description
// @TODO Can we cache this?
-function getModuleDescription ($mode, $what, $column = 'what') {
+function getTitleFromMenu ($mode, $what, $column = 'what', $ADD='') {
// Fix empty 'what'
if (empty($what)) {
$what = getConfig('index_home');
@@ -101,8 +101,12 @@ function getModuleDescription ($mode, $what, $column = 'what') {
$ret = '??? (' . $what . ')';
// Look for title
- $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE %s='%s' LIMIT 1",
- array($mode, $column, $what), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `%s`='%s'" . $ADD . " LIMIT 1",
+ array(
+ $mode,
+ $column,
+ $what
+ ), __FUNCTION__, __LINE__);
// Is there an entry?
if (SQL_NUMROWS($result) == 1) {
@@ -351,42 +355,32 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false, $output = tru
} // END - i
// Get the title from menu
- $result = SQL_QUERY_ESC("SELECT title FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE %s='%s' ".$AND." LIMIT 1",
- array($accessLevel, $type, $search), __FUNCTION__, __LINE__);
-
- // Menu found?
- if (SQL_NUMROWS($result) == 1) {
- // Load title
- list($ret) = SQL_FETCHROW($result);
-
- // Shall we return it?
- if ($return === true) {
- // Return title
- return $ret;
- } elseif (((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (getConfig('youre_here') == 'Y')) || ((isAdmin()) && ($modCheck == 'admin'))) {
- // Output HTML code
- $OUT = $prefix . "" . $ret . "\n";
-
- // Can we close the you-are-here navigation?
- //* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*
");
- if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
- //* DEBUG: */ print(__LINE__.'+'.$type."+
");
- // Add closing div and br-tag
- $OUT .= "
\n";
- $GLOBALS['nav_depth'] = '0';
-
- // Run the filter chain
- $ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ""));
- $OUT .= $ret['content'];
- } // END - if
- }
- } // END - if
+ $ret = getTitleFromMenu($accessLevel, $search, $type, $AND);
- // Free result
- SQL_FREERESULT($result);
+ // Shall we return it?
+ if ($return === true) {
+ // Return title
+ return $ret;
+ } elseif (((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (getConfig('youre_here') == 'Y')) || ((isAdmin()) && ($modCheck == 'admin'))) {
+ // Output HTML code
+ $OUT = $prefix . "" . $ret . "\n";
+
+ // Can we close the you-are-here navigation?
+ //* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*
");
+ if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
+ //* DEBUG: */ print(__LINE__.'+'.$type."+
");
+ // Add closing div and br-tag
+ $OUT .= "
\n";
+ $GLOBALS['nav_depth'] = '0';
+
+ // Run the filter chain
+ $ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ""));
+ $OUT .= $ret['content'];
+ } // END - if
+ }
// Return or output HTML code?
- if ($output) {
+ if ($output === true) {
// Output HTML code here
outputHtml($OUT);
} else {