<?php
/**
 * Copyright (c) 2018 Eclipse Foundation and others.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * Contributors:
 * Eric Poirier (Eclipse Foundation) - Initial implementation
 *
 * SPDX-License-Identifier: EPL-2.0
 */
require_once (realpath(dirname(__FILE__) . "/../eclipse.org-common/system/app.class.php"));
require_once (realpath(dirname(__FILE__) . "/../eclipse.org-common/system/eclipseenv.class.php"));
require_once (realpath(dirname(__FILE__) . "/../eclipse.org-common/classes/downloads/eclipseInstaller.php"));

$App = new App();
$EclipseEnv = new EclipseEnv();
$eclipse_env = $EclipseEnv->getEclipseEnv();

$EclipseInstaller = new EclipseInstaller('photon/R');
$EclipseInstaller->setInstallerLayout('layout_a');

$links = $EclipseInstaller->getInstallerLinks('64bit');
if (empty($links['links'])) {
  $links = array("links" => array("/downloads/index-developer.php?release=photon"));
}

$oxygen_content_json = dirname(__FILE__) . "/oxygen-content.json";

$Theme = $App->getThemeClass('eclipse_ide');

// Custom theme variables
$variables = array();
//$variables['hide_breadcrumbs'] = TRUE;
$variables['main_container_classes'] = 'container-full container-photon';
$variables['btn_cfa']['text'] = '<i class="fa fa-star"></i> Donate';
$variables['btn_cfa']['href'] = 'https://www.eclipse.org/donate/';
$variables['btn_cfa']['class'] = 'btn btn-huge btn-secondary';
$App->setThemeVariables($variables);

$pageTitle = 'Eclipse Photon';
$Theme->setPageAuthor('Eclipse Foundation');
$Theme->setPageKeywords("eclipse photon, release, simultaneous, release train, photon");
$Theme->setPageTitle($pageTitle);

ob_start();
?>
<div class="jumbotron featured-jumbotron margin-bottom-0">
  <div class="container">
    <div class="row">
      <div class="col-md-20 col-md-offset-2 col-sm-18 col-sm-offset-3">
        <h1 class="jumbotron-title"><span class="small-title">Eclipse</span><br> <span class="big-title">Photon</span></h1>
        <h2 class="h3 margin-bottom-30">A quantum leap for coding</h2>

        <?php foreach ($links['links'] as $link): ?>
          <a class="btn btn-photon-primary btn-lg" href="<?php print $link; ?>"><i class="fa fa-download"></i> Download</a>
        <?php endforeach;?>
        <p style="font-size:16px; color:#ccc;" class="margin-top-20">June 27, 2018</p>
      </div>
    </div>
  </div>
</div>
<?php
$extra_header_html = ob_get_clean();
$Theme->setExtraHeaderHtml($extra_header_html);

// Place your html content in a file called content/en_pagename.php
ob_start();
include ("content/en_" . $App->getScriptName());
$html = ob_get_clean();

$Theme->setHtml($html);
$App->AddExtraJSFooter('<script type="text/javascript" src="/photon/public/js/photon.js"></script>');
$Theme->setExtraHeaders('<link href="/photon/public/css/photon.css" media="screen" rel="stylesheet" type="text/css"/>');
$Theme->setAttributes('header-wrapper', 'header-photon');
$Theme->generatePage();
