split in two
[plewww.git] / planetlab / sites / sites.php
index c705c57..d37a348 100644 (file)
@@ -16,8 +16,8 @@ include 'plc_header.php';
 // Common functions
 require_once 'plc_functions.php';
 require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
+require_once 'linetabs.php';
+require_once 'table.php';
 
 // -------------------- 
 // recognized URL arguments
@@ -27,6 +27,8 @@ $pattern=$_GET['pattern'];
 // --- decoration
 $title="Sites";
 $tabs=array();
+$tabs []= tab_mysite();
+$tabs []= tab_sites_local();
 
 // -------------------- 
 $site_filter=array();
@@ -59,6 +61,8 @@ function site_status ($site) {
     if ($nb_pis == 0) $messages [] = "No PI";
     if ($nb_techs == 0) $messages [] = "No Tech";
     
+    if (! $site['is_public']) $messages []= "Not public";
+
     // check number of slices
     if ( $site['max_slices'] == 0) {
       $messages [] = "No slice allowed";
@@ -93,8 +97,6 @@ if (! plc_is_admin()) {
                        "enabled", "person_ids", "max_slices", "slice_ids", "node_ids");
  }
 
-$tabs['My site'] = array('url'=>l_site(plc_my_site_id()));
-$tabs['Local sites'] = array('url'=>l_sites_peer('local'));
 if (plc_is_admin()) 
   $tabs['Pending'] = array ('url'=>l_sites_pending(),
                            'bubble'=>'Review pending join requests');
@@ -118,26 +120,29 @@ if (plc_is_admin()) {
   $headers['?']="string";
  }
 
-plc_table_start("sites",$headers,2);
+$table=new PlcTable("sites",$headers,2);
+$table->start();
 
 if ($sites) foreach ($sites as $site) {
   $shortname = $peers->shortname($site['peer_id']);
-  plc_table_row_start();
-  plc_table_cell($shortname);
-  plc_table_cell (l_site_t($site['site_id'],htmlentities($site['name'])));
-  plc_table_cell ($site['login_base']);
-  plc_table_cell (htmlentities($site['abbreviated_name']));
+  $table->row_start();
+  $table->cell($shortname);
+  $table->cell (l_site_t($site['site_id'],htmlentities($site['name'])));
+  $table->cell ($site['login_base']);
+  $table->cell (htmlentities($site['abbreviated_name']));
   if (plc_is_admin()) {
-    plc_table_cell(count($site['node_ids']));
-    plc_table_cell(count($site['person_ids']));
-    plc_table_cell(count($site['slice_ids']));
-    plc_table_cell(site_status($site));
+    $table->cell(count($site['node_ids']));
+    $table->cell(count($site['person_ids']));
+    $table->cell(count($site['slice_ids']));
+    $table->cell(site_status($site));
   }
-  plc_table_row_end();
+  $table->row_end();
 }
 $notes=array("N = number of sites / U = number of users / S = number of slices");
 
-plc_table_end("sites",array('notes'=>$notes));
+$table->end(array('notes'=>$notes));
+
+//plc_tabs ($tabs,"bottom");
 
 // Print footer
 include 'plc_footer.php';