| <?php |
| /******************************************************************************* |
| * Copyright (c) 2009, 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 |
| *******************************************************************************/ |
| |
| /* |
| * This file generates XML content describing the hierarchy of projects. |
| * All projects are reported regardless of their state (i.e. archived projects |
| * are included). |
| */ |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); |
| $App = new App(); |
| $Nav = new Nav(); |
| $Menu = new Menu(); |
| include($App->getProjectCommon()); |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php"); |
| //error_reporting(E_NONE); |
| |
| header("Content-type: text/xml"); |
| |
| echo "<projects>"; |
| |
| function list_projects(&$list) { |
| foreach($list as $project) { |
| $id = $project->getId(); |
| $name = htmlspecialchars($project->getName()); |
| echo "<project name=\"$name\" id=\"$id\">"; |
| list_projects($project->getChildren()); |
| echo "</project>"; |
| } |
| } |
| |
| list_projects(Project::getTopLevelProjects()); |
| |
| echo "</projects>"; |
| |
| ?> |