$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
$GLOBALS['nav_depth']++;
}
$prefix .= ' -> ';
// We need to remove .php and the end
if (substr($search, -4, 4) == '.php') {
// Remove the .php
$search = substr($search, 0, -4);
} // END - if
if (((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (getConfig('youre_here') == 'Y')) || ((isAdmin()) && ($modCheck == 'admin'))) {
// Output HTML code
$OUT = $prefix . '
' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '';
// Can we close the you-are-here navigation?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type . 'getWhat()=' . getWhat());
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type);
// Add closing div and br-tag
$GLOBALS['nav_depth'] = '0';
// Run the post-filter chain
$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'];
// Close div-tag, so not the filters have to do it
$OUT .= '
';
} // END - if
} // END - if
// Return or output HTML code?
if ($return === true) {
// Return HTML code
return $OUT;
} else {
// Output HTML code here
outputHtml($OUT);
}
}
// Adds a menu (mode = guest/member/admin/sponsor) to output
function addMenu ($mode, $action, $what) {
// Init some variables
$main_cnt = '0';
// is the menu action valid?
if (!isMenuActionValid($mode, $action, $what, true)) {
return getCode('MENU_NOT_VALID');
} // END - if
// Non-admin shall not see all menus
$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`
FROM
`{?_MYSQL_PREFIX?}_%s_menu`
WHERE
(`what`='' OR `what` IS NULL)
".$ADD."
ORDER BY
`sort` ASC",
array($mode), __FUNCTION__, __LINE__);
//* 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: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
// Disable the block-mode
enableBlockMode(false);
// 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",
array($mode, $content['action']), __FUNCTION__, __LINE__);
// Do we have some entries?
if (!SQL_HASZERONUMS($result_sub)) {
// Init counter
$count = '0';
// Load all sub menus
while ($content2 = SQL_FETCHARRAY($result_sub)) {
// Merge both arrays in one
$content = merge_array($content, $content2);
// Init content
$OUT = '';
// Full file name for checking menu
//* 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
if ((!empty($what)) && (($what == $content['sub_what']))) {
$OUT = '