2003-12-12 22:17:19 +00:00
< ? php
2008-08-05 22:43:14 +00:00
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
2003-12-12 22:17:19 +00:00
2007-11-12 22:28:17 +00:00
require_once ( " ../inc/boinc_db.inc " );
2004-02-02 23:34:39 +00:00
require_once ( " ../inc/util.inc " );
2003-12-12 22:17:19 +00:00
2011-02-09 22:11:34 +00:00
check_get_args ( array ( " xml " ));
2007-11-12 22:28:17 +00:00
$platforms = BoincPlatform :: enum ( " deprecated=0 " );
2003-12-12 22:17:19 +00:00
2009-04-17 02:08:05 +00:00
$xml = get_str ( 'xml' , true );
2007-03-19 00:10:36 +00:00
if ( $xml ) {
require_once ( '../inc/xml.inc' );
xml_header ();
echo " <app_versions> \n " ;
} else {
2007-11-02 14:43:02 +00:00
page_head ( tra ( " Applications " ));
echo tra ( " %1 currently has the following applications. When you participate in %1, work for one or more of these applications will be assigned to your computer. The current version of the application will be downloaded to your computer. This happens automatically; you don't have to do anything. " , PROJECT ) . " <br><br>
2007-03-19 00:10:36 +00:00
" ;
start_table ();
}
2003-12-12 22:17:19 +00:00
2007-11-12 22:28:17 +00:00
$apps = BoincApp :: enum ( " deprecated=0 " );
2003-12-12 22:17:19 +00:00
2007-11-12 22:28:17 +00:00
foreach ( $apps as $app ) {
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " <application> \n " ;
echo " <name> $app->user_friendly_name </name> \n " ;
2009-07-31 21:27:03 +00:00
echo " <id> $app->id </id> \n " ;
2007-03-19 00:10:36 +00:00
} else {
echo "
2009-01-23 20:03:33 +00:00
< tr >< th colspan = 4 > $app -> user_friendly_name </ th ></ tr >
< tr >
< th > " .tra( " Platform " ). " </ th >
< th > " .tra( " Version " ). " </ th >
< th > " .tra( " Installation time " ). " </ th >
</ tr >
2007-03-19 00:10:36 +00:00
" ;
}
2009-01-23 20:03:33 +00:00
foreach ( $platforms as $platform ) {
2012-01-31 07:21:42 +00:00
$avs = latest_avs_app_platform ( $app -> id , $platform -> id );
2007-11-12 22:28:17 +00:00
foreach ( $avs as $av ) {
2009-04-17 01:22:38 +00:00
$create_time_f = pretty_time_str ( $av -> create_time );
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " <version> \n " ;
2007-03-19 20:03:06 +00:00
echo " <platform_short> $platform->name </platform_short> \n " ;
echo " <platform_long> $platform->user_friendly_name </platform_long> \n " ;
2009-01-23 20:03:33 +00:00
echo " <version_num> $av->version_num </version_num> \n " ;
echo " <plan_class> $av->plan_class </plan_class> \n " ;
2009-04-17 01:22:38 +00:00
echo " <date> $create_time_f </date> \n " ;
2009-01-23 20:03:33 +00:00
echo " <date_unix> $av->create_time </date_unix> \n " ;
2007-03-19 00:10:36 +00:00
echo " </version> \n " ;
} else {
2009-04-17 01:22:38 +00:00
$version_num_f = sprintf ( " %0.2f " , $av -> version_num / 100 );
if ( $av -> plan_class ) {
$version_num_f .= " ( $av->plan_class ) " ;
}
2007-03-19 00:10:36 +00:00
echo " <tr>
< td > $platform -> user_friendly_name </ td >
2009-04-17 01:22:38 +00:00
< td > $version_num_f </ td >
< td > $create_time_f </ td >
2007-03-19 00:10:36 +00:00
</ tr >
" ;
}
2003-12-12 22:17:19 +00:00
}
}
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " </application> \n " ;
}
2003-12-12 22:17:19 +00:00
}
2007-11-12 22:28:17 +00:00
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " </app_versions> \n " ;
} else {
end_table ();
page_tail ();
}
2003-12-12 22:17:19 +00:00
?>