blob: fa4f556b93016d15e48b19531c9e0cc714e15b66 [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
*******************************************************************************/
/*
* This script assumes that it is being included by another script. We
* assume that the $App variable has already been defined.
*/
require_once ($_SERVER ['DOCUMENT_ROOT'] . "/projects/classes/Review.class.php");
$reviews = getReviews ('complete', strtotime('-1 month'));
usort($reviews, 'sortReviewsByDate');
print '<div class="block-box"><h3>Recent Activity</a></h3><div class="content">';
$lastDate = null;
/** @var \Review $review */
foreach ( $reviews as $review ) {
$date = $App->getFormattedDate ( $review->getDate(), 'long' );
$date = str_replace ( ' ', '&nbsp;', $date );
if ($date != $lastDate) {
if ($lastDate) print '</ul><hr class="reset"/>';
print "<span class=\"orange date\">$date</span>";
print '<ul class="list-unstyled reset">';
}
$lastDate = $date;
print '<li>' . $review->asHtml() . '</li>';
}
if ($lastDate) print '</ul>';
print '<p align="right"><a href="/projects/tools/reviews.php">Show all reviews...</a></p>';
print '</div></div>';