Esempio n. 1
0
/**
 * This source code is distributed under the terms as layed out in the
 * GNU General Public License.
 *
 * Purpose: To provide the HTML page header code
 *
 * @author Brian A Cheeseman <*****@*****.**>
 * @version $Id$
 * @copyright 2003-2005 Brian A Cheeseman
 **/
function GetQuickLinkBar($Prefix = "", $LinkLast = false, $LastIsFile = false, $Revision = "")
{
    global $env;
    if (empty($Prefix)) {
        $Prefix = 'Navigate to: ';
    }
    // Add the quick link navigation bar.
    $Dirs = explode("/", $env['mod_path']);
    $QLOut = '<div class="quicknav">' . $Prefix . '<a href="' . $env['script_name'] . '">Root</a>&nbsp;';
    $intCount = 1;
    $OffSet = 2;
    if ($LastIsFile) {
        $OffSet = 1;
    }
    while ($intCount < count($Dirs) - $OffSet) {
        if ($intCount != count($Dirs) - $OffSet) {
            $QLOut .= '/&nbsp;<a href="' . $env['script_name'] . '?mp=' . ImplodeToPath($Dirs, "/", $intCount) . '/">' . $Dirs[$intCount] . '</a>&nbsp;';
        } else {
            $QLOut .= '/&nbsp;' . $Dirs[$intCount] . '&nbsp;';
        }
        $intCount++;
    }
    $QLOut .= '/&nbsp;';
    if ($LinkLast) {
        $QLOut .= '<a href="' . $env['script_name'] . '?mp=' . ImplodeToPath($Dirs, "/", $intCount);
        if ($LastIsFile) {
            $QLOut .= '&amp;fh#rd' . $Revision . '">';
        } else {
            $QLOut .= '/';
        }
    }
    $QLOut .= $Dirs[$intCount];
    if ($LinkLast) {
        $QLOut .= '</a>';
    }
    $QLOut .= '</div>' . "\n";
    return $QLOut;
}
Esempio n. 2
0
$env['script_path'] = substr($env['script_name'], 0, strrpos($env['script_name'], "/"));
$env['script_path'] = empty($env['script_path']) ? '/' : $env['script_path'];
$env['mod_path'] = isset($_GET["mp"]) ? $_GET["mp"] : "/";
$env['mod_path'] = str_replace("//", "/", $env['mod_path']);
$gBitSmarty->assign('root', $env['script_name']);
$Dirs = explode("/", $env['mod_path']);
$intCount = 1;
$OffSet = 1;
// Need to tweek for file or folder as last element
//if ($LastIsFile) {
//	$OffSet = 1;
//}
$links = array();
while ($intCount < count($Dirs) - $OffSet) {
    if ($intCount != count($Dirs) - $OffSet) {
        $links[$intCount - 1]['link'] = ImplodeToPath($Dirs, "/", $intCount);
        $links[$intCount - 1]['name'] = $Dirs[$intCount];
    }
    $intCount++;
}
$gBitSmarty->assign('last', $Dirs[$intCount]);
$gBitSmarty->assign_by_ref('links', $links);
// Determine the CVSROOT settings required for this instance.
$env['CVSROOT'] = empty($_COOKIE['config']['CVSROOT']) ? $config['default_cvs'] : $_COOKIE['config']['CVSROOT'];
if (isset($_GET["cr"])) {
    $env['mod_path'] = "/";
    unset($_GET["fh"]);
    unset($_GET["fa"]);
    unset($_GET["fv"]);
    unset($_GET["fd"]);
    unset($_GET["df"]);