| <?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"); | |
| if ($id = @$_GET['id']) { | |
| $Nav->addNavSeparator("IP", null); | |
| 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); | |
| ?> |