blob: 74de85d9f5f6608801924e103e77cf08cf54fb34 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2010 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:
* Wayne Beaton (Eclipse Foundation)- initial API and implementation
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
$App = new App();
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php");
trace_file_info(__FILE__);
$smallIconDir = "http://dev.eclipse.org/small_icons";
$incubationInfoUrl = "http://wiki.eclipse.org/Development_Resources/HOWTO/Incubation_Phase";
$id = $_GET['id'];
if (is_valid_project_name($id)) {
$project = get_project($id);
} else {
trace("The provided project id is invalid.");
}
if (!$project) {
echo "
<p>A Project is the main operational unit at Eclipse.
Specifically, all open source software development at
Eclipse occurs within the context of a Project. Projects
have leaders, developers, code, builds, downloads, websites,
and more. Projects are more than just the sum of their
many parts, they are the means by which open source work
is organized when presented to the communities of developers,
adopters, and users. Projects provide structure that helps
developers expose their hard work to a broad audience of
consumers.</p>
<p>Select a project on the left to learn more.</p>";
echo get_trace_html();
exit;
}
echo "<div id=\"project-summary-box\">";
renderBasic($project);
renderInformation($project);
renderNewsgroups($project);
echo get_trace_html();
echo "</div>";
function renderBasic(&$project) {
$name = $project->getName();
$description = $project->getShortDescription();
if ($project->isInIncubationPhase())
echo "<img src=\"/projects/images/egg.gif\" title=\"This project in the Incubation Phase\" align=\"right\"/>";
echo "<h4>$name</h4>";
if ($project->isInIncubationPhase())
echo "<em>This project is in the <a href=\"$incubationInfoUrl\">Incubation Phase</a></em>.";
if ($description)
echo "<p>$description</p>";
}
function renderInformation(&$project) {
global $smallIconDir;
$projectSummaryImage = "$smallIconDir/apps/help-browser.png";
$wikiImage = "/home/categories/images/wiki.gif";
$documentationImage = "$smallIconDir/apps/system-installer.png";
$downloadsImage = "$smallIconDir/status/software-update-available.png";
echo "<h5>Information</h5>";
echo "<ul>";
$id = $project->getId();
$projectSummaryUrl = "/projects/project.php?id=$id";
echo "<li style=\"list-style-image: url('$projectSummaryImage')\"><a href=\"$projectSummaryUrl\">Project Summary</a></li>";
$wikiUrl = $project->getWikiUrl();
if ($wikiUrl)
echo "<li style=\"list-style-image: url('$wikiImage')\"><a href=\"$wikiUrl\">Wiki Page</a></li>";
$documentationUrl = $project->getDocumentationUrl();
if ($documentationUrl)
echo "<li style=\"list-style-image: url('$documentationImage')\"><a href=\"$documentationUrl\">Documentation</a></li>";
$downloadsUrl = $project->getDownloadsUrl();
if ($downloadsUrl)
echo "<li style=\"list-style-image: url('$downloadsImage')\"><a href=\"$downloadsUrl\">Downloads</a></li>";
echo "</ul>";
}
function renderNewsgroups(&$project) {
global $smallIconDir;
$icon = "$smallIconDir/apps/internet-news-reader.png";
$newsgroups = $project->getNewsgroups();
if ($newsgroups) {
echo "<h5>Forums</h5>";
echo "<p>Communicate with the project committers via project <a href=\"/forums\">forums</a>.";
echo "<ul>";
foreach($newsgroups as $newsgroup) {
$type = $newsgroup->getType();
$name = $newsgroup->getName();
if (!$name) continue;
$description = $newsgroup->getDescription();
$forumUrl = "http://www.eclipse.org/forums/$name";
$info = "<a href=\"$forumUrl\">$name</a>";
if ($description)
$info .= "<blockquote>$description</blockquote>";
echo "<li>$info</li>";
}
echo "</ul>";
}
}
?>