sort sites on name
[plewww.git] / planetlab / persons / persons.php
index 575da0e..7308baa 100644 (file)
@@ -18,9 +18,10 @@ require_once 'plc_functions.php';
 require_once 'plc_peers.php';
 require_once 'linetabs.php';
 require_once 'table.php';
+require_once 'nifty.php';
 
 //fix the memory limit for this page
-ini_set("memory_limit","48M");
+ini_set("memory_limit","64M");
 
 // -------------------- 
 // recognized URL arguments
@@ -127,54 +128,60 @@ foreach ($sites as $site) {
 // --------------------
 drupal_set_title($title);
 
-//plekit_linetabs($tabs);
+plekit_linetabs($tabs);
 
 if ( ! $persons ) {
   drupal_set_message ('No account found');
   return;
  }
   
+$nifty=new PlekitNifty ('','objects-list','big');
+$nifty->start();
 $headers = array ("Peer"=>"string",
                  "First"=>"string",
                  "Last"=>"string",
                  "Email"=>"string",
                  "Site" => "string",
-                 "Roles"=>"string",
+                 "R"=>"string",
                  "S" => "int",
                  "Status"=>"string",
                  );
 
 // initial sort on email
-$table=new PlekitTable("persons",$headers,4);
+$table=new PlekitTable("persons",$headers,3);
 $table->start();
 
 $peers=new Peers ($api);
+
 // write rows
 
 foreach ($persons as $person) {
     $person_id=$person['person_id'];
     $email=$person['email'];
-    $shortname = $peers->shortname($person['peer_id']);
     $site_id=$person['site_ids'][0];
     $site=$site_hash[$site_id];
     $login_base = $site['login_base'];
     $roles = plc_vertical_table ($person['roles']);
+    $peer_id=$person['peer_id'];
 
     $table->row_start();
     
-    $table->cell($shortname);
-    $table->cell ($person['first_name']);
-    $table->cell ($person['last_name']);
+    $peers->cell($table,$peer_id);
+    $table->cell (href(l_person($person_id),$person['first_name']));
+    $table->cell (href(l_person($person_id),$person['last_name']));
     $table->cell(l_person_t($person_id,$email));
-    $table->cell(l_site_t($site_id,$login_base));
-    $table->cell($roles);
+    $table->cell(l_site_t($site_id,$login_base),array('only-if'=>!$peer_id));
+    $table->cell($roles,array('only-if'=>!$peer_id));
     $table->cell(count($person['slice_ids']));
     $table->cell(person_status($person));
     $table->row_end();
                                 
 }
-$notes=array("The S column shows the number of slices for the given user");
+$notes = array();
+$notes []= "R = roles";
+$notes []= "S = number of slices";
 $table->end(array('notes'=>$notes));
+$nifty->end();
 
 //plekit_linetabs ($tabs,"bottom");