blob: 9ec3138fbc592240b2631a96076ae87097fc0ff9 [file] [log] [blame]
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop'
/*******************************************************************************
* Copyright (c) 2009-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: Christopher Guindon (Eclipse Foundation)
* Nathan Gervais (Eclipse Foundation)
*
*******************************************************************************/
#
# Begin: page-specific settings. Change these.
$pageTitle = "Eclipse.org - Kelper Simultaneous Release : Projects";
$pageKeywords = "eclipse kepler, release, simultaneous, release train, kepler";
$pageAuthor = "Christopher Guindon";
function hack_array_sort($a, $subkey) {
foreach($a as $k=>$v) {
$b[$k] = strtolower($v[$subkey]);
}
asort($b);
foreach($b as $key=>$val) {
$c[] = $a[$key];
}
return $c;
}
$url = "http://projects.eclipse.org/json/release/kepler";
$json = file_get_contents($url);
$data = json_decode($json);
$projects = array();
foreach($data->kepler->projects as $project){
$version = array();
if(!empty($project->releases)){
foreach($project->releases as $r){
$version[] = $r->name;
}
}
$version_link = "";
if(!empty($version)){
$version_link = '<a href="' . $project->download . '">' . implode(', ', $version) . '</a>';
}
$img = "";
$new = ($project->new == 1) ? '<img src="images/legend_new.png" />' : '';
$info = ($project->id) ? '<a href="http://projects.eclipse.org/projects/' . $project->id . '"><img src="images/legend_info.png" /></a>' : '';
$projects[] = array(
'name' => $project->name,
'output' => '<dl><dt><a href="' . $project->website . '">' . $project->name . '</a> ' . $new . $info . '</dt><dd>' . $version_link . '</dd></dl>'
);
}
$project_count = count($projects);
if(!empty($projects)){
$projects = hack_array_sort($projects, 'name');
}
# Paste your HTML content between the EOHTML markers!
ob_start();
?>
<div id="fullcolumn" class="kepler subpage projects">
<div id="page-left">
<div class="page-container">
<h2 id="h2_projects">Projects</h2>
<ul id="ul_legend" class="no_bullets">
<li class="new">new</li>
<li class="info">info</li>
</ul>
<?php
for ($i = 0; $i <= min(35, $project_count-1); $i++) {
print $projects[$i]['output'];
}
?>
</div>
</div>
<div id="page-right">
<div class="page-container">
<?php
for ($i = 36; $i <= min(100, $project_count-1); $i++) {
print $projects[$i]['output'];
}
?>
</div>
</div>
<ul id="page-nav" class="no_bullets page-nav-no-icons">
<li class="page-nav-1" id="page-nav-highlights"><a href="/kepler/" ><sup>&laquo;</sup>Back</a></li>
</ul>
</div>
<?
$html = ob_get_clean();
# Generate the web page
$App->Promotion = TRUE;
$App->AddExtraHtmlHeader('<link href="http://fonts.googleapis.com/css?family=EB+Garamond" rel="stylesheet" type="text/css">');
$App->AddExtraHtmlHeader('<link type="text/css" href="/kepler/css/styles.css" rel="stylesheet"/>');
$App->AddExtraHtmlHeader('<!--[if IE 7]><link rel="stylesheet" type="text/css" href="/home/content/ie7_nova.css" media="screen"/><![endif]-->');
$App->generatePage('Nova', $Menu, NULL , $pageAuthor, $pageKeywords, $pageTitle, $html);
?>