" . getConfigVar ('enterprise');
$path = getPath ($pageno);
foreach ($path as $no)
{
$title['params'] = array();
if (isset ($page[$no]['title']))
$title['name'] = $page[$no]['title'];
elseif (isset ($page[$no]['title_handler']))
$title = $page[$no]['title_handler']($no);
else
$title['name'] = '[N/A]';
echo ": $param_value)
echo "&${param_name}=${param_value}";
echo "'>" . $title['name'] . "";
}
echo "";
// Search form.
echo "
| ";
}
function getTitle ($pageno, $tabno)
{
global $page;
if (isset ($page[$pageno]['title']))
return $page[$pageno]['title'];
elseif (isset ($page[$pageno]['title_handler']))
{
$tmp = $page[$pageno]['title_handler']($pageno);
return $tmp['name'];
}
else
return getConfigVar ('enterprise');
}
function showTabs ($pageno, $tabno)
{
global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
if (!isset ($tab[$pageno]['default']))
return;
echo "";
foreach ($tab[$pageno] as $tabidx => $tabtitle)
{
// Hide forbidden tabs.
if (!permitted ($pageno, $tabidx))
continue;
// Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
if (isset ($trigger[$pageno][$tabidx]))
{
// $t1 = microtime (TRUE);
$ok = $trigger[$pageno][$tabidx] ();
// $t2 = microtime (TRUE);
// echo 'DEBUG: ' . $trigger[$pageno][$tabidx] . ': ' . sprintf ('%0.4f', $t2 - $t1) . ' ';
if (!$ok)
continue;
}
$class = ($tabidx == $tabno) ? 'current' : 'std';
$extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
echo "\n";
}
echo " | \n";
}
// This function returns pages, which are direct children of the requested
// page and are accessible by the current user.
function getDirectChildPages ($pageno)
{
global $page, $remote_username;
$children = array();
foreach ($page as $cpageno => $cpage)
if
(
isset ($cpage['parent']) and
$cpage['parent'] == $pageno and
accessibleSubpage ($cpageno) == TRUE
)
$children[$cpageno] = $cpage;
return $children;
}
function getAllChildPages ($parent)
{
global $page;
// Array pointer is global, so if we don't create local copies of
// the global array, we can't advance any more after nested call
// of getAllChildPages returns.
$mypage = $page;
$mykids = array();
foreach ($mypage as $ctitle => $cpage)
if (isset ($cpage['parent']) and $cpage['parent'] == $parent)
$mykids[] = array ('title' => $ctitle, 'kids' => getAllChildPages ($ctitle));
return $mykids;
}
?>