| <?php | |
| /******************************************************************************* | |
| * Copyright (c) 2005, 2013 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 | |
| * | |
| * Contributors: | |
| * Bjorn Freeman Benson (Eclipse Foundation) - initial API and implementation | |
| * Wayne Beaton (Eclipse Foundation) - Update to use new APIs | |
| *******************************************************************************/ | |
| require_once(dirname(__FILE__) ."/../classes/Project.class.php"); | |
| class ProjectInfo { | |
| private $project; | |
| function ProjectInfo($id) { | |
| $this->project = getProject($id); | |
| } | |
| /** | |
| * Generate the common left menu navigation menu | |
| */ | |
| function generate_common_nav( $thenav, $users = NULL, $integrators = NULL, $contributors = NULL ) { | |
| global $Nav; | |
| $Nav->setLinkList( array() ); | |
| $Nav->addNavSeparator( $this->project->getName(), $this->project->getUrl()); | |
| if ($website = $this->project->getWebRoot()) | |
| $Nav->addCustomNav("Website", $website, "", 1 ); | |
| if ($gettingStarted = $this->project->getGettingStartedUrl()) | |
| $Nav->addCustomNav("Getting Started", $gettingStarted, "", 1); | |
| if ($downloads = $this->project->getDownloadsUrl()) | |
| $Nav->addCustomNav("Downloads", $downloads, "", 2); | |
| if ($bugs = $this->project->getBugzillaUrl()) | |
| $Nav->addCustomNav("Bugs", $bugs, "", 2); | |
| if(!empty($users)) $users($Nav); | |
| if ($plan = $this->project->getPlanUrl()) | |
| $Nav->addCustomNav("API Plan", $plan, "", 2); | |
| if ($lists = $this->project->getMailingLists()) { | |
| foreach($lists as $list) { | |
| $name = $list->getName(); | |
| $url = "http://dev.eclipse.org/mailman/listinfo/$name"; | |
| if (preg_match('/\-([^\-]+)$/', $name, $matches)) { | |
| $name = $matches[1]; | |
| if ($name == 'pmc') $name = 'PMC'; | |
| else $name = ucfirst($name); | |
| $name .= ' mailing list'; | |
| } | |
| $Nav->addCustomNav($name, $url, "", 2); | |
| } | |
| } | |
| } | |
| } | |
| ?> |