// "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');
$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) {
} // 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 . "<strong><a class=\"you_are_here\" href=\"{?URL?}/modules.php?module=" . $modCheck . '&' . $type . '=' . $search.$LINK_ADD . "\">" . $ret . "</a></strong>\n";
-
- // Can we close the you-are-here navigation?
- //* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*<br />");
- if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
- //* DEBUG: */ print(__LINE__.'+'.$type."+<br />");
- // Add closing div and br-tag
- $OUT .= "</div><br />\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 . "<strong><a class=\"you_are_here\" href=\"{?URL?}/modules.php?module=" . $modCheck . '&' . $type . '=' . $search.$LINK_ADD . "\">" . $ret . "</a></strong>\n";
+
+ // Can we close the you-are-here navigation?
+ //* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*<br />");
+ if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
+ //* DEBUG: */ print(__LINE__.'+'.$type."+<br />");
+ // Add closing div and br-tag
+ $OUT .= "</div><br />\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 {