blob: ebf7c0f2b2a4fba1bb7f2ce104e632f60e57fe52 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2016, 2017 Eclipse Foundation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: 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");
$App = new App();
$Nav = new Nav();
$Menu = new Menu();
include($App->getProjectCommon());
require_once dirname(__FILE__) . '/legal.inc';
$pageTitle = "Legal Documentation Generator";
$pageKeywords = "";
$pageAuthor = "Wayne Beaton";
if (!$id = @$_GET['id']) exit();
if (!isValidProjectId($id)) exit();
if (!$project = Project::getProject($id)) exit();
if (!$width = (int)@$_GET['width']) $width = 80;
ob_start();
function renderTemplate($function) {
echo "<pre style=\"background: lightgrey\">";
$function();
echo "</pre>";
}
?>
<div id="maincontent">
<div id="midcolumn">
<h1><?= $pageTitle ?></h1>
<p>
<strong>EXPERIMENTAL!</strong>
</p>
<p>
This page provides automatically generated template content for legal
documentation, including copyright and license headers, copyright
assignments for notices, and more. The information here is generated
from information found in our databases. Some information may be
missing; it is ultimately the project team's responsibility to
provide this information. As we evolve this <em>experimental</em>
implementation, we will identify gaps and improve the quality of the
output.
</p>
<h2><?php echo $project->getFormalName(); ?></h2>
<h3>Copyright and License Header</h3>
<p>
The following copyright and license header should be a reasonable
default for project files based on the information available in the
Eclipse Foundation database.
</p>
<?php
renderTemplate ( function () use (&$project, $width) {
echo getDefaultFileHeader($project->getLicenses(), $width);
} );
?>
<p>Alternatively, the project team may choose to adopt this more
generic copyright header for each file and include the identities of
the copyright holders in the notice file.</p>
<?php
renderTemplate ( function () use (&$project, $width) {
echo getAlternativeFileHeader($project->getLicenses(), $width);
} );
?>
<h3>NOTICE File</h3>
<p>
The file must include basic project metadata, an expression of the
declared project licenses, the copyright holder's, information
regarding the licensing of any third party content, and a statement
regarding the use of cryptography in cases where the content employs
cryptography.
</p>
<?php
renderNoticeFile($id, $width);
?>
</div>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>