public sites page sortable/searcheable -- has a link to the KML/googlemaps stuff
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 1 Oct 2009 14:12:12 +0000 (14:12 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 1 Oct 2009 14:12:12 +0000 (14:12 +0000)
planetlab/pub/sites.php
planetlab/sites/sites.php
planetlab/slices/slice.php
plekit/php/table.php

index 87f4d40..caef04b 100644 (file)
@@ -19,32 +19,49 @@ include 'plc_header.php';
 
 ?>
 
-<p>The following sites currently host or plan to host <?php echo PLC_NAME; ?> nodes:</p>
 
-<ul>
+<div id='public_sites'>
+<p>The following sites currently host or plan to host <?php echo PLC_NAME; ?> nodes.</p>
+
+<p> Also available for download in <a href="/sites/sites.kml">KML format for Google Earth.</a> </p> 
+</div>
 
 <?php
+require_once 'plc_functions.php';
+require_once 'plc_peers.php';
+require_once 'table.php';
+
+$headers = array();
+$headers['Peer']='string';
+$headers['Name']='string';
+$headers['Lon']='float';
+$headers['Lat']='float';
+
+$table=new PlekitTable ("sites",$headers,1,array('pagesize'=>10000,'pagesize_area'=>false));
+$table->start();
+
+$peers=new Peers($adm);
 
 // All defined sites
-$sites = $adm->GetSites(array('is_public' => TRUE, 'peer_id' => NULL), array('name', 'url'));
+$sites = $adm->GetSites(array('is_public' => TRUE), 
+                       array('peer_id','name', 'url','latitude','longitude'));
+
 
 foreach ($sites as $site) {
   $name = htmlspecialchars($site['name']);
   $url = $site['url'];
-  print "<li>";
-  if ($url) {
-    print "<a href=\"$url\">$name</a>";
-  } else {
-    print "$name";
-  }
-  print "</li>";
-}
 
-?>
-
-</ul>
-
-<?php
+  $table->row_start();
+  $peers->cell($table,$site['peer_id']);
+  if ($url) 
+    $table->cell(href($url,$name));
+  else
+    $table->cell($name);
+  $table->cell($site['longitude']);
+  $table->cell($site['latitude']);
+  $table->row_end();
+}
+$table->end();
 
 include 'plc_footer.php';
 
index 9d12aeb..6b1c32d 100644 (file)
@@ -113,6 +113,8 @@ $peers=new Peers($api);
 
 $nifty=new PlekitNifty ('','objects-list','big');
 $nifty->start();
+
+$headers=array();
 if (plc_is_admin()) {
   $headers['I']='int';
 }
index eb826ee..45afc94 100644 (file)
@@ -81,7 +81,7 @@ global $MAX_WEEKS;    $MAX_WEEKS= 8;          // weeks from today
 global $GRACE_DAYS;    $GRACE_DAYS=10;         // days for renewal promoted on top
 global $NOW;           $NOW=mktime();
 
-
+////////////////////////////////////////////////////////////
 // make the renew area on top and open if the expiration time is less than 10 days from now
 function renew_needed ($slice) {
   global $DAY, $NOW, $GRACE_DAYS;
@@ -173,7 +173,7 @@ EOF;
   $toggle->end();
 }
 
-////////// 
+////////////////////////////////////////////////////////////
 
 $am_in_slice = in_array(plc_my_person_id(),$person_ids);
 
index 63a9506..abe3073 100644 (file)
@@ -65,7 +65,7 @@ class PlekitTable {
     $this->notes_area = true;
     $this->search_width = 40;
     $this->pagesize = 25;
-    $this->pagesize_def = 999;
+    $this->pagesize_def = 9999;
     $this->max_pages = 10;
     $this->notes = array();
     $this->debug = false;