// Mark Huang <mlhuang@cs.princeton.edu>
// Copyright (C) 2006 The Trustees of Princeton University
//
-// $Id: slices.php 144 2007-03-28 07:52:20Z thierry $ $
+// $Id$ $
//
// Get API handle
require_once 'plc_session.php';
global $adm;
-// Get sorting functions
-require_once 'plc_sorts.php';
-
// Get PlanetFlow stats
global $planetflow, $active_bytes;
-include_once '_gen_planetflow.php';
+// Thierry : this is not found at PlanetLab Europe
+//include_once '_gen_planetflow.php';
// Print header
require_once 'plc_drupal.php';
<?php
// Get all sites
-$sites = array();
-foreach ($adm->GetSites(NULL, array('abbreviated_name', 'site_id'))
- as $site) {
+$sites = $adm->GetSites(NULL, array('abbreviated_name', 'site_id'));
+if (!empty($sites)) foreach ($sites as $site) {
$sites[$site['site_id']] = $site;
}
}
usort($slices, '__cmp_slices_by_bytes');
} else {
+ // slice sort on name
+ function __cmp_slices($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+ }
// Alphabetically sort slices
- sort_slices($slices);
+ usort($slices, '__cmp_slices');
}
$class = "";