blob: 4530c02b8f3e37a2b573d36521fc5573284e6ab6 [file] [log] [blame]
<?php
/**
* *****************************************************************************
* Copyright (c) 2010, 2016 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* *****************************************************************************
*/
header("Pragma: no-cache");
require_once ($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/common.php");
require_once ($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php");
/*
* Gather up the parameters from the request so that we can
* include them in URLs that we place on the page. I suppose that
* we could use cookies...
* TODO Consider using cookies.
*/
function cleanupKey($key) {
return preg_replace('/[^-a-zA-Z0-9_]/', '', $key);
}
function cleanupValue($value) {
if (isValidProjectId($value))
return $value;
return preg_replace('/[^-a-zA-Z0-9_]/', '', $value);
}
$parameters = '';
$separator = '?';
foreach ($_GET as $key => $value) {
$parameters .= $separator . cleanupKey($key) . '=' . cleanupValue($value);
$separator = '&';
}
$theme = NULL;
$App->Promotion = TRUE;
$Nav->addNavSeparator("Project Tools", "index.php$parameters");
$Nav->addNavSeparator("IP", null);
$Nav->addCustomNav("CQ Overview", "/projects/tools/ip_cq_overview.php$parameters", "_self", 2);
if ($id = @$_GET['id']) {
require_once ($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php");
if ($project = Project::getProject($id)) {
$url = $project->getUrl();
$Nav->addCustomNav("IP Log Generator", "$url/generate-iplog", "_self", 2);
$Nav->addCustomNav("Project PMI Page", $url, "_self", 2);
$Nav->addCustomNav("Next release", "$url/next-release", "_self", 2);
}
}
$Nav->addNavSeparator("Lifecycle", null);
$Nav->addCustomNav("Proposals", "/projects/tools/proposals.php$parameters", "_self", 2);
$Nav->addCustomNav("Reviews", "/projects/tools/reviews.php$parameters", "_self", 2);
$Nav->addCustomNav("Hierarchy", "/projects/tools/hierarchy.php$parameters", "_self", 2);
// Avoid leaving variables with values; avoid confusing
// the script that imports this.
// TODO Encapsulate the variables in a context.
unset($parameters);
unset($separator);
unset($id);
unset($project);
?>