initial import from onelab svn codebase
[plewww.git] / planetlab / pub / sites.php
1 <?php
2 //
3 // Site list
4 //
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2006 The Trustees of Princeton University
7 //
8 // $Id: sites.php 144 2007-03-28 07:52:20Z thierry $ $
9 //
10
11 // Get API handle
12 require_once 'plc_session.php';
13 global $adm;
14
15 // Get sorting functions
16 require_once 'plc_sorts.php';
17
18 // Print header
19 require_once 'plc_drupal.php';
20 drupal_set_title('Sites');
21 include 'plc_header.php';
22
23 ?>
24
25 <p>The following sites currently host or plan to host <?php echo PLC_NAME; ?> nodes:</p>
26
27 <ul>
28
29 <?php
30
31 // All defined sites
32 $sites = $adm->GetSites(array('is_public' => TRUE), array('name', 'url'));
33 sort_sites($sites);
34
35 foreach ($sites as $site) {
36   $name = htmlspecialchars($site['name']);
37   $url = $site['url'];
38   print "<li>";
39   if ($url) {
40     print "<a href=\"$url\">$name</a>";
41   } else {
42     print "$name";
43   }
44   print "</li>";
45 }
46
47 ?>
48
49 </ul>
50
51 <?php
52
53 include 'plc_footer.php';
54
55 ?>