| <?php | |
| /******************************************************************************* | |
| * Copyright (c) 2010, 2017 Eclipse Foundation and others. | |
| * All rights reserved. This program and the accompanying materials | |
| * are made available under the terms of the Eclipse Public License v2.0 | |
| * which available at http://www.eclipse.org/legal/epl-2.0 | |
| *******************************************************************************/ | |
| require_once(dirname(__FILE__) . "/../../eclipse.org-common/system/app.class.php"); | |
| require_once(dirname(__FILE__) . "/../../eclipse.org-common/system/nav.class.php"); | |
| require_once(dirname(__FILE__) . "/../../eclipse.org-common/system/menu.class.php"); | |
| require_once(dirname(__FILE__) . "/../classes/IPZilla.class.inc"); | |
| require_once(dirname(__FILE__) . "/../classes/common.php"); | |
| require_once(dirname(__FILE__) . "/../classes/debug.php"); | |
| $App = new App(); | |
| $Nav = new Nav(); | |
| $Menu = new Menu(); | |
| mustBeCommitter(); | |
| include($App->getProjectCommon()); | |
| // Preload all of the active projects to speed things up a bit. | |
| $projects = Project::getActiveProjects(); | |
| function getProjectLink($id) { | |
| global $projects; | |
| if (isset($projects[$id])) { | |
| $project = $projects[$id]; | |
| $url = $project->getUrl(); | |
| $name = $project->getFormalName(); | |
| } else { | |
| $url = "https://projects.eclipse.org/projects/{$id}"; | |
| $name = $id; | |
| } | |
| return "<a href=\"{$url}\">{$name}</a>"; | |
| } | |
| $ipzilla = IPZilla::getInstance(); | |
| function display_cq($cq) { | |
| if (!$cq->isApproved()) return; | |
| echo "<div class=\"cq\">"; | |
| if ($cq->isProjectCode()) { | |
| $icon = 'eclipse.gif'; | |
| $title = 'An EPL-licensed contribution to an Eclipse project'; | |
| } elseif ($cq->isThirdParty()) { | |
| $icon = 'library.png'; | |
| $title = 'A third-party library'; | |
| } else { | |
| return; | |
| } | |
| $description = htmlentities($cq->getDescription()); | |
| $name = htmlentities($cq->getName()); | |
| $version = htmlentities($cq->getVersion()); | |
| $header = $name; | |
| if ($version) $header = "$header $version"; | |
| echo "<h4 id=\"{$cq->getId()}\"><img src=\"/projects/images/$icon\" title=\"$title\"></img> | |
| <a href=\"https://dev.eclipse.org/ipzilla/show_bug.cgi?id={$cq->getId()}\">CQ {$cq->getId()}</a> | |
| $header</h4><p>$description<p>"; | |
| echo "<div class=\"cq-info\">"; | |
| echo "<p>Name: {$cq->getName()}</p>"; | |
| echo "<p>Version: {$cq->getVersion()}</p>"; | |
| echo "<p>Due Diligence Type: {$cq->getDueDiligenceType()}</p>"; | |
| echo "<p>Keywords: {$cq->getKeywords()}</p>"; | |
| echo "<p>License(s): {$cq->getLicenses()}</p>"; | |
| echo "<p>SPDX: {$cq->getSPDX()}</p>"; | |
| $link = getProjectLink($cq->getProjectId()); | |
| echo "<p>Created by: {$link}</p>"; | |
| displayPiggybacks($cq); | |
| displayFilePatterns($cq); | |
| displayMavenPatterns($cq); | |
| displayRelated($cq); | |
| echo "</div>"; | |
| echo "</div>"; | |
| } | |
| function displayFilePatterns($cq) { | |
| if ($cq->getFilePatterns()) { | |
| echo "<p>File patterns:</p>"; | |
| echo "<ul>"; | |
| foreach($cq->getFilePatterns() as $pattern => $regex) { | |
| echo "<li>$pattern</li>"; | |
| } | |
| echo "</ul>"; | |
| } | |
| } | |
| function displayMavenPatterns($cq) { | |
| if ($patterns = $cq->getMvnPatterns()) { | |
| echo "<p>Maven patterns:</p>"; | |
| echo "<ul>"; | |
| foreach($patterns as $pattern) { | |
| echo "<li>$pattern</li>"; | |
| } | |
| echo "</ul>"; | |
| } | |
| } | |
| function displayPiggybacks($cq) { | |
| if ($piggybacks = $cq->getPiggybacks()) { | |
| echo "<p>Also used by:</p>"; | |
| echo "<ul>"; | |
| foreach($piggybacks as $piggyback) { | |
| $link = getProjectLink($piggyback->getProjectId()); | |
| echo "<li>{$link} (<a href=\"https://dev.eclipse.org/ipzilla/show_bug.cgi?id={$piggyback->getId()}\">{$piggyback->getId()}</a>)</li>"; | |
| } | |
| echo "</ul>"; | |
| } | |
| } | |
| function displayRelated($cq) { | |
| if ($related = $cq->getRelatedCqs()) { | |
| usort($related, 'compareCqsBySemanticVersion'); | |
| echo "<p>See also:</p>"; | |
| echo "<ul>"; | |
| foreach($related as $each){ | |
| echo "<li><a href=\"#{$each->getId()}\">{$each->getId()}</a> {$each->getName()} {$each->getVersion()}</li>"; | |
| } | |
| echo "</ul>"; | |
| } | |
| } | |
| function compareCqsBySemanticVersion($a, $b) { | |
| return compareSemanticVersion($a->getVersion(), $b->getVersion()); | |
| } | |
| ob_start(); | |
| $pageKeywords = ""; | |
| $pageTitle = "An Overview of Contribution Questionnaires"; | |
| $pageAuthor = "Wayne Beaton"; | |
| ?> | |
| <div id="midcolumn"> | |
| <div class="homeitem"> | |
| <h1><?= $pageTitle ?></h1> | |
| <p>This page display information about contribution questionnaires (CQs), | |
| including the hierarchical relationship of the various "piggy-back". | |
| Where known, the file patterns for any JAR'd bundles associated with | |
| the CQs are indicated.</p> | |
| <style> | |
| .cq table {border-width:0;margin-top:1em;margin-bottom:5px} | |
| .cq tr {vertical-align:top} | |
| .cq p {margin:0} | |
| .cq-info {margin-left:2em} | |
| .cq-info p ul {margin-top:0px;margin-bottom:} | |
| .cq-info li {margin:0} | |
| </style> | |
| <?php | |
| $ipzilla->rootCqsDo(function($cq) { | |
| display_cq($cq); | |
| }); | |
| ?> | |
| </div> | |
| </div> | |
| <?php | |
| $html = ob_get_contents(); | |
| ob_end_clean(); | |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); | |
| ?> |