$accessLevel, 'type' => $type, 'content' => ''));
// Add pre-content
$prefix = $ret['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: */ debugOutput(__LINE__.'*'.$type.'/'.getWhat().'*');
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
//* DEBUG: */ debugOutput(__LINE__.'+'.$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' => ''));
// Add additional content
$OUT .= $ret['content'];
} // 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';
$ADD = '';
// 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
if (!isAdmin()) {
$ADD = " AND `visible`='Y' AND `locked`='N'";
} // 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: */ debugOutput(__LINE__.'/'.$main_cnt.':'.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() . '*');
// 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: */ 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
if ((!empty($what)) && (($what == $content['sub_what']))) {
$OUT = '