From 50a89b5df55c941c374d093d0ad590a5289e341c Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Tue, 2 Jun 2009 17:10:41 +0000 Subject: [PATCH] fix pub/slices.php --- PLEWWW dropped support sort_slices() --- planetlab/pub/slices.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/planetlab/pub/slices.php b/planetlab/pub/slices.php index 2d709df..60628de 100644 --- a/planetlab/pub/slices.php +++ b/planetlab/pub/slices.php @@ -58,9 +58,8 @@ comment on, then click Provide Feedback.

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; } @@ -91,8 +90,12 @@ if (isset($_REQUEST['active'])) { } 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 = ""; -- 2.43.0